Hot answers tagged

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.5k
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.5k
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

Unable to get points from NetCDF even ogrinfo shows it has data

The GDAL/OGR system can only cope with spatial data stored in a specific pattern of dimensions in a NetCDF file. The NetCDF file is a flexible file format for any form of structured data, spatial or ...
user avatar
  • 52.1k
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
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.5k

Only top scored, non community-wiki answers of a minimum length are eligible