Re: [gdal-dev] OGR SQL CAST geometry example

2024-05-30 Thread Dan Jacobson via gdal-dev
Alas, even for MULTIPOINT, as there are no facilities for extracting from aggregates, not even ST_Dump, in the end all one can do is $ ogrinfo 0.lines.kml -al | perl -nwle \ 'if(/LINESTRING.*\((.*)\)/){print for split /,/, $1}' -100.79005679 36.38022 1000 -100.79008013 36.38531

Re: [gdal-dev] OGR SQL CAST geometry example

2024-05-30 Thread Daniel Baston via gdal-dev
If a single MULTIPOINT record is OK, then you can do ogrinfo test.shp -q -dialect SQLITE -sql 'SELECT ST_DissolvePoints(GEOMETRY) FROM test' Dan On Thu, May 30, 2024 at 8:49 PM Dan Jacobson via gdal-dev wrote: > > $ ogrinfo 0.lines.kml -q -dialect SQLITE -sql \ > 'SELECT ST_PointN(GEOMETRY,

Re: [gdal-dev] OGR SQL CAST geometry example

2024-05-30 Thread Even Rouault via gdal-dev
According to http://www3.sqlite.org/series.html, generate_series() is only built in the sqlite3 command line utility, not in the library itself. That said, with some work, the source at https://www.sqlite.org/src/file/ext/misc/series.c could potentially be embedded into libgdal Le 31/05/2024

Re: [gdal-dev] OGR SQL CAST geometry example

2024-05-30 Thread Dan Jacobson via gdal-dev
$ ogrinfo 0.lines.kml -q -dialect SQLITE -sql \ 'SELECT ST_PointN(GEOMETRY, generate_series(1, ST_NPoints(GEOMETRY))) FROM "0"' ERROR 1: In ExecuteSQL(): sqlite3_prepare_v2( no such function: generate_series ___ gdal-dev mailing list

Re: [gdal-dev] OGR SQL CAST geometry example

2024-05-30 Thread Even Rouault via gdal-dev
Ah, I misunderstood and thought you wanted to extract points from linestrings. Given $ cat test.csv id,my_wkt 1,"POINT Z (1 2 3)" you can do: $ ogrinfo test.csv -sql "select id, cast(my_wkt as geometry(pointz, 4326)) from test" INFO: Open of `test.csv'   using driver `CSV' successful.

Re: [gdal-dev] OGR SQL CAST geometry example

2024-05-30 Thread Dan Jacobson via gdal-dev
> "ER" == Even Rouault writes: ER> you can't do operations on geometries with OGR SQL... OK, I'll try it. Thanks. The page should still have an example of actual use of Casting ... POINT[Z], LINESTRING[Z] Without examples people will try things like POINTZ, "POINTS[Z]"

Re: [gdal-dev] OGR SQL CAST geometry example

2024-05-30 Thread Even Rouault via gdal-dev
Dan, you can't do operations on geometries with OGR SQL, but selecting it. You'd typically need to use the ST_PointN() from Spatialite with the SQLite dialect Even Le 31/05/2024 à 00:32, Dan Jacobson via gdal-dev a écrit : Hi. I will add an example to

[gdal-dev] OGR SQL CAST geometry example

2024-05-30 Thread Dan Jacobson via gdal-dev
Hi. I will add an example to https://gdal.org/user/ogr_sql_dialect.html#changing-the-type-of-the-fields showing users how to e.g., CAST LINESTRING Z to POINTS Z, e.g., to extract the points from: $ ogrinfo 0.lines.kml -q -sql 'SELECT "_ogr_geometry_" FROM "0"' Layer name: 0 OGRFeature(0):1

[gdal-dev] GDAL Maintainers Meeting Minutes

2024-05-30 Thread Howard Butler via gdal-dev
Howard Butler, Even Rouault, Dan Baston, Alessandro Pasotti, Javier Jimenez Shaw, and Michael Sumner held the monthly GDAL Maintainers Meeting on 05/23/2024. The following items were discussed and reported upon: Discussion Items * GDAL 3.9.0 was released on May

[gdal-dev] clang-format variation - just for info

2024-05-30 Thread Andrew C Aitchison via gdal-dev
I don't think this affects any gdal code. If you put a comment after an #else an #endif or "}" (eg to aide finding the start of the block) then clang-format v15 and v18 will rearrange the whitespace differently. Ubuntu Noble 24-04 ships v18. -- Andrew C. Aitchison

[gdal-dev] clear band level metadata

2024-05-30 Thread Michael Sumner via gdal-dev
Hello, I have this process to convert a URL to a MEM dataset. It's not the target data but it's representative, a netcdf with band-level and dataset-level metadata. We can clear the dataset level with COPY_SRC_MDD, but I can't see how to do that for the band level. We're hoping to keep this