<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body>
<p>I have a MapInfo .tab file containing polygons, both simple and
multipolygons (and only polygons).</p>
<p>Using this command: (all ogr2ogr commands are one-liners, but
examples are split for lucidity)<br>
</p>
<p><font face="monospace">ogr2ogr <br>
--config PG_USE_COPY yes <br>
-progress <br>
-lco OVERWRITE=YES <br>
-dim XY <br>
-f "PostgreSQL" PG:"host=localhost port=5432 user=***
password=*** dbname=geodata" <br>
FREDSKOV.TAB<br>
</font></p>
<p>will (correctly) create a table in Postgres of PostGIS type
"Geometry" <br>
</p>
<p>If I change the command to:</p>
<p><font face="monospace">ogr2ogr <br>
--config PG_USE_COPY yes <br>
-progress <br>
-lco OVERWRITE=YES <br>
-dim XY <br>
<b> -nlt PROMOTE_TO_MULTI</b><br>
-f "PostgreSQL" PG:"host=localhost port=5432 user=***
password=*** dbname=geodata" <br>
FREDSKOV.TAB</font></p>
<p>I would expect the table to change the PostGIS type to
"MultiPolygon". However it still is registered as "Geometry".<br>
</p>
<p>Checking the table using SQL command:</p>
<p><font face="monospace">SELECT ST_geometrytype(wkb_geometry),
count(*) FROM mat.fredskov group by 1</font></p>
<p>affirms, that all geometries now is of type "ST_MultiPolygon".</p>
<p>AFAIK, this is a new behaviour. Or what ? <br>
</p>
<p>Postgres/Postgis version : 13.2, 3.1 <br>
</p>
<p>OGR2OGR version: both 3.4 andf 3.6 dev.<br>
</p>
<p><br>
</p>
<p><br>
</p>
<p><br>
</p>
<pre class="moz-signature" cols="72">--
Med venlig hilsen / Kind regards
Bo Victor Thomsen</pre>
</body>
</html>