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)
_
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-
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
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
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?
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
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
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(…)
"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
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
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
11 matches
Mail list logo