Opened 8 years ago

Closed 8 years ago

#6262 closed defect (fixed)

ogr geojson not writing Geometry Collection bbox

Reported by: wmaddox Owned by: warmerdam
Priority: normal Milestone: 2.0.2
Component: OGR_SF Version: 2.0.1
Severity: normal Keywords:
Cc:

Description

Hello,

I noticed that when I try to save some geojson data to file, the line where the bbox should be is blank. After further study, I found that the line is actually not blank, but filled with 80 spaces. The culprit is in:

ogr/ogrsf_frmts/geojson/ogr_geojson.h

#define SPACE_FOR_BBOX 80

My bounding boxes are longer (95 chars):

"bbox": [ -109.890861747626857, 31.429616227820929, -109.890502331618748, 31.429927487647245 ]

I obviously do not need this much precision, but having to write extra code to make sure the values fall within the SPACE_FOR_BBOX value should not be necessary. In light of this, would it be possible to change the way the bbox is written to the file? Maybe create a dynamic bbox buffer rather than a fixed value of 80. If not, simply changing the SPACE_FOR_BBOX value from 80 to 100 would be acceptable.

Thanks

Change History (1)

comment:1 by Even Rouault, 8 years ago

Milestone: 2.0.2
Resolution: fixed
Status: newclosed

The reservation space is needed so as to be able bbox at the beginning of the file, if readers work in streaming mode.

trunk r32120 "GeoJSON: make sure there's enough space to write the FeatureCollection bbox (#6262). Also avoid duplicating FeatureCollection bbox if source has one (trunk only)"

branches/2.0 r32121 "GeoJSON: make sure there's enough space to write the FeatureCollection bbox (#6262)"

Note: See TracTickets for help on using tickets.