duckdb_spatial icon indicating copy to clipboard operation
duckdb_spatial copied to clipboard

How to convert all to 'MULTILINESTRING'

Open aborruso opened this issue 1 year ago • 1 comments

Hi, when I run

duckdb -c "COPY (SELECT id,ST_AsWKB(geom) geom from ST_READ('input.gpkg')) to 'output.gpkg'  WITH (FORMAT GDAL, DRIVER 'GPKG',SRS 'EPSG:32632',LAYER_NAME 'output',GEOMETRY_TYPE 'MultiLineString')"

I have this error

Invalid Input Error: Expected all geometries to be of type 'MULTILINESTRING', but got one of type 'LINESTRING'

Is there a ST_Multi function to convert all geom to MULTILINESTRING? If yes, how to use it?

If no, is there another duckdb way to do it?

Thank you

aborruso avatar Jul 01 '24 17:07 aborruso

Hello! Thanks for opening this issue! I can't think of any immediate way to work around this right now, but we should definitely add a ST_Multi function. Ill add it to my todo list.

Maxxen avatar Jul 22 '24 08:07 Maxxen

Wow, thank you very much @Maxxen !!!

aborruso avatar Sep 19 '24 13:09 aborruso