Commit 44546bae authored by Rick Gruber-Riemer's avatar Rick Gruber-Riemer

Small wording updates in documentation. Changing log levels to more conservative logging

parent bd957f8b
......@@ -125,7 +125,7 @@ def _get_nodes_from_acs(objs, own_prefix):
logging.verbose("CACHED_AC %s" % fname)
ac = read_objects[fname]
else:
logging.info("READ_AC %s" % fname)
logging.debug("READ_AC %s" % fname)
ac = ac3d_fast.File(file_name=fname, stats=None)
read_objects[fname] = ac
......
......@@ -85,7 +85,7 @@ As described in chapter :ref:`Getting OpenStreetMap data <chapter-getting-data-l
The default work flow is based on the sub-chapters of :ref:`Preparation <chapter-preparation-label>`:
#. :ref:`Run setup.py <chapter-run-setup-label>` depending on your chosen `Elevation Probing Mode <chapter-elev-modes-label>`.
#. :ref:`Run setup.py <chapter-run-setup-label>` depending on your chosen :ref:`Elevation Probing Mode <chapter-elev-modes-label>`.
#. Adapt ``params.ini``. This will get copied to several subdirectories as part of the next process steps. Most importantly apapt the parameter ``PATH_TO_OUTPUT`` (in the example below "/home/fg_customscenery/CH_OSM"). The ``PREFIX`` and ``BOUNDARY_*`` parameters will automatically be updated.
#. :ref:`Call build_tiles.py <chapter-build-tiles-label>`. This step creates sub-directories including a set of shell / command scripts. The top directory will be created in your ``WORKING_DIRECTORY`` and have the same name as the lon/lat area specified with argument ``-t``
#. If needed adapt the params.ini files in the sub-directories if you need to change specific characteristics within one tile (e.g. parameters for building height etc.). In most situations this will not be needed.
......@@ -113,11 +113,11 @@ Mandatory command line arguments:
Optional command line arguments:
* -p: You can use this option on Linux and Mac in order to generate scripts with parallel processing support and specify the max number of parallel processes when calling the generated scripts.
* -u: Which API to use to download OSM data on the fly.
* -u: The URL of the API to use to download OSM data on the fly (e.g. http://www.overpass-api.de/api/xapi_meta?). Only useful if argument ``-d`` is not used.
* -n: There are two implementations of downloading data on the fly. If this option is used, then a download program is used, which has better support for retries (FIXME: does this work?)
* -x: If ``python`` is not in your executable path or you want to specify a specific Python version if you have installed several versions, then use this argument (e.g. ``/usr/bin/python3.5``).
* -d: Instead of dynamic download an existing OSM data file as specified in the overall ``params.ini`` will be used. This can be used if e.g. ``curl`` is not available (mostly on Windows) or if you have problems with dynamic download or if you need to manipulate the OSM data after download and before processing. A pre-requisite for this is that you have Osmosis installed on your computer (see also :ref:`Getting OpenStreetMap Data <chapter-getting-data-label>`) — the path to the Osmosis executable needs to be specified with this command line argument.
* -o: the name of the copied params.ini files in the sub-directories
* -o: the name of the copied params.ini files in the sub-directories. There is rarely a reason to deviate from the standard and therefore using this parameter.
Calling build_tiles.py with optional argument ``-d`` could look like the following:
......
......@@ -52,6 +52,14 @@ Do the following:
#. Add the ``osm2city`` directory to your ``PYTHONPATH``. You can read more about this at https://docs.python.org/2/using/cmdline.html#envvar-PYTHONPATH.
#. Create soft links between as described in the following sub-chapter.
On Linux you would typically add something like the following to your ``.bashrc`` file:
::
PYTHONPATH=$HOME/develop_vcs/python3/osm2city
export PYTHONPATH
.. _Git: http://www.git-scm.com/
......
......@@ -113,21 +113,18 @@ LOD_PERCENTAGE_DETAIL Decimal 0.5 Of the rema
.. _chapter-parameters-clipping:
----------------
---------------
Clipping Region
----------------
---------------
The boundary of a scenery as specified by the parameters ``BOUNDARY_*`` is not necessarily sharp. As described in :ref:`Getting OpenStreetMap Data <chapter-getting-data-label>` it is recommended to use ``completeWays=yes``, when manipulating/getting OSM data - this happens also to be the case when using the `OSM Extended API`_ to retrieve data e.g. as part of :ref:`Working in batch mode <chapter-batch-mode>`. The parameters below give the possibility to influence, which data outside of the boundary is processed.
.. _`OSM Extended API`: http://wiki.openstreetmap.org/wiki/Xapi
BOUNDARY_CLIPPING = True
BOUNDARY_CLIPPING_BORDER_SIZE = 0.25
============================================= ======== ======= ==============================================================================
Parameter Type Default Description / Example
============================================= ======== ======= ==============================================================================
BOUNDARY_CLIPPING Boolean True If True the everythin outside the boundary is clipped away. This clipping
BOUNDARY_CLIPPING Boolean True If True the everything outside the boundary is clipped away. This clipping
includes ways (e.g. roads, buildings), where nodes outside the boundary
are removed.
If both this parameter and ``BOUNDARY_CLIPPING_COMPLETE_WAYS`` are set to
......@@ -138,7 +135,7 @@ BOUNDARY_CLIPPING_BORDER_SIZE Decimal 0.25 Additional
BOUNDARY_CLIPPING_COMPLETE_WAYS Boolean False If True it overrides ``BOUNDARY_CLIPPING`` and keeps all those ways, where the
first referenced node is within the boundary as specified by ``BOUNDARY_*``.
This leads to more a graceful handling when different adjacent sceneries are
This leads to a more graceful handling when different adjacent sceneries are
created (e.g. batch processing), such that e.g. roads not just stop on either
side of the boundary. However this comes with the cost of more needed
processing. Do not use if just one scenery area in one pass is created.
......
......@@ -232,12 +232,6 @@ class Building(object):
def area(self):
return self.polygon.area
# def translate(self, offset)
# shapely.affinity.translate(geom, xoff=0.0, yoff=0.0, zoff=0.0)
#print "tr X", self.X
class Buildings(object):
"""Holds buildings list. Interfaces with OSM handler"""
valid_node_keys = []
......@@ -263,7 +257,6 @@ class Buildings(object):
handler.register_uncategorized_way_callback(self.store_uncategorzied_way)
handler.register_relation_callback(self.process_relation, self.req_relation_keys)
# valid_relation_keys, req_relation_keys)
def _refs_to_ring(self, refs, inner=False):
"""accept a list of OSM refs, return a linear ring. Also
fixes face orientation, depending on inner/outer.
......@@ -273,8 +266,6 @@ class Buildings(object):
c = self.nodes_dict[ref]
coords.append(tools.transform.toLocal((c.lon, c.lat)))
#print "before inner", refs
# print "cord", coords
ring = shgm.polygon.LinearRing(coords)
# -- outer -> CCW, inner -> not CCW
if ring.is_ccw == inner:
......@@ -282,7 +273,7 @@ class Buildings(object):
return ring
def make_way_buildings(self):
#Converts all the ways into buildings
"""Converts all the ways into buildings"""
def tag_matches(tags, req_tags):
for tag in tags:
if tag in req_tags:
......@@ -294,7 +285,7 @@ class Buildings(object):
self._make_building_from_way(way.osm_id, way.tags, way.refs)
def _make_building_from_way(self, osm_id, tags, refs, inner_ways=[]):
#Creates a building object from a way
"""Creates a building object from a way"""
if refs[0] == refs[-1]:
refs = refs[0:-1] # -- kick last ref if it coincides with first
......@@ -302,7 +293,6 @@ class Buildings(object):
height = 0.
levels = 0
layer = 99
_building_type = 'unknown'
# -- funny things might happen while parsing OSM
try:
......@@ -315,7 +305,6 @@ class Buildings(object):
# pass
if 'name' in tags:
name = tags['name']
#print "%s" % _name
if name in parameters.SKIP_LIST:
logging.info("SKIPPING " + name)
return False
......@@ -334,17 +323,18 @@ class Buildings(object):
else:
_roof_type = parameters.BUILDING_UNKNOWN_ROOF_TYPE
_roof_height=0
_roof_height = 0
if 'roof:height' in tags:
try :
try:
_roof_height = float(tags['roof:height'])
except :
except:
_roof_height = 0
_building_type = building_lib.mapType(tags)
# -- simple (silly?) heuristics to 'respect' layers
if layer == 0: return False
if layer == 0:
return False
if layer < 99 and height == 0 and levels == 0:
levels = layer + 2
......@@ -367,9 +357,6 @@ class Buildings(object):
return False
building = Building(osm_id, tags, outer_ring, name, height, levels, inner_rings_list=inner_rings_list, building_type=_building_type, roof_type=_roof_type, roof_height=_roof_height, refs=refs)
# if building.osm_id == 3825399:
# print building
#
self.buildings.append(building)
tools.stats.objects += 1
......@@ -408,10 +395,7 @@ class Buildings(object):
outer_ways = []
inner_ways = []
outer_multipolygons = []
# print "rel: ", relation.osm_id, relation.tags #, members
for m in relation.members:
# print " member", m, m.type_, m.role
# if typ == 'way' and role == 'inner':
if m.type_ == 'way':
if m.role == 'outer':
for way in self.way_list:
......@@ -436,7 +420,7 @@ class Buildings(object):
if outer_multipolygons:
all_tags = relation.tags
for way in outer_multipolygons:
logging.info("Multipolygon " + str(way.osm_id))
logging.debug("Multipolygon " + str(way.osm_id))
all_tags = dict(list(way.tags.items()) + list(all_tags.items()))
res=False
try:
......@@ -454,10 +438,9 @@ class Buildings(object):
way.refs)
if outer_ways:
#print "len outer ways", len(outer_ways)
#all_outer_refs = [ref for way in outer_ways for ref in way.refs]
# build all_outer_refs
list_outer_refs = [ way.refs for way in outer_ways[1:] ]
list_outer_refs = [way.refs for way in outer_ways[1:]]
# get some order :
all_outer_refs = []
all_outer_refs.extend( outer_ways[0].refs )
......@@ -485,12 +468,12 @@ class Buildings(object):
if not parameters.EXPERIMENTAL_INNER and len(inner_ways) > 1:
print("FIXME: ignoring all but first inner way (%i total) of ID %i" % (len(inner_ways), relation.osm_id))
res = self._make_building_from_way(relation.osm_id,
all_tags,
all_outer_refs, [inner_ways[0]])
all_tags,
all_outer_refs, [inner_ways[0]])
else:
res = self._make_building_from_way(relation.osm_id,
all_tags,
all_outer_refs, inner_ways)
all_tags,
all_outer_refs, inner_ways)
# print ":::::mk_build returns", res,
# if bla:
# print relation.tags['name']
......@@ -503,14 +486,13 @@ class Buildings(object):
if _way in self.way_list:
logging.info("removing ways" + str(_way.osm_id))
# keep way if not closed, might be used elsewhere
if _way.refs[0] == _way.refs[-1] :
if _way.refs[0] == _way.refs[-1]:
self.way_list.remove(_way)
else:
logging.error("Outer way (%d) not in list of ways. Building type missing?"%_way.osm_id)
logging.error("Outer way (%d) not in list of ways. Building type missing?" % _way.osm_id)
def _get_min_max_coords(self):
for node in list(self.nodes_dict.values()):
#logging.debug('%s %.4f %.4f', _node.osm_id, _node.lon, _node.lat)
if node.lon > self.maxlon:
self.maxlon = node.lon
if node.lon < self.minlon:
......@@ -569,7 +551,7 @@ def write_xml(path, fname, buildings):
<pitch-deg> 0.00</pitch-deg>
<heading-deg>0.0 </heading-deg>
</offsets>
</model>""" % (-yo, xo, zo) )) # -- I just don't get those coordinate systems.
</model>""" % (-yo, xo, zo))) # -- I just don't get those coordinate systems.
if b.LOD is not None:
if b.LOD == Building.LOD_BARE:
......@@ -628,16 +610,16 @@ if __name__ == "__main__":
parser = argparse.ArgumentParser(description="osm2city reads OSM data and creates buildings for use with FlightGear")
parser.add_argument("-f", "--file", dest="filename",
help="read parameters from FILE (e.g. params.ini)", metavar="FILE", required=True)
parser.add_argument("-e", dest="e", action="store_true"
, help="skip elevation interpolation", required=False)
parser.add_argument("-c", dest="c", action="store_true"
, help="do not check for overlapping with static objects", required=False)
parser.add_argument("-a", "--create-atlas", action="store_true"
, help="create texture atlas", required=False)
parser.add_argument("-u", dest="uninstall", action="store_true"
, help="uninstall ours from .stg", required=False)
parser.add_argument("-l", "--loglevel"
, help="set loglevel. Valid levels are VERBOSE, DEBUG, INFO, WARNING, ERROR, CRITICAL", required=False)
parser.add_argument("-e", dest="e", action="store_true",
help="skip elevation interpolation", required=False)
parser.add_argument("-c", dest="c", action="store_true",
help="do not check for overlapping with static objects", required=False)
parser.add_argument("-a", "--create-atlas", action="store_true",
help="create texture atlas", required=False)
parser.add_argument("-u", dest="uninstall", action="store_true",
help="uninstall ours from .stg", required=False)
parser.add_argument("-l", "--loglevel",
help="set loglevel. Valid levels are VERBOSE, DEBUG, INFO, WARNING, ERROR, CRITICAL", required=False)
args = parser.parse_args()
# -- command line args override paramters
......@@ -659,7 +641,6 @@ if __name__ == "__main__":
parameters.show()
# -- initialize modules
# -- prepare transformation to local coordinates
......@@ -672,13 +653,9 @@ if __name__ == "__main__":
logging.info("reading elevation data")
elev = tools.get_interpolator(fake=parameters.NO_ELEV)
#elev.write("elev.out.small", 4)
#sys.exit(0)
logging.debug("height at origin" + str(elev(v.vec2d(0, 0))))
logging.debug("origin at " + str(tools.transform.toGlobal((0, 0))))
#tools.write_map('dresden.png', transform, elev, vec2d(minlon, minlat), vec2d(maxlon, maxlat))
# -- now read OSM data. Either parse OSM xml, or read a previously cached .pkl file
# End result is 'buildings', a list of building objects
pkl_fname = parameters.PREFIX + os.sep + parameters.OSM_FILE + '.pkl'
......@@ -706,40 +683,33 @@ if __name__ == "__main__":
logging.info("Reading the OSM file might take some time ...")
handler.parse(source)
#tools.stats.print_summary()
# tools.stats.print_summary()
buildings.make_way_buildings()
buildings._get_min_max_coords()
cmin = v.vec2d(buildings.minlon, buildings.minlat)
cmax = v.vec2d(buildings.maxlon, buildings.maxlat)
logging.info("min/max " + str(cmin) + " " + str(cmax))
#
# Search parents
#
if parameters.BUILDING_REMOVE_WITH_PARTS: # and 'building' not in building.tags :
#
# Build neighbours
#
def add_candidates(building, b_cands=[], used_refs=[], flag_init=True, recurs=0):
''' Build list of parent candidates for building, return parent if one of the candidates already parsed'''
"""Build list of parent candidates for building, return parent if one of the candidates already parsed"""
if recurs > 20 :
if recurs > 20:
return False
if flag_init is True:
used_refs = []
b_cands = []
#if recurs > 10 :
# return False
if flag_init == True :
used_refs=[]
b_cands=[]
if building not in b_cands :
if building not in b_cands:
b_cands.append(building)
process_refs = []
process_refs.extend(building.refs)
for ref in used_refs:
try :
try:
process_refs.remove(ref)
except:
pass
......@@ -788,7 +758,7 @@ if __name__ == "__main__":
cand_valid = False
if flag_search == 'equal':
if cand_building.polygon.intersection(building.polygon).equals(building.polygon):
if cand_building.polygon.intersection(building.polygon).equals(building.polygon):
cand_valid = True
if flag_search == 'intersects':
#
......@@ -828,47 +798,33 @@ if __name__ == "__main__":
buildings.remove_buildings_parts.append(building)
logging.info(" removed 'invisible' building:part " + str(building.osm_id))
return
# #break
else:
# store parent that is itset a building:part
# store parent that is itset a building:part
logging.verbose(" found possible " + str(cand_building.osm_id))
building.parents_parts.append(cand_building)
#building.parent_part.cand_building
return
except KeyError:
pass
#except :
# print("Unknown error processing cand_building building:part", cand_building.osm_id, "for ", building.osm_id)
# e = sys.exc_info()[0]
# print( "Error: %s" % e )
# pass
try:
if cand_building.tags['building'] != 'no':
#
# found building parent
#
#print(" found", cand_building.osm_id)
#buildings.buildings.remove(cand_building)
if cand_building not in buildings.remove_buildings:
buildings.remove_buildings.append(cand_building)
logging.info('Found Building for removing %d' % cand_building.osm_id)
if cand_building not in buildings.buildings_with_parts:
buildings.buildings_with_parts.append(cand_building)
#buildings.buildings_with_parts=list(set(self.buildings_with_parts))
logging.info('Found Building for removing %d' % cand_building.osm_id)
building.parent = cand_building
return
except KeyError:
pass
#except :
# print("Unknown error processing cand_building building", cand_building.osm_id, "for ", building.osm_id)
# e = sys.exc_info()[0]
# print( "Error: %s" % e )
# pass
else:
logging.verbose(" cand %i not in cand_buildings nor buildings_with_parts" % cand_building.osm_id)
......@@ -1193,7 +1149,7 @@ if __name__ == "__main__":
# newbuildings = []
logging.info("unpickled %g buildings ", len(buildings))
logging.info("Unpickled %g buildings ", len(buildings))
tools.stats.objects = len(buildings)
# -- debug filter
......@@ -1262,7 +1218,8 @@ if __name__ == "__main__":
for ic, cl in enumerate(clusters):
nb = len(cl.objects)
if nb < parameters.CLUSTER_MIN_OBJECTS: continue # skip almost empty clusters
if nb < parameters.CLUSTER_MIN_OBJECTS:
continue # skip almost empty clusters
# -- get cluster center
offset = cl.center
......@@ -1270,13 +1227,14 @@ if __name__ == "__main__":
# -- count roofs == separate objects
nroofs = 0
for b in cl.objects:
if b.roof_complex: nroofs += 2 # we have 2 different LOD models for each roof
if b.roof_complex:
nroofs += 2 # we have 2 different LOD models for each roof
tile_elev = elev(cl.center)
center_global = v.vec2d(tools.transform.toGlobal(cl.center))
if tile_elev == -9999:
logging.warning("Skipping tile elev = -9999 at lat %.3f and lon %.3f", center_global.lat, center_global.lon)
continue # skip tile with improper elev
continue # skip tile with improper elev
#LOD_lists = []
#LOD_lists.append([]) # bare
......
......@@ -318,14 +318,14 @@ def show():
def read_from_file(filename):
logging.info('Reading parameters from file: %s' % filename)
default_globals = globals()
file_globals = {'textures': default_globals['textures']}
file_globals = dict() # {'textures': default_globals['textures']}
try:
exec(compile(open(filename).read(), filename, 'exec'), file_globals)
except IOError as reason:
logging.error("Error processing file with parameters: %s", reason)
sys.exit(1)
except NameError:
print(traceback.format_exc())
logging.error(traceback.format_exc())
logging.error("Error while reading " + filename + ". Perhaps an unquoted string in your parameters file?")
sys.exit(1)
......
......@@ -20,7 +20,6 @@ import osm2city
import tools
from vec2d import vec2d
import calc_tile
from pdb import pm
import time
......@@ -39,7 +38,7 @@ class STG_File(object):
self.our_ac_file_name_list = []
self.magic = magic
self.prefix = prefix
#deprecated usage
# deprecated usage
self.our_magic_start = delimiter_string(self.magic, None, True)
self.our_magic_end = delimiter_string(self.magic, None, False)
self.our_magic_start_new = delimiter_string(self.magic, prefix, True)
......@@ -53,12 +52,11 @@ class STG_File(object):
lines = stg.readlines()
stg.close()
except IOError as reason:
logging.warning("error reading %s: %s", self.file_name, reason)
logging.info("Error reading %s as it might not exist yet: %s", self.file_name, reason)
return
temp_other_list = []
#deal with broken files containing several sections (old version)
# deal with broken files containing several sections (old version)
while lines.count(self.our_magic_start) > 0:
try:
ours_start = lines.index(self.our_magic_start)
......@@ -72,12 +70,11 @@ class STG_File(object):
ours_end = len(lines)
temp_other_list = temp_other_list + lines[:ours_start]
# self.our_list = lines[ours_start+1:ours_end]
lines = lines[ours_end+1:]
temp_other_list = temp_other_list + lines
self.other_list = []
#deal with broken files containing several sections (new version)
# deal with broken files containing several sections (new version)
while temp_other_list.count(self.our_magic_start_new) > 0:
try:
ours_start = temp_other_list.index(self.our_magic_start_new)
......@@ -91,11 +88,9 @@ class STG_File(object):
ours_end = len(temp_other_list)
self.other_list = self.other_list + lines[:ours_start]
# self.our_list = lines[ours_start+1:ours_end]
temp_other_list = temp_other_list[ours_end+1:]
self.other_list = self.other_list + temp_other_list
def drop_ours(self):
"""Clear our list. Call write() afterwards to finish uninstall"""
self.our_list = []
......@@ -130,21 +125,21 @@ class STG_File(object):
def write(self):
"""write others and ours to file"""
#read directly before write to
# read directly before write to
self.read()
self.make_path_to_stg()
stg = open(self.file_name, 'w')
logging.info("Writing %d other lines"%len(self.other_list))
logging.info("Writing %d other lines" % len(self.other_list))
for line in self.other_list:
stg.write(line)
if self.our_list:
logging.info("Writing %d lines"%len(self.our_list))
logging.info("Writing %d lines" % len(self.our_list))
stg.write(self.our_magic_start_new)
stg.write("# do not edit below this line\n")
stg.write("# Last Written %s\n#\n"%time.strftime("%c"))
for line in self.our_list:
logging.info(line.strip())
logging.debug(line.strip())
stg.write(line)
stg.write(self.our_magic_end_new)
......@@ -156,7 +151,7 @@ class STG_Manager(object):
prefix separates different writers to work around two PREFIX areas interleaving
"""
def __init__(self, path_to_scenery, magic, prefix=None, overwrite=False):
self.stg_dict = {} # maps tile index to stg object
self.stg_dict = dict() # maps tile index to stg object
self.path_to_scenery = path_to_scenery
self.overwrite = overwrite
self.magic = magic
......@@ -170,7 +165,7 @@ class STG_Manager(object):
except KeyError:
the_stg = STG_File(lon_lat, tile_index, self.path_to_scenery, self.magic, self.prefix)
self.stg_dict[tile_index] = the_stg
if overwrite == None:
if overwrite is None:
overwrite = self.overwrite
if overwrite:
# this will only drop the section we previously wrote ()
......@@ -229,8 +224,6 @@ def read_stg_entries(stg_path_and_name, our_magic, ignore_bad_lines=False):
TODO: In the future, take care of multiple scenery paths here.
TODO: should be able to take a list of our_magic"""
entries = [] # list of STGEntry objects
logger = logging.getLogger("stgio2")
if None is not our_magic:
our_magic_start = delimiter_string(our_magic, None, True)
......@@ -262,23 +255,23 @@ def read_stg_entries(stg_path_and_name, our_magic, ignore_bad_lines=False):
hdg = float(splitted[5])
entry = STGEntry(type_, obj_filename, path, lon, lat, elev, hdg)
entries.append(entry)
logger.debug("stg: %s %s", type_, entry.get_obj_path_and_name())
logging.debug("stg: %s %s", type_, entry.get_obj_path_and_name())
except ValueError as reason:
if not ignore_bad_lines:
logger.warning("stg_io:read: Damaged file %s", reason)
logger.warning("Damaged line: %s", line.strip())
logging.warning("stg_io:read: Damaged file %s", reason)
logging.warning("Damaged line: %s", line.strip())
return []
else:
logger.warning("Damaged line: %s", line.strip())
logging.warning("Damaged line: %s", line.strip())
except IndexError as reason:
if not ignore_bad_lines:
logger.warning("stg_io:read: Ignoring unreadable file %s", reason)
logger.warning("Offending line: %s", line.strip())
logging.warning("stg_io:read: Ignoring unreadable file %s", reason)
logging.warning("Offending line: %s", line.strip())
return []
else:
logger.warning("Damaged line: %s", line.strip())
logging.warning("Damaged line: %s", line.strip())
except IOError as reason:
logger.warning("stg_io:read: Ignoring unreadable file %s", reason)
logging.warning("stg_io:read: Ignoring unreadable file %s", reason)
return []
return entries
......@@ -289,10 +282,10 @@ def read(path, stg_fname, our_magic):
building_objs = []
for entry in stg_entries:
point = shg.Point(tools.transform.toLocal((entry.lon, entry.lat)))
building_objs.append(osm2city.Building(osm_id=-1, tags=-1, outer_ring=point
, name=entry.get_obj_path_and_name()
, height=0, levels=0, stg_typ=entry.get_object_type_as_string()
, stg_hdg=entry.hdg))
building_objs.append(osm2city.Building(osm_id=-1, tags=-1, outer_ring=point,
name=entry.get_obj_path_and_name(),
height=0, levels=0, stg_typ=entry.get_object_type_as_string(),
stg_hdg=entry.hdg))
return building_objs
......
......@@ -219,11 +219,8 @@ class Probe_fgelev(object):
self._cache = pickle.load(fpickle)
fpickle.close()
logging.info("OK")
except IOError as reason:
logging.warning("Loading elev cache failed (%s)", reason)
self._cache = {}
except EOFError as reason:
logging.warning("Loading elev cache failed (%s)", reason)
except (IOError, EOFError) as reason:
logging.info("Loading elev cache failed (%s)", reason)
self._cache = {}
else:
self._cache = None
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment