New answers tagged

1 vote
Accepted

Wrong schema while importing data via with ogr2ogr into postgresql database and using dblink

I have found the solution. It was not a problem within the database, it was a missleading config of the ogr2ogr command. Actually it is possible to set the schema with the -nln parameter! But at this ...
user avatar
  • 331
2 votes
Accepted

Extract particular layers from DXF file and make shapefile

You can separate the data in this way: ogr2ogr -f "ESRI Shapefile" -skipfailure --config DXF_MERGE_BLOCK_GEOMETRIES TRUE --config DXF_INLINE_BLOCKS TRUE -nlt POINT -sql "select *, ...
user avatar
  • 1,357
2 votes

Reducing shapefile size from PostgreSQL using ogr2ogr

You can shrink the shapefile that ogr2ogr has created. Read https://gdal.org/drivers/vector/shapefile.html#field-sizes It is also possible to force a resize of the fields to the optimal width by ...
user avatar
  • 52.4k
0 votes

Convert a mbtiles tileset folder into a single .mbtiles SQLite file?

You should be able to use mbutil from Mapbox, which allows you to either convert .mbtiles file to a folder or vice versa. There is also a PyPi package, you can use. This should work for you: mb-util --...
user avatar
  • 1
0 votes

Get coordinates of .pbf/.osm of ways and relations directly?

No, it is not possible to get the geometry of ways and relations directly. The OSM data model is based on nodes-ways-relations https://wiki.openstreetmap.org/wiki/Elements. Steve Coast has written a ...
user avatar
  • 52.4k
2 votes

Multipart to Singlepart in ogr2ogr

ogr2ogr has an -explodecollections flag. Different name – same result. ogr2ogr -explodecollections singlepart.gpkg multipart.gpkg
user avatar
1 vote
Accepted

ogr2ogr list of layers created

Ogr2ogr by default does not change the names of the layers and you should get a list with ogrinfo -nomd -nogeomtype foo.xlsx However, the PostGIS driver https://gdal.org/drivers/vector/pg.html ...
user avatar
  • 52.4k
0 votes

Merging large number of .shp files via command line with ogrmerge.py

Various commenters suggested this problem would be easier to deal with by creating subdirectories. I wrote a python script to do this and also merge the shapefiles. It isn't elegant, but it works. ...
user avatar
3 votes

GDAL og2ogr: insert/update existing PostGIS table from shapefile

If the field names in PostGIS and shapefile are the same a command like this should work. ogr2ogr - progress - append -f PG:"dbname='dbname' host='ipXXXXX' port='5432' user='XXXX' password='XXXX'...
user avatar
  • 52.4k

Top 50 recent answers are included