Skip to content

Commit

Permalink
Fix 'in' checks
Browse files Browse the repository at this point in the history
  • Loading branch information
shaunanoordin committed Mar 18, 2021
1 parent 62a7999 commit d2e4202
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions plugins/geo_json_renderer.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ async def render_geo_json(

for row in result:
# Is this a blatant Point object?
if 'longitude' in row and 'latitude' in row:
if 'longitude' in row.keys() and 'latitude' in row.keys():
# https://geojson.org/geojson-spec.html#id2
point = geojson.Point((row['longitude'], row['latitude']))
# create a geojson feature
Expand All @@ -34,7 +34,7 @@ async def render_geo_json(
feature_list.append(feature)

# Otherwise, does this have a "the_geom" object, which was used in the old Carto database, which encodes geographical data as a string in the "well-known binary" format?
elif 'the_geom' in row:
elif 'the_geom' in row.keys():
feature = Geometry(row['the_geom'])
feature_list.append(feature)

Expand Down

0 comments on commit d2e4202

Please sign in to comment.