示例#1
0
            temp = float(
                re.findall(r'[-+]?\d*\.\d+|\d+',
                           line[line.find('maxlon'):])[0])
            if maxlon is None or maxlon < temp:
                maxlon = temp

if minlat is None or minlon is None or maxlat is None or maxlon is None:
    sys.stderr.write(
        'Warning: impossible to get the map bounds from the OSM file,'
        ' make sure the file contains the "bounds" tag.\n')
    sys.exit(0)

# Define the projection
lat0 = 0.5 * (maxlat + minlat)
long0 = 0.5 * (maxlon + minlon)
Projection.initProjection(long0, lat0, options.projection)

# Deal with the `extract-projection` argument
if options.extractProjection:
    print(Projection.getProjectionString())
    sys.exit()

# apply options to Webots objects
WebotsObject.enable3D = options.enable3D
WebotsObject.layerHeight = options.layer
WebotsObject.removalRadius = options.removalRadius
Road.noIntersectionRoadLines = options.noIntersectionRoadLines
Area.noForests = options.noForests

# get settings from config file
configFile = options.configFile