I tried to read a GeoJSON file with Pandas, but I got a ValueError message:
'ValueError: Expected object or value'
Here's the approach I used:
import pandas as pd
geojsonPath = r"Z:\dems\address.geojson"
pd_json = pd.io.json.read_json(geojsonPath,lines=True)
pd_json.head()
Attached is an extract from the file
{
"type": "FeatureCollection",
"name": "cameron-addresses-county",
"crs": { "type": "name", "properties": { "name": "urn:ogc:def:crs:OGC:1.3:CRS84" } },
"features": [
{ "type": "Feature", "properties": { "X": -78.1422444, "Y": 41.3286117, "hash": "93dd7b7e3ee3e8af", "number": "501", "street": "CASTLE GARDEN RD", "unit": null, "city": null, "district": null, "region": null, "postcode": null, "id": 7579 }, "geometry": { "type": "Point", "coordinates": [ -78.1422444, 41.3286117 ] } },
{ "type": "Feature", "properties": { "X": -78.143584, "Y": 41.3284045, "hash": "853eb0c5f6e70fe3", "number": "64", "street": "BELDIN DR", "unit": null, "city": null, "district": null, "region": null, "postcode": null, "id": 4502 }, "geometry": { "type": "Point", "coordinates": [ -78.143584, 41.3284045 ] } },
{ "type": "Feature", "properties": { "X": -78.1711061, "Y": 41.3282128, "hash": "99a13ba635404d80", "number": "9760", "street": "MIX RUN RD", "unit": null, "city": null, "district": null, "region": null, "postcode": null, "id": 8448 }, "geometry": { "type": "Point", "coordinates": [ -78.1711061, 41.3282128 ] } },
{ "type": "Feature", "properties": { "X": -78.1429278, "Y": 41.3282883, "hash": "70319cf9e435b858", "number": null, "street": null, "unit": null, "city": null, "district": null, "region": null, "postcode": null, "id": null }, "geometry": { "type": "Point", "coordinates": [ -78.1429278, 41.3282883 ] } },
{ "type": "Feature", "properties": { "X": -78.1427173, "Y": 41.3282733, "hash": "759f051e7a587eb2", "number": "465", "street": "CASTLE GARDEN RD", "unit": null, "city": null, "district": null, "region": null, "postcode": null, "id": 6447 }, "geometry": { "type": "Point", "coordinates": [ -78.1427173, 41.3282733 ] } },
{ "type": "Feature", "properties": { "X": -78.1433463, "Y": 41.3282308, "hash": "9fbb571fc16a6cb2", "number": "61", "street": "BELDIN DR", "unit": null, "city": null, "district": null, "region": null, "postcode": null, "id": 4466 }, "geometry": { "type": "Point", "coordinates": [ -78.1433463, 41.3282308 ] } },
{ "type": "Feature", "properties": { "X": -78.1432403, "Y": 41.3282179, "hash": "8f837d813626f1e1", "number": null, "street": null, "unit": null, "city": null, "district": null, "region": null, "postcode": null, "id": null }, "geometry": { "type": "Point", "coordinates": [ -78.1432403, 41.3282179 ] } },
{ "type": "Feature", "properties": { "X": -78.1715165, "Y": 41.3280965, "hash": "5004ba87bd6e668b", "number": "9736", "street": "MIX RUN RD", "unit": null, "city": null, "district": null, "region": null, "postcode": null, "id": 7434 }, "geometry": { "type": "Point", "coordinates": [ -78.1715165, 41.3280965 ] } }