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

Say which polygon had the problem #10829

Open
jidanni opened this issue Sep 18, 2024 · 2 comments · May be fixed by #10832
Open

Say which polygon had the problem #10829

jidanni opened this issue Sep 18, 2024 · 2 comments · May be fixed by #10832
Assignees

Comments

@jidanni
Copy link
Contributor

jidanni commented Sep 18, 2024

Feature description

Say which polygon had the problem, not just where the problem occured.

Additional context

Warning 1: Self-intersection at or near point 120.86613015662651 24.181914020080345
ERROR 6: Invalid polygon

That's simple to investigate...
assuming the user has only one polygon!

Because there might be many polygons at or near that point, the only way to figure out which one is to test them one by one.

Therefore the program could be made more helpful, if it simply also printed the offending polygon, in e.g., WKT format. Or at least some further information about which polygon it was of the many polygons in the input.

(Also do please quit with an error to the shell, (perhaps already fixed.))

@rouault
Copy link
Member

rouault commented Sep 18, 2024

(Also do please quit with an error to the shell, (perhaps already fixed.))

@jidanni with which utility? Please provide command line and input file to reproduce

@rouault rouault self-assigned this Sep 18, 2024
rouault added a commit to rouault/gdal that referenced this issue Sep 18, 2024
Fixes OSGeo#10829

Example
```
$ ogr2ogr -f LIBKML test.kml test.csv || echo "==> failed"
Warning 1: Self-intersection at or near point 0.5 0.5
ERROR 6: Invalid polygon
ERROR 1: Cannot translate feature: OGRFeature(test):-1
  id (Integer) = 1
  i (Integer) = -21121
  WKT (String) = POLYGON((0 0,1 1,1 0,0 1,0 0))
  POLYGON ((0 0,1 1,1 0,0 1,0 0))

ERROR 1: Unable to write feature 1 from layer test.
ERROR 1: Terminating translation prematurely after failed
translation of layer test (use -skipfailures to skip errors)
==> failed
```
@rouault
Copy link
Member

rouault commented Sep 18, 2024

I figured out this was the LIBKML driver...

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

Successfully merging a pull request may close this issue.

2 participants