Implemented mechanism that can continue interrupted work to continue later at some point, or to re-generate an ortho photo. Fixed layering of small rivers/streams
This commit is contained in:
parent
c412a41291
commit
3566992860
@ -99,6 +99,8 @@ mstr_ortho_layers = [
|
|||||||
("landuse", "farmyard", "landuse", "farmland"),
|
("landuse", "farmyard", "landuse", "farmland"),
|
||||||
("landuse", "military", "landuse", "residential-boundary"),
|
("landuse", "military", "landuse", "residential-boundary"),
|
||||||
# Z-Order 2
|
# Z-Order 2
|
||||||
|
("waterway", "river", 10),
|
||||||
|
("waterway", "stream", 10),
|
||||||
("leisure", "nature_reserve", "landuse", "forest"),
|
("leisure", "nature_reserve", "landuse", "forest"),
|
||||||
("landuse", "forest", "landuse", "forest"),
|
("landuse", "forest", "landuse", "forest"),
|
||||||
# Z-Order 3
|
# Z-Order 3
|
||||||
@ -108,8 +110,6 @@ mstr_ortho_layers = [
|
|||||||
("water", "lake", "natural", "water"),
|
("water", "lake", "natural", "water"),
|
||||||
("water", "pond", "natural", "water"),
|
("water", "pond", "natural", "water"),
|
||||||
("water", "river", "natural", "water"),
|
("water", "river", "natural", "water"),
|
||||||
("waterway", "river", 10),
|
|
||||||
("waterway", "stream", 10),
|
|
||||||
("amenity", "parking", "amenities", "parking"),
|
("amenity", "parking", "amenities", "parking"),
|
||||||
("highway", "pedestrian", 4),
|
("highway", "pedestrian", 4),
|
||||||
# Z-Order 4
|
# Z-Order 4
|
||||||
|
@ -89,47 +89,53 @@ class mstr_orthographic:
|
|||||||
osmxml.adjust_bbox(bb_lat, bb_lng, bb_lat_edge, bb_lng_edge)
|
osmxml.adjust_bbox(bb_lat, bb_lng, bb_lat_edge, bb_lng_edge)
|
||||||
mstr_msg("mstr_orthographic", "Adjusted bounding box for XML object")
|
mstr_msg("mstr_orthographic", "Adjusted bounding box for XML object")
|
||||||
|
|
||||||
# Get the data
|
# Determine what to do... maybe work was interrupted
|
||||||
osmxml.acquire_osm(cur_tile_y, cur_tile_x) # <- This acquires current OSM info
|
if os.path.isfile(mstr_datafolder + "Tiles\\" + str(self._lat) + "_" + str(self._long) + "\\Textures\\" + str(cur_tile_y) + "_" + str(cur_tile_x) + ".jpg") == False:
|
||||||
mstr_msg("mstr_orthographic", "Acquired current OSM info from marstr.online repository")
|
|
||||||
|
|
||||||
# Check for work to be done
|
# Let the user know
|
||||||
layers = self.determineLayerWork()
|
mstr_msg("mstr_orthographic", "Generating missing orthophoto " + str(cur_tile_y) + "-" + str(cur_tile_x))
|
||||||
|
|
||||||
# We need to walk through the array of layers,
|
# Get the data
|
||||||
# in their z-order.
|
osmxml.acquire_osm(cur_tile_y, cur_tile_x) # <- This acquires current OSM info
|
||||||
# For each layer, we will generate the mask, the layer image
|
mstr_msg("mstr_orthographic", "Acquired current OSM info from marstr.online repository")
|
||||||
# itself, and finally, compose the ortho photo.
|
|
||||||
mstr_msg("mstr_orthographic", "Beginning generation of layers")
|
|
||||||
|
|
||||||
# Generate the Tiles/lat-lng folder for the finished tile
|
# Check for work to be done
|
||||||
if not os.path.exists(self._output + "/Tiles/"+str(self._lat)+"_"+str(self._long) + "\\Textures"):
|
layers = self.determineLayerWork()
|
||||||
os.makedirs(self._output + "/Tiles/"+str(self._lat)+"_"+str(self._long)+"\\Textures")
|
|
||||||
mstr_msg("mstr_orthographic", "Created tile textures folder")
|
|
||||||
|
|
||||||
# Generate the Tiles/terrain folder for the finished tile
|
# We need to walk through the array of layers,
|
||||||
if not os.path.exists(self._output + "/Tiles/"+str(self._lat)+"_"+str(self._long) + "\\terrain"):
|
# in their z-order.
|
||||||
os.makedirs(self._output + "/Tiles/"+str(self._lat)+"_"+str(self._long)+"\\terrain")
|
# For each layer, we will generate the mask, the layer image
|
||||||
mstr_msg("mstr_orthographic", "Created tile terrain folder")
|
# itself, and finally, compose the ortho photo.
|
||||||
|
mstr_msg("mstr_orthographic", "Beginning generation of layers")
|
||||||
|
|
||||||
for layer in layers:
|
# Generate the Tiles/lat-lng folder for the finished tile
|
||||||
# Generate the mask
|
if not os.path.exists(self._output + "/Tiles/"+str(self._lat)+"_"+str(self._long) + "\\Textures"):
|
||||||
mg = mstr_maskgen( [self._lat, cur_tile_y, self._long, cur_tile_x], self._vstep, layer[0], layer[1], layer[2] )
|
os.makedirs(self._output + "/Tiles/"+str(self._lat)+"_"+str(self._long)+"\\Textures")
|
||||||
mg._build_mask()
|
mstr_msg("mstr_orthographic", "Created tile textures folder")
|
||||||
|
|
||||||
# Generate the layer
|
|
||||||
lg = mstr_layergen(layer[0], layer[1], self._lat, cur_tile_y, self._long, cur_tile_x, layer[2])
|
|
||||||
lg.genlayer()
|
|
||||||
mstr_msg("mstr_orthographic", "All layers created")
|
|
||||||
|
|
||||||
# We should have all layers now.
|
# Generate the Tiles/terrain folder for the finished tile
|
||||||
# Snap a photo with our satellite :)
|
if not os.path.exists(self._output + "/Tiles/"+str(self._lat)+"_"+str(self._long) + "\\terrain"):
|
||||||
mstr_msg("mstr_orthographic", "Generating ortho photo")
|
os.makedirs(self._output + "/Tiles/"+str(self._lat)+"_"+str(self._long)+"\\terrain")
|
||||||
pg = mstr_photogen(self._lat, self._long, cur_tile_y, cur_tile_x)
|
mstr_msg("mstr_orthographic", "Created tile terrain folder")
|
||||||
pg.genphoto()
|
|
||||||
mstr_msg("mstr_orthographic", "Ortho photo generated")
|
for layer in layers:
|
||||||
mstr_msg("", "") # <- Spacer
|
# Generate the mask
|
||||||
mstr_msg("", "") # <- Spacer
|
mg = mstr_maskgen( [self._lat, cur_tile_y, self._long, cur_tile_x], self._vstep, layer[0], layer[1], layer[2] )
|
||||||
|
mg._build_mask()
|
||||||
|
|
||||||
|
# Generate the layer
|
||||||
|
lg = mstr_layergen(layer[0], layer[1], self._lat, cur_tile_y, self._long, cur_tile_x, layer[2])
|
||||||
|
lg.genlayer()
|
||||||
|
mstr_msg("mstr_orthographic", "All layers created")
|
||||||
|
|
||||||
|
# We should have all layers now.
|
||||||
|
# Snap a photo with our satellite :)
|
||||||
|
mstr_msg("mstr_orthographic", "Generating ortho photo")
|
||||||
|
pg = mstr_photogen(self._lat, self._long, cur_tile_y, cur_tile_x)
|
||||||
|
pg.genphoto()
|
||||||
|
mstr_msg("mstr_orthographic", "Ortho photo generated")
|
||||||
|
print("")
|
||||||
|
print("")
|
||||||
|
|
||||||
# Store a terrain file
|
# Store a terrain file
|
||||||
'''
|
'''
|
||||||
|
Loading…
x
Reference in New Issue
Block a user