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
1
vote
1 answer
ogr2ogr query with " " as separator for the command and within the query results in empty response
With ogr2ogr I query geodata from a postgis database into a Geopackage. The main attribute is "natural" which as to wrappend with " ". The query is wrapped by " ", too. This leads into a empty response / geopackage
The command is:
ogr2ogr -f "GPKG"…

Michael
- 219
- 2
- 10
1
vote
1 answer
Query attributes with colon : inbetween with ogr2ogr and PostGIS
I'm running a PostGIS Database filled by osm2pgsql. The address-keys are stored for example as
"addr:street"
The objective is to store those geometries as GeoPackage by ogr2ogr. The script looks like this
ogr2ogr -f "GPKG" address_point.gpkg…

Michael
- 219
- 2
- 10
1
vote
3 answers
How to get GDAL/ogr2ogr to output GeoJSON as feature-per-line instead of a formatted FeatureCollection?
I'm trying to convert some Very Big Shapefiles into GeoJSON so that I can run them through tippecanoe and create a .mbtiles to upload to Mapbox Studio for hosting and styling.
I can use ogr2ogr to create my GeoJSON file just fine, however it outputs…

craig
- 285
- 2
- 10
1
vote
0 answers
How to fix 'JSON parsging error: continue (at offeset XXXX)' error from ogr2ogr
I have a 25 GB GeoJSON I want to convert into 10x10 degree rasters (tifs) covering most of the land on earth, with the rasters' values a particular field in the GeoJSON. My plan was to convert the GeoJSON into a PostGIS table using ogr2ogr, then…

DGibbs
- 13
- 3
1
vote
1 answer
More projections with ogr2ogr?
I'm new to using ogr2ogr and have been wanting to reproject an ESRI Shapefile to NAD83 State Plane Washington North Projection (EPSG:32148) from WGS84.
Ive gotten it to reproject to NAD83 but I can't get it use a Projected Coordinate System. Does…

Taylor Rulien
- 39
- 2
- 4
1
vote
0 answers
Using Osgeo4w shell via. python script
I'm trying to write a script that creates multiple ogr2ogr calls to a WFS service (in a loop). For some reason i can't use the osgeo lib (it's a work computer, with limited access..), so i figured i would give the Subprocess lib a try.
My though…

user1851594
- 21
- 5
1
vote
0 answers
Suppress messages in R markdown
In my Rmarkdown file, I would like to suppress the message that a GeoJSON file has been read.
I have tried including {r message=FALSE, warning=FALSE} but this does not work and also wrapping the function in invisible() - but still the same message…

iskandarblue
- 7,208
- 15
- 60
- 130
1
vote
0 answers
Change location of geojson output using gdal
I was given a CAD file with no coordinate system, I converted the CAD file to the DXF format and then applied the source reference of 'epsg:3011' and the target reference of 'epsg:4326' when I converted the DXF file into geojson. This all resulted…

A guy at work
- 21
- 2
1
vote
0 answers
ogr2ogr producing different results on different system
I'm trying to convert the shape file which represents the administrative area of Philippines into geojson. I'm getting the shape file from here . The file I'm trying to convert is this PHL_adm3.shp .
I'm using this bash script:
function…

Rahul
- 3,208
- 8
- 38
- 68
1
vote
1 answer
ogr2ogr slow upload to postgres
I need to upload geojson to a PostgreSQL database, using ogr2ogr. When I upload the geojson on the same server that the PostgreSQL database is on, ogr2ogr uploads a file in around 3-4 seconds. When I run ogr2ogr on my Ubuntu 16.04 computer, though,…

stack_tom
- 950
- 2
- 9
- 18
1
vote
0 answers
How to generate WKT in the INSERT command for PostgreSQL with ogr2ogr
My problem is that I have some Mapinfo files where the polygon has holes with the extent of zero, like POLYGON((35 10, 45 45, 15 40, 10 20, 35 10),
(20 30, 35 35, 20 30)). That is legal in Mapinfo and ogr2ogr can also handle it, but when ogr2ogr…

Lars Ladegaard
- 116
- 1
- 10
1
vote
1 answer
Command line issue with ogr2ogr and WKT
I want to clip a shapefile with ogr2ogr using a POLYGON defined as wkt.
According to the documentation it should be possible to use WKT as clipsrc [1]
But I cant get the syntax right, I the following there is some simplified commands, that gives me…

Pelle G
- 43
- 1
- 1
- 5
1
vote
1 answer
How do I run sed in ExecuteProcess in Apache NiFi
I have csv log files that I convert to GeoJSON with ogr2ogr and then run sed against to clean up for elasticsearch. Specifically:
ogr2ogr -f "GeoJSON" output.json input.csv
sed -i -e '1,4d' -e '$d' output.json # delete first four lines and last…

DecisionNerd
- 1,252
- 1
- 12
- 19
1
vote
1 answer
How can I set the file output location in ogr2ogr?
Whenever I use ogr2ogr to convert files the output is saved to the following directory:
C:\Users[UserName]\AppData\Local\VirtualStore
Is there anyway I can set this directory to something else?

nothingman
- 61
- 5
0
votes
0 answers
ERROR create from database, convert PostGIS to MBTiles with ogr2ogr
I am trying to convert data from my PostGIS database into MBTiles format using ogr2ogr.
Howewer, when i type the command
ogr2ogr -f MBTiles "myfile.mbtiles" PG:"dbname=mybase user=postgres password=postgres host=localhost"
I am getting an error…

Sasa Stojkovic
- 1
- 1