Opened 12 years ago
Closed 12 years ago
#4832 closed defect (fixed)
FileGDB has broken extents when features with no geometries are present.
Reported by: | cdestigter | Owned by: | Robert Coup |
---|---|---|---|
Priority: | normal | Milestone: | 1.9.2 |
Component: | OGR_SF | Version: | 1.9.1 |
Severity: | normal | Keywords: | |
Cc: |
Description
I have a CSV with 100 geometries, some of which are empty/null.
When I convert to FileGDB:
ogr2ogr -nlt POLYGON -f FileGDB csv2gdb.gdb null-geoms-head2.csv
I get a broken extent (note the (0, 0):
ogrinfo -so -al csv2gdb.gdb/ Warning 1: Empty Spatial Reference INFO: Open of `csv2gdb.gdb/' using driver `FileGDB' successful. Layer name: null_geoms_head2 Geometry: Multi Polygon Feature Count: 99 Extent: (0.000000, 0.000000) - (2437341.000000, 5683455.000000) Layer SRS WKT: (unknown) FID Column = OBJECTID Geometry Column = SHAPE WKT: String (0.0) id: String (0.0)
the CSV and GDB are in this zip (~100kb):
https://dl.dropbox.com/u/2649727/null-geoms.zip
With one much bigger layer, I also get some -MAXINT bits in my extent, but so far I haven't been able to reproduce that with a small enough sample to share here:
Feature Count: 1051140 Extent: (-2147483648.000000, -2147483648.000000) - (2496130.000000, 6223157.000000)
I tried shapefile and mapinfo tab and both are fine, appears this is FGDB specific.
Using gdal from ubuntugis - 1.9.1-2~precise4
Attachments (1)
Change History (9)
comment:1 by , 12 years ago
Owner: | changed from | to
---|
comment:2 by , 12 years ago
comment:3 by , 12 years ago
Status: | new → assigned |
---|
I've done some digging into this today - it seems that NULL/Empty geometry handling causes all sorts of weirdness with the FileGDB API - extents are broken, geometries are mysteriously duplicated, and IsEmpty() doesn't seem to round-trip.
There's also several ways to do things (geometryNull, shapeNull, shapeNull+SetEmpty(), SetNull("myGeomField")) so I need to find out which are the "right" ways to deal with these values.
comment:4 by , 12 years ago
Submitted upstream at: http://forums.arcgis.com/threads/68082-Null-amp-Empty-Geometries Test code for the above: https://gist.github.com/3813984
comment:5 by , 12 years ago
My proposed patch:
- turn EMPTY geometries into NULL
- set NULL geometries via
Row.SetNull(geometryFieldName)
- tests for the above
I'll wait until I hear from ESRI before I commit it.
by , 12 years ago
Attachment: | 4832-proposed.1.patch added |
---|
comment:8 by , 12 years ago
Milestone: | → 1.9.2 |
---|---|
Resolution: | → fixed |
Status: | assigned → closed |
aha, with the filegdb api 1.2 I get something even crazier: