Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OpenFileGDB driver: polygon topology error #1369

Closed
gjsa73 opened this issue Mar 17, 2019 · 6 comments
Closed

OpenFileGDB driver: polygon topology error #1369

gjsa73 opened this issue Mar 17, 2019 · 6 comments

Comments

@gjsa73
Copy link

gjsa73 commented Mar 17, 2019

Expected behavior and actual behavior.

Opening roads_clip GDB layer
layer1.zip
in ArCGIS produces the correct topology with a network of roads/tracks displayed 10m wide:

arcmap10_rendering

Large areas in between roads/tracks are falsely identified and rendered in QGIS3 as features:
qgis3_rendering

Note: FileGDB driver also results in the same topological error in QGIS3.

Steps to reproduce the problem.

Unzip layer1.zip and drag-and-drop "roads_clip Drawing.gdb" folder into QGIS3 map canvas (or open using the traditional method: Add layer -> Add Vector layer -> Directory/OpenFileGDB).

Operating system

Windows 10 Enterprise 64-Bit

GDAL version and provenance

2.4.0 (QGIS 3.7 Master).

@gjsa73 gjsa73 changed the title OpenGDB driver: polygon topology error OpenFileGDB driver: polygon topology error Mar 17, 2019
@rouault
Copy link
Member

rouault commented Mar 17, 2019

Which software produced this dataset ? The polygon rings are not oriented according to the normal convention of outer rings = clockwise, innter ring = counter-clockwise

@gjsa73
Copy link
Author

gjsa73 commented Mar 17, 2019 via email

@rouault
Copy link
Member

rouault commented Mar 17, 2019

Is there a reason why ArcGIS cash still resolve the layer correctly?

Probably they use a less optimized way of reconstructing multipolygons than what we do in GDAL by default, or they have a different drawing algorithm. Anyway you can workaround the issue by setting OGR_ORGANIZE_POLYGONS=DEFAULT as environment variable. I've also a fix for that particular situation that doesn't require it in the works. Can the dataset to this issue be considered as freely usable and included in the GDAL autotest suite ?

@gjsa73
Copy link
Author

gjsa73 commented Mar 18, 2019

Anyway you can workaround the issue by setting OGR_ORGANIZE_POLYGONS=DEFAULT as environment variable

Tried this and the problem remains. So I then did a Check Validity in QGIS3 on the layer and the only issue identified (besides self-intersections), was 'Nested shells'.

Running Fix geometries on the layer removed the 'Nested shells' because the error is no longer present on the fixed layer and the polygons are formed correctly.

So I'm now unsure if this is definitely or wholly related to the ring orientation as you suggested.

@rouault
Copy link
Member

rouault commented Mar 18, 2019

Regarding QGIS, I guess this might be due to it overriding this config option to ONLY_CCW in https://github.com/qgis/QGIS/blame/7757ffc5dd232b1be240984734e44282f390588a/src/providers/ogr/qgsogrprovider.cpp#L4265 . I don't think this is appropriate for QGIS to set that, at least without testing first if the configuration option is set. I'm going to create an issue about that

@rouault
Copy link
Member

rouault commented Mar 18, 2019

QGIS issue raised as https://issues.qgis.org/issues/21609

rouault added a commit that referenced this issue Mar 18, 2019
FileGDB/OpenFileGDB: be robust when winding order of outer ring is incorrect (fixes #1369)
rouault added a commit to rouault/QGIS that referenced this issue Mar 9, 2022
…tion

The OGR_ORGANIZE_POLYGONS configuration option is unconditionally set to ONLY_CCW in the OGR provider
I believe this is inappropriate (should honour the value the user might have defined itself),
and useless. The OGR shapefile driver uses the ONLY_CCW strategy by default.
And this setting prevent the fix for OSGeo/gdal#1369
for non-conformant multipolygons in FileGeodatabase to be effective from QGIS.

Fixes qgis#29425
nyalldawson pushed a commit to qgis/QGIS that referenced this issue Mar 14, 2022
…tion

The OGR_ORGANIZE_POLYGONS configuration option is unconditionally set to ONLY_CCW in the OGR provider
I believe this is inappropriate (should honour the value the user might have defined itself),
and useless. The OGR shapefile driver uses the ONLY_CCW strategy by default.
And this setting prevent the fix for OSGeo/gdal#1369
for non-conformant multipolygons in FileGeodatabase to be effective from QGIS.

Fixes #29425
qgis-bot pushed a commit to qgis/QGIS that referenced this issue Mar 14, 2022
…tion

The OGR_ORGANIZE_POLYGONS configuration option is unconditionally set to ONLY_CCW in the OGR provider
I believe this is inappropriate (should honour the value the user might have defined itself),
and useless. The OGR shapefile driver uses the ONLY_CCW strategy by default.
And this setting prevent the fix for OSGeo/gdal#1369
for non-conformant multipolygons in FileGeodatabase to be effective from QGIS.

Fixes #29425
qgis-bot pushed a commit to qgis/QGIS that referenced this issue Mar 14, 2022
…tion

The OGR_ORGANIZE_POLYGONS configuration option is unconditionally set to ONLY_CCW in the OGR provider
I believe this is inappropriate (should honour the value the user might have defined itself),
and useless. The OGR shapefile driver uses the ONLY_CCW strategy by default.
And this setting prevent the fix for OSGeo/gdal#1369
for non-conformant multipolygons in FileGeodatabase to be effective from QGIS.

Fixes #29425
nyalldawson pushed a commit to qgis/QGIS that referenced this issue Mar 14, 2022
…tion

The OGR_ORGANIZE_POLYGONS configuration option is unconditionally set to ONLY_CCW in the OGR provider
I believe this is inappropriate (should honour the value the user might have defined itself),
and useless. The OGR shapefile driver uses the ONLY_CCW strategy by default.
And this setting prevent the fix for OSGeo/gdal#1369
for non-conformant multipolygons in FileGeodatabase to be effective from QGIS.

Fixes #29425
nyalldawson pushed a commit to qgis/QGIS that referenced this issue Mar 14, 2022
…tion

The OGR_ORGANIZE_POLYGONS configuration option is unconditionally set to ONLY_CCW in the OGR provider
I believe this is inappropriate (should honour the value the user might have defined itself),
and useless. The OGR shapefile driver uses the ONLY_CCW strategy by default.
And this setting prevent the fix for OSGeo/gdal#1369
for non-conformant multipolygons in FileGeodatabase to be effective from QGIS.

Fixes #29425
lbartoletti pushed a commit to Oslandia/QGIS_CI that referenced this issue Apr 4, 2022
…tion

The OGR_ORGANIZE_POLYGONS configuration option is unconditionally set to ONLY_CCW in the OGR provider
I believe this is inappropriate (should honour the value the user might have defined itself),
and useless. The OGR shapefile driver uses the ONLY_CCW strategy by default.
And this setting prevent the fix for OSGeo/gdal#1369
for non-conformant multipolygons in FileGeodatabase to be effective from QGIS.

Fixes #29425
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants