<div dir="ltr">Hi, following is the code I used:<div><br><div><div><font color="#0000ff" style="background-color:rgb(217,234,211)">Import os, osmium, fiona</font></div><div><span style="background-color:rgb(217,234,211);color:rgb(0,0,255)"><br></span></div><div><span style="background-color:rgb(217,234,211);color:rgb(0,0,255)">fi = 'europe-latest.osm.pbf'</span><br></div><div><font color="#0000ff" style="background-color:rgb(217,234,211)">fo = 'europe-latest.dpkg' </font><span style="background-color:rgb(217,234,211);color:rgb(0,0,255)">   </span></div><div><font color="#0000ff" style="background-color:rgb(217,234,211)"><br></font></div><div><font color="#0000ff" style="background-color:rgb(217,234,211)">drv = 'DPKG'</font></div><div><font color="#0000ff" style="background-color:rgb(217,234,211)"><br></font></div><div><font color="#0000ff" style="background-color:rgb(217,234,211)">crs = {'no_defs': True, 'ellps': 'WGS84', 'datum': 'WGS84', 'proj': 'longlat'}</font></div><div><font color="#0000ff" style="background-color:rgb(217,234,211)"><br></font></div><div><font color="#0000ff" style="background-color:rgb(217,234,211)"> schema = {'geometry': 'LineString',</font></div><div><font color="#0000ff" style="background-color:rgb(217,234,211)">                   'properties': {'id': 'float', 'name' : 'str', 'kind' : 'str'}}</font><span style="background-color:rgb(217,234,211);color:rgb(0,0,255)">    </span></div><div><font color="#0000ff" style="background-color:rgb(217,234,211)"> </font></div><div><font color="#0000ff" style="background-color:rgb(217,234,211)">outfile = fiona.open(fo, 'w', driver=drv, crs=crs, schema=schema)</font><span style="background-color:rgb(217,234,211);color:rgb(0,0,255)">    </span></div><div><font color="#0000ff" style="background-color:rgb(217,234,211)"> </font></div><div><font color="#0000ff" style="background-color:rgb(217,234,211)">geomfab = osmium.geom.GeoJSONFactory()</font><span style="background-color:rgb(217,234,211);color:rgb(0,0,255)">    </span></div><div><font color="#0000ff" style="background-color:rgb(217,234,211)"> </font></div><div><font color="#0000ff" style="background-color:rgb(217,234,211)">class ShapeConverter(osmium.SimpleHandler):</font></div><div><font color="#0000ff" style="background-color:rgb(217,234,211)">      def way(self, w):</font></div><div><font color="#0000ff" style="background-color:rgb(217,234,211)">           if 'place' in w.tags: </font></div><div><font color="#0000ff" style="background-color:rgb(217,234,211)">               rec = {'geometry' : eval(geomfab.create_linestring(w)),</font></div><div><font color="#0000ff" style="background-color:rgb(217,234,211)">                      'properties' : {'id' : float(<a href="http://w.id/" target="_blank">w.id</a>),</font></div><div><font color="#0000ff" style="background-color:rgb(217,234,211)">                                     'name' : w.tags.get('name'),</font></div><div><font color="#0000ff" style="background-color:rgb(217,234,211)">                                       'kind' : w.tags['place']}}   </font></div><div><font color="#0000ff" style="background-color:rgb(217,234,211)">               outfile.write(rec)</font></div><div><font color="#0000ff" style="background-color:rgb(217,234,211)"> </font></div><div><font color="#0000ff" style="background-color:rgb(217,234,211)">ShapeConverter().apply_file(fi, locations=True)</font></div></div></div></div><br><div class="gmail_quote"><div dir="ltr">On Thu, Nov 1, 2018 at 4:10 PM jratike80 <<a href="mailto:jukka.rahkonen@maanmittauslaitos.fi">jukka.rahkonen@maanmittauslaitos.fi</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">koji higuchi wrote<br>
> Hi<br>
> I am extracting .osm.pbf file into .gpkg; but the writing rate is very<br>
> slow.<br>
> When I write into .shp, rate is faster but its limit is 4gb.<br>
> So, what other format is better for larger than 4gb requirement?<br>
> Thanks for your ideas.<br>
> Koji<br>
<br>
Hi,<br>
<br>
Show the exact command that you are using so we can see if it could be made<br>
faster. For example if you happen to use -skipfailures for handling the<br>
invalid geometries of the OSM data then you will make GDAL to do a new<br>
transaction for each row and that certainly is slow. But let's have a look<br>
at your command first.<br>
<br>
-Jukka Rahkonen-<br>
<br>
<br>
<br>
--<br>
Sent from: <a href="http://osgeo-org.1560.x6.nabble.com/GDAL-Dev-f3742093.html" rel="noreferrer" target="_blank">http://osgeo-org.1560.x6.nabble.com/GDAL-Dev-f3742093.html</a><br>
_______________________________________________<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></blockquote></div>