ogr2ogr is an open source command line utility popular for converting to and from various vector spatial data formats.

learn more… | top users | synonyms

1
vote
1answer
68 views

how can I maintain curves when converting from geodatabase to postgresql using og2gui

I am using the ogr2gui to convert a feature class in a geodatabase to a postgresql feature class. My original data is in a file geodatabase, and I am using the folder OpenFileGDB format as my input ...
0
votes
0answers
111 views

ogr2ogr conversion error - Can't create fields of type Binary on shapefile layers

I'm having trouble using the ogr2ogr tool on the command line. My data is stored in SQL as binary, type is mixed polygons and multipolygons. I am using the following command for conversion from SQL to ...
0
votes
1answer
60 views

Error importing OSM historical data importing with ogr2ogr

I am trying to import historical OpenStreetMap data obtained here: http://osm.personalwerk.de/full-history-extracts/2014-11-24/continents/ I downloaded the Australia-Oceania file, I am trying to ...
2
votes
1answer
45 views

ogr2ogr Error in batch file but works when run from command line

If I run this from the command line it works: "C:\Program Files\QGIS Pisa\bin\ogr2ogr.exe" -f GeoJSON d:\environprocessing\q3_2015\wi\brrts\GISRegistry_Offsite1.geojson "http://dnrmaps.wi.gov/arcgis/...
1
vote
0answers
30 views

Import .shp into postgre using ogr2ogr

I'm trying to import a .shp into postgre using ogr2ogr but i'm stuck with an error with the select clause, any ideas? ##vsmap_path=vector ##millesime=number 2015 from qgis.core import * import os ...
0
votes
1answer
67 views

UpdateGeometrySRID and low disk space

I have imported a 508GB DB with unknown SRID with ogr2ogr, hence my geometry SRID is 900914. Now I'd like to run SELECT UpdateGeometrySRID('contours','wkb_geometry',3857); However, I'm running ...
0
votes
1answer
422 views

How to extract style data from DXF when converting to geoJSON

I am using ogr2ogr (GDAL) to convert DXF files (from autoCAD) to geoJSONS for usage inside Leaflet.js The issue is that a lot of information, like line stroke size and colors are not kept during the ...
4
votes
2answers
1k views

Convert multi-layer DWG into several KML or geoJSON files (one per layer)

I have some big DWG files, with 5 to 50 layers, which I draw and geolocated using AutoCAD (with some external modules). I need to convert them to KML or geoJSON so that the JS library can load them ...
3
votes
1answer
431 views

cannot convert shapefile into GeoJSON

I have downloaded a shapefile of Stockholm (files on GitHub). I'm trying to convert the shapefiles to GeoJSON with the ogr2ogr command line tool. It does not work with the following error: Export ...
1
vote
2answers
45 views

Merge Ordnance Survey VectorMap District from different folders

I have four different folders with Ordnance Survey-Shapefiles from different regions. I want to merge all these files theme by theme (for example all buildings to just one shapefile). The problem ...
0
votes
1answer
39 views

Python: ogr2osm create osm file from WFS

Does anyone know if ogr2osm can use WFS Layer as input source to create a osm file i could not find anything in the documentation expect that it should support all ogr file formats. If so how can I ...
1
vote
2answers
217 views

Extracting all vertices from line shapefile in a simple way? (no python scripting)

I found that shpdump is a very good tool to extract all vertices from an ESRI polyline shapefile, but I need a single triplet (X,Y,Z) file (ie. shpdump provides all coordinates by parts). Is there a ...
0
votes
1answer
84 views

GDAL -SQL or -where options

ogr2ogr -overwrite -t_srs EPSG:3978 -f "ESRI Shapefile" -sql "SELECT * FROM 'Layer Name' WHERE FIELD_NAME = 'A CLASS'" dst.shp src.shp help me out here - looking to 1) reproject a shape and 2) ...
1
vote
1answer
199 views

ogr2ogr problem mapping shapefile to geojson ETRS89 / Poland CS92

I'm trying to convert official boundaries of administrative regions of Poland from official governmental site (codgik.gov.pl). I want to use those data because they are official ones, and set contains ...
1
vote
1answer
75 views

Unable to open datasource with ogr2ogr.main() [closed]

I try to make ogr2ogr work in Python the way suggested by Elevine's answer elsewhere, but I'm facing bugs. Most notable error is that while I try to reproject shapefiles, I get the following error: ...
3
votes
1answer
218 views

Converting a CSV with a WKT column to a Shapefile

Using ogr2ogr in Python, I am trying to convert a CSV to a shapefile. One column in the CSV, named "Polygon", contains WKT like this: POLYGON((long lat, long lat, long lat, etc.)) Currently, I can ...
3
votes
1answer
345 views

How to re-compile ogrinfo against gdal used by QGIS?

I just solved a problem with missing libraries blocking use of ogrinfo and ogr2ogr, only to find that these utilities are garbled in one more way: whenever I run any of these, I get following error (...
2
votes
2answers
396 views

Geocoding on OSM-shape files via elasticsearch

I want to get a geocoding system based on osm data and elasticsearch engine. I've tried some projects like komoot\photon, but, as I'm a really newbie in this, I stuck on preparing of the data for my ...
3
votes
3answers
2k views

How to repair broken GDAL and PROJ.4 on Ubuntu?

EDIT2: I solved the library problem, but others remain, only vaguely related to that of PROJ.4 library not loaded. I asked a follow-up question for these. My GDAL package and PROJ.4 library are ...
3
votes
2answers
362 views

How to have GDAL print layers of GeoPDF AND say which are raster vs vector

My Objective: I would like to use GDAL to convert a GeoPDF. I want the vector layers as shp files and the raster layers as tif files. I want to do this in a programmatic way. Edit: In reality, I ...
0
votes
1answer
86 views

Problem importing sqlite into Postgres (with PostGis) using ogr2ogr

I am trying to import a very large sqlite file into Postgres SQL 9.3. The first tool I tried to use was OGR2GUI (http://www.ogr2gui.ca/). The 64 Bit version does nothing, whilst the 32 bit version ...
4
votes
1answer
73 views

Error trying to import data to CartoDB using ogr2ogr

I have a local install of CartoDB in my Ubuntu 14.04. I have created a CartoDB account called "development" and been playing with it for a while. Now I'd like to import some data from a shapefile ...
0
votes
1answer
116 views

Spatial query ST_CONTAINS returns empty result

I want to create a database view in Postgres/PostGIS which returns a subset of the points stored in another table called locations. The subset is defined by an area stored in yet another table called ...
2
votes
0answers
56 views

How to install CartoDB driver for ogr2ogr?

I'm trying to import data from my postgis DB directly into CartoDB. I've seen in this forum's post that I can do that with ogr2ogr, a GDAL tool, in this way: ogr2ogr -t_srs EPSG:4326 --config ...
1
vote
0answers
64 views

ogr2ogr: export intersected gml using shapefile

I'm trying to do the same as the ogr2ogr example given by http://gis.stackexchange.com/a/119404/6458 The difference is that my inputs are a GML and a shapefile. Export.shp should only contain the ...
3
votes
1answer
673 views

Execute ogr2ogr from python

I tried to execute ogr2ogr from python with this shell command: ogr2ogr.exe --config PG_LIST_ALL_TABLES YES -f "PostgreSQL" -append PG:"host=hostnamet user=username password=password dbname=dbname" ...
2
votes
2answers
38 views

Using “ogr2ogr -sql” without an input fiile

Lets say I just wanted to turn WKT to GeoJSON on the command line I could do this: /opt/gdal-custom/bin/ogr2ogr -f CSV /vsistdout/ foo.sqlite \ -dialect sqlite \ -sql "SELECT AsGeoJSON(GeomFromText('...
0
votes
0answers
95 views

Speeding up a GDAL SQL query with indexes or different file formats

I have a query that I'm performing with python and OGR2OGR similar to this: /opt/gdal-custom/bin/ogr2ogr -f CSV /vsistdout/ foo.shp -dialect sqlite -sql "SELECT A, ...
1
vote
0answers
200 views

Using a ShapeFile spatial index with ogr2ogr and ogr.DataSource.ExecuteSQL()

I created a spatial index foo.qix for a foo.shp with ogrinfo -sql "CREATE SPATIAL INDEX ON foo" foo.shp However, when I do a query with ogr2ogr and look at it in strace, it doesn't use that index: ...
1
vote
2answers
274 views

Using ST_Intersects in OGR2OGR

I'm running GDAL 1.11.2, released 2015/02/10. The following displays all the attributes in my shapefile on stdout: /opt/gdal-custom/bin/ogr2ogr -f CSV /vsistdout/ foo.shp -sql "SELECT * FROM foo ...
1
vote
0answers
14 views

Include <link> in GPX when writing from ogr2ogr

http://www.gdal.org/drv_gpx.html seems to indicate that ogr2ogr should be able to write <link>[1] elements into a GPX file, however when using ogr2ogr to convert from PostGIS to GPX, I get the ...
1
vote
1answer
153 views

Importing data to CartoDB using ogr2ogr

First attempt, I want to create a table at CartoDB from another Postgis database: snow:Docker-Postgis alasarr$ ogr2ogr --config CARTODB_API_KEY daf3960b41733ef71e03ea77019642761d547f5b -f CartoDB "...
1
vote
1answer
140 views

File Conversion using ogr2ogr gui

I have used 'ogr2ogr' for ESRI shape files conversion to Mapinfo tab files, but issue is that as soon as I open those converted .tab files over Mapinfo, the software stop working with a message ...
1
vote
2answers
115 views

OpenStreetMap boundary relation lost when exporting to spatialite with ogr2ogr?

I am currently working in map for a province of Papua New Guinea. In OpenStreetMap (OSM) I have recently updated and added new relations for boundaries of admin_level=5 and admin_level=6, which were ...
1
vote
1answer
248 views

ogr2ogr from personal geodatabase to spatialite produces “non-spatial” tables

I have around 4 GB of data in 10 separate Personal Geodatabases, each of which contains multiple feature classes. I'm trying to convert the smallest one to SpatiaLite via ogr2ogr, in preparation for ...
2
votes
1answer
47 views

Reproject X coord value in Shapefiles

I convert Bavarien NAS-Data (DHDN 3 Degree Gauszone 4) via ogr2ogr into shapefiles: "C:\Program Files (x86)\QGIS Wien\bin\ogr2ogr.exe" "ESRI Shapefile" -skipfailures Entenhausen.xml This seems to ...
2
votes
0answers
42 views

Can ogr2ogr “reverse clip” (or “clip out” or “erase” or “difference”) one shapefile from another?

Is there a means in ogr2ogr to "clip out" one shapefile from another? I know ogr2ogr -clipsrc B.shp out.shp A.shp will remove any part of A.shp that is NOT in B.shp. Is there an ogr2ogr command to ...
0
votes
0answers
96 views

QGIS 'Save As' Reprojection Produces Different Results from ogr2ogr command line

Another 3857 vs 4326 question. When I reproject from EPSG:3857 to EPSG:4326 (and from .shp to .geojson) via the QGIS 'Save As' dialog, I get results that display in the expected place on Google Maps. ...
2
votes
0answers
237 views

How to clip a big shapefile from another shapefile's extent

I am working on mangroves in Sundarbans (Bangladesh / India), using Landsat pictures. I need to equalize them in reflectance, before classification, for the evolution of the biomass in this region. I ...
1
vote
1answer
249 views

How to import UTF-8 encoded Shapefiles into SQL Server?

I am trying to load a shape file to sql, using ogr2ogr and Shape2SQL tools. The shape file uses UTF-8 encoding, specified in a .cpg file, and confirmed when opening the file with QGIS. However, as ...
0
votes
0answers
194 views

ogr2ogr failing to open/convert GML

I'm trying to convert a GML file into GeoJSON using ogr2ogr, I've compiled GDAL, Expat and Xerces from source, but when I run my command I get an error. My convert command ./ogr2ogr -f "GeoJSON" /...
0
votes
1answer
164 views

Keeping Properties When Converting JSON to SHP

I'm trying to convert the Nielsen map of DMAs from a JSON to a shapefile. The properties of the json is as formatted like this: "id": 546, "properties": { "name": "dma:", ...
1
vote
1answer
70 views

Filter OGR datasource in Python (or XML)

I'm trying to streamline the process whereby we build tiles (of ~30 layers, representing planning zone and zone-overlay boundaries). I have a strong preference for FOSS tools. A couple of our people -...
0
votes
0answers
129 views

Can styling be applied to a kml (from a shp) using ogr2ogr

Is it possible to generate a styled KML using ogr2ogr (ie pen width and colour?) I cannot seem to find anything in the ogr2ogr documentation. My code so far is; ogr2ogr.exe -f "KML" prow-kml.kml "C:\...
1
vote
2answers
222 views

Running the ogr2ogr utilities in a batch file. Problems with command project

I have made a batch file containing a list of two commands. The first (-clipsrc) works properly, but the second not (-s_srs EPSG:4326 -t_srs EPSG:3857). Could anyone tell me where is the fail?. This ...
2
votes
0answers
82 views

How to clip or erase a csv file with a non-rectangular shapefile?

I can clip a csv file with a ogr2ogr having 4 extents of a rectangular polygon. Is it possible to clip a csv file with a non rectangular shapefile?
0
votes
1answer
339 views

ST_Intersect with ogr2ogr and Spatialite

I am trying to intersect Spatialite datasets with ogr2ogr, the OGR Virtual Format and SQL Syntax. I can't seem to locate whether the error is in my SQL query or my VRT file. Data rice_temperature....
0
votes
0answers
147 views

Merging polygons in SHP

Is it possible to merge polygons, using ogr2ogr cmdline tools? I.e. taking a SHP file and generate a new one, where records are merged when a field has the same value?
3
votes
3answers
432 views

How to make a local copy of a large WFS dataset?

We are writing a application in which a part of the job is to fetch a relatively large (>10000 features) and often updated dataset from a WFS server, store a local copy, and do geospatial analyses on ...
1
vote
1answer
94 views

ogr2ogr does not set osm_id for all multipolygons

I used ogr2ogr to convert from osm data (pbf) to spatialite : ogr2ogr -progress -f SQLite -dsco spatialite=yes france.simple.spatialite france-latest.osm.pbf then, a large part of the imported data ...