Skip to content

Commit

Permalink
Create proper geodata JSON
Browse files Browse the repository at this point in the history
This is basically a hack that’ll need to be fixed later, per #78.

Closes #82.
  • Loading branch information
waldoj committed Nov 11, 2014
1 parent d7371fb commit 60ab5b8
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions crump
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -165,9 +165,15 @@ def main():
except KeyError:
search_index[file_number]['properties'][name]['type'] = 'string'
else:
search_index[file_number]['properties'][name]['type'] = map['search']['type']
if map['search']['type'] == "geo_shape":
search_index[file_number]['properties'][name]['lat_lon'] = 'true'
if map['search']['type'] == "geo_point":
search_index[file_number]['properties']['location'] = {}
search_index[file_number]['properties']['location']['type'] = 'object'
search_index[file_number]['properties']['location']['properties'] = {}
search_index[file_number]['properties']['location']['properties']['coordinates'] = {}
search_index[file_number]['properties']['location']['properties']['coordinates']['type'] = 'geo_point'
search_index[file_number]['properties']['location']['properties']['coordinates']['lat_lon'] = 'true'
else:
search_index[file_number]['properties'][name]['type'] = map['search']['type']

try:
map['search']['match']
Expand Down

0 comments on commit 60ab5b8

Please sign in to comment.