pygeoapi icon indicating copy to clipboard operation
pygeoapi copied to clipboard

OGR:WFS Support for CONVERT_TO_LINE

Open reinij opened this issue 2 years ago • 4 comments

OGR:WFS can't handle CURVEPOLYGON

e.g. CURVEPOLYGON ((9.8195 55.3263,9.8258 55.3209,9.8265 55.3201,9.8294 55.311,9.8298 55.3093,9.8298 55.3082,9.8294 55.3048,9.8285 55.3019,9.8274 55.3009,9.8257 55.3,9.8247 55.2997,9.8165 55.2987,9.8024 55.2965,9.7984 55.2989,9.7949 55.3031,9.7951 55.3036,9.7954 55.3054,9.7951 55.3082,9.7945 55.3104,9.7941 55.3112,9.7932 55.3122,9.7903 55.3143,9.7895 55.3153,9.7896 55.3162,9.7937 55.3238,9.7952 55.3256,9.7983 55.326,9.7993 55.326,9.8035 55.3234,9.8028 55.3225,9.8028 55.3218,9.8052 55.3191,9.806 55.3189,9.8101 55.3191,9.8114 55.3192,9.8118 55.3198,9.8115 55.3222,9.8111 55.323,9.8094 55.3232,9.8085 55.3231,9.8091 55.324,9.8156 55.326,9.8177 55.3262,9.8195 55.3263))

gives an error

[2022-03-04T11:19:17Z] {\pygeoapi\provider\ogr.py:819} ERROR - Error Number: 6, Type: Failure, Msg: OGR geometry type unsupported as a GeoJSON geometry detected. Feature gets NULL geometry assigned.
[2022-03-04T11:19:17Z] {\pygeoapi\provider\ogr.py:367} ERROR - <built-in function Geometry_ExportToJson> returned a result with an exception set

Adding parameter gdal_ogr_options: CONVERT_TO_LINEAR=YES (into config.yml) and subsequent code into ogr.py would fix an issue.

reinij avatar Mar 04 '22 10:03 reinij

https://github.com/geopython/pygeoapi/pull/863

reinij avatar Mar 08 '22 07:03 reinij

Ok, good catch! Curves show up from time to time. I see that there is a whole bunch: https://gdal.org/development/rfc/rfc49_curve_geometries.html

I can see what #863 does. For my understanding, CONVERT_TO_LINEAR=YES should convert any non-lineair geometry like in ogr2ogr (?). But apparently that option does not work and explicit conversion is still needed as in #863?

justb4 avatar Mar 08 '22 13:03 justb4

I found this implementation to be more straightforward and CONVERT_TO_LINEAR = YES is more on the command line, so I did not implement the gdal_ogr_options: selection.

reinij avatar Mar 08 '22 13:03 reinij

As per RFC4, this Issue has been inactive for 90 days. In order to manage maintenance burden, it will be automatically closed in 7 days.

github-actions[bot] avatar Mar 10 '24 21:03 github-actions[bot]

As per RFC4, this Issue has been closed due to there being no activity for more than 90 days.

github-actions[bot] avatar Mar 31 '24 03:03 github-actions[bot]