[gdal-dev] [EXTERNAL] Re: GPKG geometry column name expectations with sqlite dialect
Rahkonen Jukka
jukka.rahkonen at maanmittauslaitos.fi
Mon Sep 30 13:03:13 PDT 2024
This works for me:
ogrinfo -sql "select count(st_area(geom)) from rakennus" mtkmaasto.gpkg
OGRFeature(SELECT):0
count(st_area(geom)) (Integer) = 5517708
"select st_area(layer.geom)" feels like a blind shot, or have you seen that it works with some database?
-Jukka Rahkonen-
Lähettäjä: gdal-dev <gdal-dev-bounces at lists.osgeo.org> Puolesta Even Rouault via gdal-dev
Lähetetty: maanantai 30. syyskuuta 2024 22.56
Vastaanottaja: Meyer, Jesse R. (GSFC-618.0)[SCIENCE SYSTEMS AND APPLICATIONS INC] <jesse.r.meyer at nasa.gov>; Meyer, Jesse R. (GSFC-618.0)[SCIENCE SYSTEMS AND APPLICATIONS INC] via gdal-dev <gdal-dev at lists.osgeo.org>
Aihe: Re: [gdal-dev] [EXTERNAL] Re: GPKG geometry column name expectations with sqlite dialect
Le 30/09/2024 à 21:18, Meyer, Jesse R. (GSFC-618.0)[SCIENCE SYSTEMS AND APPLICATIONS INC] a écrit :
Thanks Scott and Even,
Maybe it's an unexpected interaction with Spatialite, but explicitly providing the geometry column's name results in bogus outputs. Is the SQL string wrong somehow?
f"select count(ST_Area('{lyr_name + '.' + geom_column_name}'))". (same outcome if re-arranged as count(...) from lyr_name instead)
ST_Area(some_text) will not work. It expects an identifier (possibly double quoted if that's needed), not a single-quoted string literal.
--
http://www.spatialys.com<http://www.spatialys.com/>
My software is free, but my time generally not.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20240930/ce2ebafb/attachment-0001.htm>
More information about the gdal-dev
mailing list