Opened 13 years ago

Closed 13 years ago

#3995 closed defect (fixed)

Nested holes when using ogr2ogr mid-mif -> postgis

Reported by: poulet1212 Owned by: warmerdam
Priority: normal Milestone:
Component: OGR_SF Version: 1.7.2
Severity: normal Keywords: nested holes postgis mid mif
Cc: Daniel Morissette, aboudreault

Description (last modified by poulet1212)

When using ogr2ogr tool to convert multipolygons having nested holes from mid-mif to postgis, the resulting postgis table does not contain nested hole. In fact, these holes exists but they are "filled" with a polygon.

Ive seen a post about it there: http://medspx.homelinux.org/blog/Qgis/postgis_nested_holes.html (sorry its in french)

The weird is that if I convert a SHAPE dataset that contains nested holes to postgis, these are converted correctly.

-Ignore the first file. The zip files contain vegetal coverage polygons, it contains nested holes that are buildings.

The cammand I used is like:

ogr2ogr -progress -a_srs EPSG:21781 -f PostgreSQL PG:"dbname=postgis host=localhost port=5432 user=postgres password=postgis" -nln mid-mif-exported-table C:\temp\MOVD_CAD_TPR_CSVERT_S.mif MOVD_CAD_TPR_CSVERT_S

I can attach the mid/mif and shp files I used.

Attachments (3)

MOVD_CAD_TPR_CSVERT_S.mid (20.1 KB ) - added by poulet1212 13 years ago.
MifMidOutput.zip (310.3 KB ) - added by poulet1212 13 years ago.
cadastral_shp.zip (6.7 KB ) - added by poulet1212 13 years ago.

Download all attachments as: .zip

Change History (8)

by poulet1212, 13 years ago

Attachment: MOVD_CAD_TPR_CSVERT_S.mid added

by poulet1212, 13 years ago

Attachment: MifMidOutput.zip added

by poulet1212, 13 years ago

Attachment: cadastral_shp.zip added

comment:1 by poulet1212, 13 years ago

Description: modified (diff)

comment:2 by Even Rouault, 13 years ago

Cc: Daniel Morissette aboudreault added
Component: UtilitiesOGR_SF

Not sure if this is really an issue with the MIF/MID driver or with the data file. When doing a ogrinfo on it, I can see inner rings being reported for some polygons.

comment:3 by poulet1212, 13 years ago

Ok. Do you have a sample mid/mif dataset with nested holes that I can check if they appear correctly once transformed in postgis?

comment:4 by Daniel Morissette, 13 years ago

I see the version is set to 1.7.2 in the ticket. Could this be something that was fixed in 1.8.0? That would explain why rouault sees the inner rings and poulet1212 doesn't.

I know we've added calls to OGRGeometryFactory::organizePolygons for mif features at some point, but I'm not sure to which GDAL/OGR version that corresponds.

comment:5 by poulet1212, 13 years ago

Resolution: fixed
Status: newclosed

Ok, I've tried with the latest 1.8 build and now the inner rings appear correctly when transforming mid/mif files to Postgis. So it is something that has been fixed in 1.8 and still I use 1.7 I did not see it. However I'm gonna move to this version and also follow the new ones :-)

Thanks a lot for your comments.

Note: See TracTickets for help on using tickets.