I used the following command to reproject a GeoJSON from lat/lon to 3857:
ogr2ogr -f "GeoJSON" results_3857.json -t_srs "EPSG:3857" results.json
Unexpectedly, the resulting file was 5 times larger than the original.
Turns out the resulting file contains all properties for each feature, while the original contained only those properties that were not null
.
For example the original might have had a properties objects that look like this:
..."properties": { a: 1, d: 2, f: 1 }....
..."properties": { b: 1, c: 2, d: 2 }...
while the newly reprojected file has converted them to look like this:
..."properties": { a: 1, b: null, c: null, d: 2, e: null, f: 1 }...
..."properties": { a: null, b: 1, c: 2, d: 2, e: null, f: null }...
I don't want these extra null
entries in my reprojected GeoJSON.
And so my question is this:
How can I remove those properties that have null
values from the GeoJSON?
Is there some flag I can use in the ogr2ogr command?
Maybe there is a subsequent gdal command I can use to remove those attributes that have a null value?