Skip to content

Commit

Permalink
in2csv supports GeoJSON files with geometry set to null, #871
Browse files Browse the repository at this point in the history
  • Loading branch information
James McKinney committed Jan 28, 2018
1 parent ba4923c commit d004634
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion csvkit/convert/geojs.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,10 @@ def geojson2csv(f, key=None, **kwargs):
property_fields.append(prop)

geometry = feature['geometry']
geometry_type = geometry.get('type')
if geometry:
geometry_type = geometry.get('type')
else:
geometry_type = None
if geometry_type == 'Point':
longitude, latitude = geometry['coordinates']
else:
Expand Down

0 comments on commit d004634

Please sign in to comment.