Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AG-70: Boundary Type #65

Merged
merged 3 commits into from
May 5, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
AG-70: Boundary type added.
  • Loading branch information
MHA10 committed May 5, 2023
commit aa66aca1b1c2574280ec35ae367faa60e0484c0a
4 changes: 3 additions & 1 deletion utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -364,10 +364,12 @@ def fetch_fields_for_geo_ids(geo_ids, s2_index=None):
s2_indexes_to_remove = Utils.get_s2_indexes_to_remove(s2_index_to_fetch)
for geo_id in geo_ids:
geo_data_to_return = {}
geo_data = json.loads(GeoIds.query.filter(GeoIds.geo_id == geo_id).first().geo_data)
geo_data_object = GeoIds.query.filter(GeoIds.geo_id == geo_id).first()
geo_data = json.loads(geo_data_object.geo_data)
if s2_index and s2_indexes_to_remove != -1:
geo_data_to_return = Utils.get_specific_s2_index_geo_data(json.dumps(geo_data), s2_indexes_to_remove)
geo_data_to_return['Geo JSON'] = Utils.get_geo_json(geo_data['wkt'])
geo_data_to_return['boundary_type'] = geo_data_object.boundary_type
fields_to_return.append({geo_id: geo_data_to_return})
return fields_to_return

Expand Down