<div dir="ltr">You could use -nlt geometry but that won't convert simple objects to multi objects.<div>You could do it in steps: </div><div><ol><li>use -where to get lines and -nlt MultiLine<br></li><li>use -where to get polys with -nlt MutliPolygon<br></li><li>combine the two tables into a single Geometry table<br></li></ol><div>Rich</div></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, May 15, 2017 at 6:25 PM, Stephen Woodbridge <span dir="ltr"><<a href="mailto:woodbri@swoodbridge.com" target="_blank">woodbri@swoodbridge.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On 5/15/2017 6:15 PM, Stephen Woodbridge wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi,<br>
<br>
I'm trying to load both polygons and linestrings and would like PROMOTE_TO_MULTI to work for both, but it appears to define Multipolygon type and does not work for linestrings/multilinestrings.<br>
<br>
Maybe it would make more sense to have:<br>
<br>
PROMOTE_TO_MULTI - work for either polygon or linestring depending on what the first object is<br>
<br>
or have two options like:<br>
<br>
PROMOTE_POLY_TO_MULTI<br>
PROMOTE_LINE_TO_MULTI<br>
<br>
Or maybe, I'm totally missing something in the docs.<br>
</blockquote>
<br></span>
Sorry, forgot to add:<br>
<br>
ogrinfo --version<br>
GDAL 2.1.0, released 2016/04/25<br>
<br>
ogr2ogr -t_srs EPSG:4326 -nln census.roads -nlt PROMOTE_TO_MULTI -f PostgreSQL -append PG:dbname=buildings host=localhost port=5432 user=postgres active_schema=census /u/ror/buildings/data/census/t<wbr>mp-11/tl_2016_06061_roads.shp<br>
Warning 1: Geometry to be inserted is of type Multi Line String, whereas the layer geometry type is Multi Polygon.<br>
Insertion is likely to fail<br>
ERROR 1: ERROR: Geometry type (MultiLineString) does not match column type (MultiPolygon)<div class="HOEnZb"><div class="h5"><br>
<br>
<br>
---<br>
This email has been checked for viruses by Avast antivirus software.<br>
<a href="https://www.avast.com/antivirus" rel="noreferrer" target="_blank">https://www.avast.com/antiviru<wbr>s</a><br>
<br>
______________________________<wbr>_________________<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/mailma<wbr>n/listinfo/gdal-dev</a></div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr">Richard W. Greenwood, PLS<br><a href="http://www.greenwoodmap.com" target="_blank">www.greenwoodmap.com</a></div></div>
</div>