<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:#0563C1;
text-decoration:underline;}
p.xmsonormal, li.xmsonormal, div.xmsonormal
{mso-style-name:x_msonormal;
margin:0cm;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
p.xxmsonormal, li.xxmsonormal, div.xxmsonormal
{mso-style-name:x_xmsonormal;
margin:0cm;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
span.Shkpostityyli25
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:70.85pt 2.0cm 70.85pt 2.0cm;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="FI" link="#0563C1" vlink="purple" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal"><span style="mso-fareast-language:EN-US">Hi,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="mso-fareast-language:EN-US">Please take care to send mail also to the list.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="mso-fareast-language:EN-US">The error that you get means probably that the Proj coordinate transformation library finds an older version of the proj.db file. With the gisinternals installation that file is in [gdal_installation_directory]\bin\proj7\share.
Environmental variable PROJ_LIB should point into there. How did you launch ogr2ogr after installation? If you installed from the zip file you must run first the batch file “sdkshell.bat” for setting the paths and environment variables. If you used installer
then you should launch GDAL command window from the shortcuts. In both cases when settings are OK you can run ogr2ogr simply as “ogr2ogr”.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="mso-fareast-language:EN-US">Other_relations contain geometries which are of geometry type “GeometryCollection”. Unfortunately QGIS has very little support for GeometryCollections. You can see the attributes but
not the geometries. If you are interested in the relations you must use some workarounds with QGIS or use other programs. For example OpenJUMP can do pretty well with relations but it is not so well documented.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="mso-fareast-language:EN-US">-Jukka Rahkonen-<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b>Lähettäjä:</b> Clay, Bruce <bclay@infoscitex.com> <br>
<b>Lähetetty:</b> tiistai 2. marraskuuta 2021 20.35<br>
<b>Vastaanottaja:</b> Rahkonen Jukka (MML) <jukka.rahkonen@maanmittauslaitos.fi><br>
<b>Aihe:</b> Re: [EXTERNAL] Re: ogr2ogr does not convert OSM polygons<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal"><span style="font-size:12.0pt;color:black">Jukka:<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:12.0pt;color:black"> I upgraded to 3.4.0 from sysinternals. All tables appear to be going in ok but I do get an error message for each table (shown below). QGIS shows the SRID is 4326. "other_relations" has a
geometry column and it loads in QGIS but the geometry does not show. It appears I can get what I need for my task, just annoying messages.<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:12.0pt;color:black"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:12.0pt;color:black">Should "other_relations" show in QGIS?<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:12.0pt;color:black"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:12.0pt;color:black">Thanks for you help.<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:12.0pt;color:black"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:12.0pt;color:black">Bruce<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:12.0pt;color:black"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:12.0pt;color:black">Z:\OpenStreetMap\release-1916-x64-gdal-mapserver\bin\ogr2ogr -f PostgreSQL PG:"dbname='open_street_map' host='hostname' port='5432' user='postgres' password='pwd'" -lco schema=algeria algeria-latest.osm.pbf
--config OSM_MAX_TMPFILE_SIZE 1024 <o:p></o:p></span></p>
<div>
<p class="MsoNormal"><span style="font-size:12.0pt;color:black">0...10...20...30...40.ERROR 1: PROJ: proj_create_from_database: cannot build geodeticCRS 4326: SQLite error on SELECT extent.description, extent.south_lat, extent.north_lat, extent.west_lon, extent.east_lon,
scope.scope, (CASE WHEN scope.scope LIKE '%large scale%' THEN 0 ELSE 1 END) AS score FROM usage JOIN extent ON usage.extent_auth_name = extent.auth_name AND usage.extent_code = extent.code JOIN scope ON usage.scope_auth_name = scope.auth_name AND usage.scope_code
= scope.code WHERE object_table_name = ? AND object_auth_name = ? AND object_code = ? ORDER BY score, usage.auth_name, usage.code: no such table: usage<o:p></o:p></span></p>
</div>
<p class="MsoNormal"><span style="font-size:12.0pt;color:black">..50...60...70...80...90...100 - done.<o:p></o:p></span></p>
</div>
<div class="MsoNormal" align="center" style="text-align:center">
<hr size="2" width="98%" align="center">
</div>
<div id="divRplyFwdMsg">
<p class="MsoNormal"><b><span style="color:black">From:</span></b><span style="color:black"> Rahkonen Jukka (MML) <<a href="mailto:jukka.rahkonen@maanmittauslaitos.fi">jukka.rahkonen@maanmittauslaitos.fi</a>><br>
<b>Sent:</b> Tuesday, November 2, 2021 12:32 PM<br>
<b>To:</b> Clay, Bruce <<a href="mailto:bclay@infoscitex.com">bclay@infoscitex.com</a>><br>
<b>Subject:</b> VS: [EXTERNAL] Re: ogr2ogr does not convert OSM polygons</span> <o:p>
</o:p></p>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
</div>
<div>
<div>
<p class="xmsonormal"><span lang="EN-US">Actually, it was GDAL 3.3.1 from OSGeo4W installer.</span><o:p></o:p></p>
<p class="xmsonormal"><span lang="EN-US"> </span><o:p></o:p></p>
<p class="xmsonormal"><span lang="EN-US">-Jukka-</span><o:p></o:p></p>
<p class="xmsonormal"><span lang="EN-US"> </span><o:p></o:p></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="xmsonormal"><b>Lähettäjä:</b> Clay, Bruce <<a href="mailto:bclay@infoscitex.com">bclay@infoscitex.com</a>>
<br>
<b>Lähetetty:</b> tiistai 2. marraskuuta 2021 18.19<br>
<b>Vastaanottaja:</b> Rahkonen Jukka (MML) <<a href="mailto:jukka.rahkonen@maanmittauslaitos.fi">jukka.rahkonen@maanmittauslaitos.fi</a>><br>
<b>Aihe:</b> Re: [EXTERNAL] Re: ogr2ogr does not convert OSM polygons<o:p></o:p></p>
</div>
</div>
<p class="xmsonormal"> <o:p></o:p></p>
<div>
<p class="xmsonormal"><span style="font-size:12.0pt;color:black">Jukka:</span><o:p></o:p></p>
</div>
<div>
<p class="xmsonormal"><span style="font-size:12.0pt;color:black"> Thanks for your reply.</span><o:p></o:p></p>
</div>
<div>
<p class="xmsonormal"><span style="font-size:12.0pt;color:black"> </span><o:p></o:p></p>
</div>
<div>
<p class="xmsonormal"><span style="font-size:12.0pt;color:black">I was in the progress of loading all OSM so I started with Africa and saw the same thing for all pbf files. You can pick a small one such as algeria-latest.osm.pbf. In my post I just replaced
the country name with the word "country" to be generic. All of the files came from the website you mentioned.</span><o:p></o:p></p>
</div>
<div>
<p class="xmsonormal"><span style="font-size:12.0pt;color:black"> </span><o:p></o:p></p>
</div>
<div>
<p class="xmsonormal"><span style="font-size:12.0pt;color:black">I am using the OSGeo shell on Windows 10. gdalinfo show version is 3.0.4</span><o:p></o:p></p>
</div>
<div>
<p class="xmsonormal"><span style="font-size:12.0pt;color:black">I did not change the osmconf.ini file.</span><o:p></o:p></p>
</div>
<div>
<p class="xmsonormal"><span style="font-size:12.0pt;color:black"> </span><o:p></o:p></p>
</div>
<div>
<p class="xmsonormal"><span style="font-size:12.0pt;color:black">After looking deeper into the table osm2pgsql created I noticed roads are not actually put in the osm roads layer. administrative boundaries or other lines were in there. More lines are in the
table created by osm2pgsql than the table created by ogr2ogr.</span><o:p></o:p></p>
</div>
<div>
<p class="xmsonormal"><span style="font-size:12.0pt;color:black"> </span><o:p></o:p></p>
</div>
<div>
<p class="xmsonormal"><span style="font-size:12.0pt;color:black">it looks like ogr2ogr would produce a similar approach if it would generate the polygon table.</span><o:p></o:p></p>
</div>
<div>
<p class="xmsonormal"><span style="font-size:12.0pt;color:black"> </span><o:p></o:p></p>
</div>
<div>
<p class="xmsonormal"><span style="font-size:12.0pt;color:black">Bruce</span><o:p></o:p></p>
</div>
<div>
<p class="xmsonormal"><span style="font-size:12.0pt;color:black"> </span><o:p></o:p></p>
</div>
<div>
<p class="xmsonormal"><span style="font-size:12.0pt;color:black"> </span><o:p></o:p></p>
</div>
<div class="MsoNormal" align="center" style="text-align:center">
<hr size="1" width="98%" align="center">
</div>
<div id="x_divRplyFwdMsg">
<p class="xmsonormal"><b><span style="color:black">From:</span></b><span style="color:black"> Rahkonen Jukka (MML) <<a href="mailto:jukka.rahkonen@maanmittauslaitos.fi">jukka.rahkonen@maanmittauslaitos.fi</a>><br>
<b>Sent:</b> Tuesday, November 2, 2021 11:11 AM<br>
<b>To:</b> Clay, Bruce <<a href="mailto:bclay@infoscitex.com">bclay@infoscitex.com</a>>;
<a href="mailto:gdal-dev@lists.osgeo.org">gdal-dev@lists.osgeo.org</a> <<a href="mailto:gdal-dev@lists.osgeo.org">gdal-dev@lists.osgeo.org</a>><br>
<b>Subject:</b> [EXTERNAL] Re: ogr2ogr does not convert OSM polygons</span> <o:p>
</o:p></p>
<div>
<p class="xmsonormal"> <o:p></o:p></p>
</div>
</div>
<div>
<div>
<p class="xxmsonormal">Hi,<o:p></o:p></p>
<p class="xxmsonormal"> <o:p></o:p></p>
<p class="xxmsonormal"><span lang="EN-US">What layers does ”ogrinfo country_pbf” list? Can you reproduce the error with some small OSM country file from
<a href="https://usg02.safelinks.protection.office365.us/?url=http%3A%2F%2Fdownload.geofabrik.de%2F&data=04%7C01%7Cbclay%40infoscitex.com%7Cf969c27fe7114268415508d99e1e4f3c%7C3430c5de5e6f4f9d9d9690e985038b58%7C0%7C0%7C637714675287814046%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=dO7y8hY%2BQcMN4U9ZZLqXtu7OKiJZMqluf1MdbNa6gBc%3D&reserved=0">
http://download.geofabrik.de/</a>?</span><o:p></o:p></p>
<p class="xxmsonormal"><span lang="EN-US">What is your operating system and GDAL version? Do you use the default osmconf.ini file? GDAL OSM driver and osm2pgsql are creating quite different database schemas so they are not very comparable.
</span><o:p></o:p></p>
<p class="xxmsonormal"><span lang="EN-US"> </span><o:p></o:p></p>
<p class="xxmsonormal"><span lang="SV">-Jukka Rahkonen-</span><o:p></o:p></p>
<p class="xxmsonormal"><span lang="SV"> </span><o:p></o:p></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="xxmsonormal"><b>Lähettäjä:</b> gdal-dev <<a href="mailto:gdal-dev-bounces@lists.osgeo.org">gdal-dev-bounces@lists.osgeo.org</a>>
<b>Puolesta </b>Clay, Bruce<br>
<b>Lähetetty:</b> tiistai 2. marraskuuta 2021 16.22<br>
<b>Vastaanottaja:</b> <a href="mailto:gdal-dev@lists.osgeo.org">gdal-dev@lists.osgeo.org</a><br>
<b>Aihe:</b> [gdal-dev] ogr2ogr does not convert OSM polygons<o:p></o:p></p>
</div>
</div>
<p class="xxmsonormal"> <o:p></o:p></p>
<div>
<p class="xxmsonormal"><span style="font-size:12.0pt;font-family:"Arial",sans-serif;color:#222222;background:white">When I convert a OSM pbf file to postgres using the following script it does not create a multipolygon table</span><span style="font-size:12.0pt;color:black">
</span><o:p></o:p></p>
<div>
<p class="xxmsonormal" style="background:white"><span style="font-size:12.0pt;font-family:"Arial",sans-serif;color:#222222"> </span><o:p></o:p></p>
</div>
<div>
<p class="xxmsonormal" style="background:white"><span style="font-size:12.0pt;font-family:"Arial",sans-serif;color:#222222">ogr2ogr -f PostgreSQL PG:"dbname='open_street_map' host='db-host' port='5432' user='postgres' password='pwd'" -lco schema=country country_pbf
--config OSM_MAX_TMPFILE_SIZE 1024</span><o:p></o:p></p>
</div>
<div>
<p class="xxmsonormal" style="background:white"><span style="font-size:12.0pt;font-family:"Arial",sans-serif;color:#222222"> </span><o:p></o:p></p>
</div>
<div>
<p class="xxmsonormal" style="background:white"><span style="font-size:12.0pt;font-family:"Arial",sans-serif;color:#222222">When I do the same thing using osm2pgsql (shown below) it creates the polygon table but not the other_relations table</span><o:p></o:p></p>
</div>
<div>
<p class="xxmsonormal" style="background:white"><span style="font-size:12.0pt;font-family:"Arial",sans-serif;color:#222222"> </span><o:p></o:p></p>
</div>
<div>
<p class="xxmsonormal" style="background:white"><span style="font-size:12.0pt;font-family:"Arial",sans-serif;color:#222222">osm2pgsql -H hostname -U postgres -d open_street_map --output-pgsql-schema=country --create --latlong -G --hstore --tag-transform-script
/OpenStreetMap/openstreetmap-carto-master/openstreetmap-carto.lua -C 2500 --number-processes 5 -S /OpenStreetMap/openstreetmap-carto-master/openstreetmap-carto.style country-latest.osm.pbf.</span><o:p></o:p></p>
</div>
<div>
<p class="xxmsonormal" style="background:white"><span style="font-size:12.0pt;font-family:"Arial",sans-serif;color:#222222"> </span><o:p></o:p></p>
</div>
<div>
<p class="xxmsonormal" style="background:white"><span style="font-size:12.0pt;font-family:"Arial",sans-serif;color:#222222">I did not see this problem when I Googled.</span><o:p></o:p></p>
</div>
<div>
<p class="xxmsonormal" style="background:white"><span style="font-size:12.0pt;font-family:"Arial",sans-serif;color:#222222"> </span><o:p></o:p></p>
</div>
<div>
<p class="xxmsonormal" style="background:white"><span style="font-size:12.0pt;font-family:"Arial",sans-serif;color:#222222">Is this a known issue and is there a work around?</span><o:p></o:p></p>
</div>
<div>
<p class="xxmsonormal" style="background:white"><span style="font-size:12.0pt;font-family:"Arial",sans-serif;color:#222222"> </span><o:p></o:p></p>
</div>
<p class="xxmsonormal"><span style="font-size:12.0pt;font-family:"Arial",sans-serif;color:#222222;background:white">Bruce</span><o:p></o:p></p>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>