[gdal-dev] GDAL 3.11 vector utility

Daniel Baston dbaston at gmail.com
Sat Apr 26 04:32:26 PDT 2025


Hi Rich,

Thanks for testing this. I think a pipeline works well here:

gdal vector pipeline read tl_2024_us_state.shp ! select
"STUSPS,NAME,_ogr_geometry_" ! geom set-type --multi ! write "PG:$PGCONN"
--lco GEOMETRY_NAME=geom

Dan


On Fri, Apr 25, 2025 at 7:35 PM Richard Greenwood via gdal-dev <
gdal-dev at lists.osgeo.org> wrote:

> I'm playing with the (very cool) new gdal command line tool. I started
> with a simple task of copying a shapefile into postgres. I only want two
> columns from the shapefile and I need to cast it to a MultiLineString. My
> old ogr2ogr command:
> *ogr2ogr PG:"$PGCONN" shapefiles -sql "select STREET_NAM, TYPE from Roads"
> -nlt MultiLineString -append*
>
> It seems like there's some overlap between vector convert, sql and geom
> and I've gotten furthest with sql:
> *gdal vector sql --sql "select STREET_NAM, TYPE from Roads" --append
> shapefiles PG:"$PGCONN"*
> But I haven't figured out how to cast to --multi.
>
> Should I be using convert or geom instead of sql? Or do I need a pipeline?
> Is there documentation that I'm missing?
>
> Thanks,
> Rich
>
>
>
>
>
> --
> Richard W. Greenwood
> www.greenwoodmap.com
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/gdal-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20250426/a9acee58/attachment.htm>


More information about the gdal-dev mailing list