question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

BUG: load_file() GeoJSON containing "": .* fails

See original GitHub issue

Hi, using geoJSON with an entry “”: “” does not work: { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ 8.694291999999999, 49.409639999999996 ] }, "properties": { "": "", "@osmId": "node/568461834", "@validFrom": "2009-11-22T15:47:35Z", "@validTo": "2009-11-22T15:49:21Z", "amenity": "cafe", "created_by": "iLOE 1.6", "name": "St. Anna Chocolaterie" } }

samplecafe_halfhalfhalfhalfhalfEmpty2.txt

https://tools.ietf.org/html/rfc7946 It is valid GeoJSON to have an empty property key

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
snowman2commented, Sep 12, 2020

With the fix here: https://github.com/Toblerity/Fiona/pull/955

>>> import geopandas
>>> gdf = geopandas.read_file("samplecafe_halfhalfhalfhalfhalfEmpty2.geojson")
>>> gdf
           @osmId  ...                  geometry
0  node/558798864  ...  POINT (8.69079 49.41474)
1  node/568461834  ...  POINT (8.69429 49.40964)

[2 rows x 24 columns]
>>> gdf.columns
Index(['@osmId', '@validFrom', '@validTo', 'addr:city', 'addr:housenumber',
       'addr:postcode', 'addr:street', 'addr:suburb', 'amenity', 'cuisine',
       'diet:vegan', 'diet:vegetarian', 'name', 'opening_hours',
       'outdoor_seating', 'phone', 'smoking', 'source', 'toilets:wheelchair',
       'website', 'wheelchair', '', 'created_by', 'geometry'],
      dtype='object')
1reaction
snowman2commented, Sep 17, 2020

The fix has been merged in upstream, so this issue can be closed.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Python json.load(file) error with valid JSON - Stack Overflow
There is no JSON data in it to parse. This is why the exception tells you that parsing failed at the very start...
Read more >
BUG: Loading in geojson through read_file misses certain ...
When reading in a specific kind of GeoJSON (output of an osmium-tool export to be exact) the read_file function skips over specific elements....
Read more >
Get error when I try to display a GeoJson file with Openlayers 3
And I get another error : XMLHttpRequest cannot load http://localhost/Web%20Mapping/fond.geojson. No 'Access-Control-Allow ...
Read more >
Python JSONDecodeError Explanation and Solution | CK
The Python JSONDecodeError indicates there is an issue with how a JSON object is formatted. To fix this error, you should read the...
Read more >
json — JSON encoder and decoder — Python 3.11.1 ...
Deserialize s (a str , bytes or bytearray instance containing a JSON document) to a Python object using this conversion table. The other...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found