forked from vv01f/ccc-map
fix hauseno
This commit is contained in:
parent
8fd1b9e246
commit
a6e23b72ab
10
lookup.py
10
lookup.py
|
@ -37,23 +37,21 @@ firstline = True
|
|||
# start json list
|
||||
print ( '{"type":"FeatureCollection","features":[' )
|
||||
# get data from file
|
||||
eprint( "opening: "+fn )
|
||||
# ~ eprint( "opening: "+fn )
|
||||
with open( fn, 'r' ) as fp:
|
||||
for place in fp:
|
||||
#error handling: expect
|
||||
arrAddress = place.split(";")
|
||||
strAddress1 = str(" ".join(arrAddress[1:2]))
|
||||
eprint( "… "+strAddress1 )
|
||||
strAddress1 = arrAddress[1]+" "+arrAddress[2]
|
||||
strAddress2 = ",".join(arrAddress[3:5])
|
||||
eprint( "… "+strAddress2 )
|
||||
strAddress = strAddress1+","+strAddress2
|
||||
eprint( "looking up: "+strAddress )
|
||||
location = geolocator.geocode( strAddress )
|
||||
if location is not None: # its a class
|
||||
# todo: ceil coords to hide true location in format string
|
||||
# ~ strCoordPlace = '{:s},{:.6f},{:.6f}'.format( arrAddress[3], location.latitude, location.longitude )
|
||||
geojson = '{{"type":"Feature","geometry":{{"type":"Point","coordinates":[{:.'+str(precision)+'f},{:.'+str(precision)+'f}]}},"properties":{{"name":"anonentry","title":"{:s}","marker":"{:s}"}}}}';
|
||||
strCoordPlace = geojson.format( location.longitude, location.latitude, arrAddress[4], fn.split("-")[0] )
|
||||
geojson = '{{"type":"Feature","geometry":{{"type":"Point","coordinates":[{:.'+str(precision)+'f},{:.'+str(precision)+'f}]}},"properties":{{"name":"anonentry","marker":"veb-it"}}}}';
|
||||
strCoordPlace = geojson.format( location.longitude, location.latitude )
|
||||
if firstline == False :
|
||||
print (",")
|
||||
else:
|
||||
|
|
Loading…
Reference in New Issue