Skip to content

Specifying significant figures of points when serializing a shape to GeoJSON #2010

Answered by nk9
nk9 asked this question in Q&A
Discussion options

You must be logged in to vote

Indeed! When I write the file with Fiona, making a change to a single feature in QGIS and then saving only changes the line of the feature I modified. This is also just way less fragile than the GeoJSON Encoder I wrote. Easier and more robust, love it! Thanks a bunch.

For anyone who wants to do this, just follow the Writing new files from scratch section in the Fiona docs. Note that if you want to write several features to a single file (all of which need to be the same type), you need to use writerecords instead of just write. Also, I had to manually provide the geometry type in the schema, instead of using shapely.mapping(). This is because my shapely objects, which were converted from …

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@nk9
Comment options

@nk9
Comment options

Answer selected by nk9
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants