B
bugmenot123
Guest
bugmenot123 Asks: Working with CIRCULARSTRING in OGR's sqlite dialect
but this does not work with some curve geometries, e. g. CIRCULARSTRING.
for example results in:
How can I work with such geometries when using the
References:
ogrinfo ":memory:" -dialect sqlite -sql "SELECT ST_GeomFromText('Point(1 2)')"
gives me a dataset with a geometry column:
Code:
INFO: Open of `:memory:'
using driver `SQLite' successful.
Layer name: SELECT
Geometry: Unknown (any)
Feature Count: 1
Extent: (1.000000, 2.000000) - (1.000000, 2.000000)
Layer SRS WKT:
(unknown)
Geometry Column = ST_GeomFromText('Point(1 2)')
OGRFeature(SELECT):0
POINT (1 2)
but this does not work with some curve geometries, e. g. CIRCULARSTRING.
Code:
ogrinfo ":memory:" -dialect sqlite -sql "SELECT ST_GeomFromText('CIRCULARSTRING(1 5, 6 2, 7 3)')"
for example results in:
Code:
INFO: Open of `:memory:'
using driver `SQLite' successful.
Layer name: SELECT
Geometry: None
Feature Count: 1
Layer SRS WKT:
(unknown)
ST_GeomFromText('CIRCULARSTRING(1 5, 6 2, 7 3)'): String (0.0)
OGRFeature(SELECT):0
ST_GeomFromText('CIRCULARSTRING(1 5, 6 2, 7 3)') (String) = (null)
How can I work with such geometries when using the
sqlite
dialect? I would be fine with turning them into linear geometries in the query
. Using -nlt CONVERT_TO_LINEAR
is not a solution for me. The actual problem I am trying to solve is in third-party software that uses the same logic and there we can only edit the query (QGIS layer filters).References:
- https://gdal.org/programs/ogrinfo.html#cmdoption-ogrinfo-sql
- https://gdal.org/user/sql_sqlite_dialect.html#sql-sqlite-dialect
SolveForum.com may not be responsible for the answers or solutions given to any question asked by the users. All Answers or responses are user generated answers and we do not have proof of its validity or correctness. Please vote for the answer that helped you in order to help others find out which is the most helpful answer. Questions labeled as solved may be solved or may not be solved depending on the type of question and the date posted for some posts may be scheduled to be deleted periodically. Do not hesitate to share your response here to help other visitors like you. Thank you, solveforum.