<div dir="ltr"><div>Hi Rich,</div><div><br></div><div>Thanks for testing this. I think a pipeline works well here:</div><div><br></div><div>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</div><div><br></div><div>Dan</div><br></div><br><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">On Fri, Apr 25, 2025 at 7:35 PM Richard Greenwood via gdal-dev <<a href="mailto:gdal-dev@lists.osgeo.org">gdal-dev@lists.osgeo.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>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:</div><div><font face="monospace"><b>ogr2ogr PG:"$PGCONN" shapefiles -sql "select STREET_NAM, TYPE from Roads" -nlt MultiLineString -append</b></font></div><div><br></div><div>It seems like there's some overlap between vector convert, sql and geom and I've gotten furthest with sql:</div><div><font face="monospace"><b>gdal vector sql --sql "select STREET_NAM, TYPE from Roads" --append shapefiles PG:"$PGCONN"</b></font></div><div>But I haven't figured out how to cast to --multi. </div><div><br></div><div>Should I be using convert or geom instead of sql? Or do I need a pipeline? Is there documentation that I'm missing?</div><div><br></div><div>Thanks,</div><div>Rich</div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><span class="gmail_signature_prefix">-- </span><br><div dir="ltr" class="gmail_signature"><div dir="ltr">Richard W. Greenwood<br><a href="http://www.greenwoodmap.com" target="_blank">www.greenwoodmap.com</a></div></div></div>
_______________________________________________<br>
gdal-dev mailing list<br>
<a href="mailto:gdal-dev@lists.osgeo.org" target="_blank">gdal-dev@lists.osgeo.org</a><br>
<a href="https://lists.osgeo.org/mailman/listinfo/gdal-dev" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/gdal-dev</a><br>
</blockquote></div>