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

Getting NATIVE_DATA from GeoJSON #997

Open
Jamim opened this issue Jan 25, 2021 · 2 comments
Open

Getting NATIVE_DATA from GeoJSON #997

Jamim opened this issue Jan 25, 2021 · 2 comments

Comments

@Jamim
Copy link

Jamim commented Jan 25, 2021

Hello everyone,
It would be great if someone could help me with getting native data from GeoJSONs with fiona.

Expected behavior and actual behavior.

I expected to be able to read NATIVE_DATA from a GeoJSON file but didn't find a way to do so.

Steps to reproduce the problem.

import fiona

with fiona.open(
    'test.geojson',
    'w',
    driver='GeoJSON',
    schema={'geometry': 'MultiPolygon'},
    native_data={'foo': 'bar'},
    native_media_type='application/vnd.geo+json',
) as dst:
    pass
$ cat test.geojson
{
"type": "FeatureCollection",
"foo": "bar",
"features": [

]
}
with fiona.open('test.geojson', 'r', native_data=True) as src:
    'No idea how to get the native data.'

Operating system

Ubuntu 20.04

Fiona and GDAL version and provenance

1.8.18 installed with Pipenv

GDAL 3.0.4

@sgillies
Copy link
Member

sgillies commented Apr 1, 2021

@Jamim the fiona API will let you access native data of features but not native data of the next level up, the feature collection.

@sgillies sgillies added this to the 1.9 milestone May 14, 2022
@sgillies sgillies removed this from the 1.9 milestone Dec 13, 2022
@sgillies
Copy link
Member

Deferring to 2.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants