diff --git a/lookup.py b/lookup.py index 8a37770..a7bb475 100755 --- a/lookup.py +++ b/lookup.py @@ -29,7 +29,7 @@ precision = 2 firstline = True # start json list -print ( "[" ) +print ( '{"type":"FeatureCollection","features":[' ) # get data from file with open( fn, 'r' ) as fp: for place in fp: @@ -42,14 +42,14 @@ with open( fn, 'r' ) as fp: # 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":"{:s}","marker":"{:s}"}}}}'; - strCoordPlace = geojson.format( location.latitude, location.longitude, arrAddress[1], fn.split("-")[0] ) + strCoordPlace = geojson.format( location.longitude, location.latitude, arrAddress[1], fn.split("-")[0] ) if firstline == False : print (",") else: firstline = False print ( strCoordPlace ) # end json list -print ( "]" ) +print ( "]}" ) # exit fine sys.exit(0)