Re: [gdal-dev] [EXTERNAL] Re: GPKG geometry column name expectations with sqlite dialect

2024-09-30 Thread Scott via gdal-dev
What is the srid of your geometry? On 9/30/24 12:18, Meyer, Jesse R. (GSFC-618.0)[SCIENCE SYSTEMS AND APPLICATIONS INC] via gdal-dev wrote: /f/"select count(ST_Area('{lyr_name + '.' + geom_column_name}'))". (same outcome if re-arranged as count(…) from lyr_name instead) _

Re: [gdal-dev] [EXTERNAL] Re: GPKG geometry column name expectations with sqlite dialect

2024-09-30 Thread Rahkonen Jukka via gdal-dev
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-

Re: [gdal-dev] [EXTERNAL] Re: GPKG geometry column name expectations with sqlite dialect

2024-09-30 Thread Meyer, Jesse R. (GSFC-618.0)[SCIENCE SYSTEMS AND APPLICATIONS INC] via gdal-dev
Even was right. It had to do with SQL ingesting the input as a text string and not an identifier. Thanks for the input everyone. From: Rahkonen Jukka Date: Monday, September 30, 2024 at 4:03 PM To: Even Rouault , Meyer, Jesse R. (GSFC-618.0)[SCIENCE SYSTEMS AND APPLICATIONS INC] , Meyer, Jes

Re: [gdal-dev] [BULK] Re: [EXTERNAL] Re: GPKG geometry column name expectations with sqlite dialect

2024-09-30 Thread Meyer, Jesse R. (GSFC-618.0)[SCIENCE SYSTEMS AND APPLICATIONS INC] via gdal-dev
Same outcome: OGRFeature(SELECT):0 st_srid('geom') (String) = (null) From: gdal-dev on behalf of Scott via gdal-dev Date: Monday, September 30, 2024 at 3:34 PM To: gdal-dev@lists.osgeo.org Subject: Re: [gdal-dev] [BULK] Re: [EXTERNAL] Re: GPKG geometry column name expectations with sqlite

Re: [gdal-dev] [EXTERNAL] Re: GPKG geometry column name expectations with sqlite dialect

2024-09-30 Thread Even Rouault via gdal-dev
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?

Re: [gdal-dev] [BULK] Re: [EXTERNAL] Re: GPKG geometry column name expectations with sqlite dialect

2024-09-30 Thread Scott via gdal-dev
Using st_setsrid(geom, null) gives a count of 0. Setting it to 6931 gives a count. Just for fun, run "select st_srid(geometry_column) from layername" On 9/30/24 12:28, Meyer, Jesse R. (GSFC-618.0)[SCIENCE SYSTEMS AND APPLICATIONS INC] wrote: EPSG:6931, so projected in meters.  Expecting a tota

Re: [gdal-dev] [BULK] Re: [EXTERNAL] Re: GPKG geometry column name expectations with sqlite dialect

2024-09-30 Thread Meyer, Jesse R. (GSFC-618.0)[SCIENCE SYSTEMS AND APPLICATIONS INC] via gdal-dev
EPSG:6931, so projected in meters. Expecting a total result well north of a few thousand. From: gdal-dev on behalf of Scott via gdal-dev Date: Monday, September 30, 2024 at 3:26 PM To: gdal-dev@lists.osgeo.org Subject: [BULK] Re: [gdal-dev] [EXTERNAL] Re: GPKG geometry column name expectati

Re: [gdal-dev] [EXTERNAL] Re: GPKG geometry column name expectations with sqlite dialect

2024-09-30 Thread Meyer, Jesse R. (GSFC-618.0)[SCIENCE SYSTEMS AND APPLICATIONS INC] via gdal-dev
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(…)

Re: [gdal-dev] GPKG geometry column name expectations with sqlite dialect

2024-09-30 Thread Scott via gdal-dev
"Geometry Column = ..." in ogrinfo output. If the method returns an empty string then a special name "_ogr_geometry_" must be used. That's from the OGR driver docs: https://gdal.org/en/latest/user/ogr_sql_dialect.html I've always found it a bit weird as well. If I'm not sure I'll try, geom, ge

Re: [gdal-dev] GPKG geometry column name expectations with sqlite dialect

2024-09-30 Thread Even Rouault via gdal-dev
Jesse, Le 30/09/2024 à 20:35, Meyer, Jesse R. (GSFC-618.0)[SCIENCE SYSTEMS AND APPLICATIONS INC] via gdal-dev a écrit : Hi, I have two geopackage database files that were constructed, somehow, in a way that one has a geometry column called ‘geometry’ and the other ‘geom’.  QGIS nor OGR seem

[gdal-dev] GPKG geometry column name expectations with sqlite dialect

2024-09-30 Thread Meyer, Jesse R. (GSFC-618.0)[SCIENCE SYSTEMS AND APPLICATIONS INC] via gdal-dev
Hi, I have two geopackage database files that were constructed, somehow, in a way that one has a geometry column called ‘geometry’ and the other ‘geom’. QGIS nor OGR seem to have much an issue with this. Both handle / display all the features in the expected ways. However, for the gpkg with