ogr2ogr is used to convert simple features data between file formats performing various operations during the process such as spatial or attribute selections, reducing the set of attributes, setting the output coordinate system or even reprojecting the features during translation.
Questions tagged [ogr2ogr]
97 questions
2
votes
1 answer
Inserting shapedata to MYSQL
I am trying to insert .shp (shape file) to MySQL using ogr2ogr but I am getting following error:
ERROR 1: MySQL error message:Too big scale 31 specified for column
'hght_lmt_m'. Maximum is 30. Description: ALTER TABLE
shapefiledatabase ADD…

Arjun Chaudhary
- 2,373
- 2
- 19
- 36
2
votes
0 answers
updating a pgsql table using ogr2ogr, trouble with PK
I have an issue when using ogr2ogr to import new GIS data (from osm or specific), from shp to pgsql.
To create my table, I use:
ogr2ogr -overwrite --config PGSQL_OGR_FID myid -gt 65536 -f "PostgreSQL" "PG:host='host' user='myself' dbname=db …

Cy's
- 63
- 5
2
votes
1 answer
Batch script vs command line
When I run following command in cmd prompt it works:
for /R %f in (*.shp) do ogr2ogr -nln merge -update -append merge.shp %f
but when I run it from .bat file it does not work. Saying -nln was unexpected.
Is there anyway I could run this from .bat…

kinkajou
- 3,664
- 25
- 75
- 128
2
votes
1 answer
Using ogr2ogr to convert PostGIS table to personal geodatabase
I need to convert a PostGIS table to a personal geodatabase using ogr2ogr. I can convert tables to a shapefile without a problem but whenever I try to convert it to .mdb using the ODBC driver, I get an error. I have got the 64-bit GDAL version and…

Mirko
- 23
- 3
1
vote
0 answers
ogrinfo, ogr2ogr for S57 charts
I am trying to convert S57 charts to another file format with ogr2ogr, but I cannot get it to work.
Ogrinfo and ogr2ogr report this error:
ISO8211: Didn't find field terminator, read one more byte.
ERROR 1: Not enough byte to initialize field…

Okko Kauhanen
- 11
- 1
1
vote
1 answer
Postgres `\d` shows table but `\d table` does not exist?
I query Postgres with \d and get a list of tables including table foo.
Schema | Name | Type | Owner
--------+------+-------+----------
public | foo | table | postgres
I then query \d foo, and get told: Did not find any relation named…

Lee Goddard
- 10,680
- 4
- 46
- 63
1
vote
0 answers
Convert GeoPackage to GeoJSON with ogr2ogr not working
The command
ogr2ogr -f GeoJSON out.json BGRI2021_0706.gpkg
returns
ERROR 1: database disk image is malformed
FAILURE:
Unable to open datasource `BGRI2021_0706.gpkg' with the following drivers.
-> `FITS'
-> `PCIDSK'
-> `netCDF'
-> `PDS4'
…

João Pimentel Ferreira
- 14,289
- 10
- 80
- 109
1
vote
0 answers
Extract an attribute in GPKG
I am trying to extract rivers from OSM. I downloaded the waterway GPKG where I believe there are over 21 million entries (see link) with a file size of 19.9 GB.
I have tried using the split vector layer in QGIS, but it would crash.
Was thinking of…

Shaffiq Somani
- 11
- 2
1
vote
0 answers
After I remove the water from openstreetmap, I lost the administrative boundary and properties. How to save them?
now I am handling the indonesia's map data from openstreetmap. I get the region datas whose admin_level equals "4". Then I remove the water part through this…

coderxsjah
- 11
- 1
1
vote
0 answers
How to combine multiple geopackages into one single file
I have got a series of geopackages which represent every single packet of land across England. Each geopackage is one local area and i want to combine them to create one single file for all of england.
Each geopackage is between 50 and 1500 MB and…

NiallMcS
- 33
- 4
1
vote
1 answer
Converting geoJson to shapfile as batch using GDAL ogr2ogr in Node JS
I want to convert all the geojsons in a file to shapefiles in a single batch using ogr2ogr library in NodeJS. I know it can be done directly from the terminal using the gdal cli, but I want do know how to do it in Node. Thanks alot!
I have this code…

Mihai Bența
- 17
- 3
1
vote
0 answers
GDAL/OGR (Ogr2ogr) python binding windows OCI driver
I installed GDAL-3.3.1-cp39-cp39-win_amd64.whl on windows and I am trying ogr2ogr.py in python. For defaults drivers work perfectly, but in support drivers is not OCI driver (https://gdal.org/drivers/vector/oci.html#vector-oci). When I installed…

peter p
- 31
- 2
1
vote
0 answers
Python: Cannot convert json with geometry collections to shapefile OGR2OGR: a way to explode those features?
I finally found a way to convert JSON (GEOJSON formated) file to a shapefile using ogr2ogr. However I am encountering a new problem.
You see some of the features in my JSON file are actually a geometry collection, and this collection can either be a…

ThunderSpark
- 89
- 2
- 13
1
vote
0 answers
ogr2ogr: Unable to open datasource (OCI driver)
When transferring data from the oracle database to the postgresql database, using the ogr2ogr command, an error occurs regarding the OCI driver. There is no: "OCI -vector- (rw +): Oracle Spatial" driver in the list of supported drivers (command:…

Stefan Milošević
- 11
- 2
1
vote
0 answers
Invalid srid in postgis when importing data by ogr2ogr
I am using postgis 12 with postgis 3.0.0 and gdal 3.0.0 to copy data in it. The command i am using is
ogr2ogr -f "PostgreSQL" PG:"host=127.0.0.1 dbname=db user=user port=5432 password=1" "file.geojson" -nln mutable
The issue here is when i check…

Sandeep Kumar
- 234
- 5
- 14