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
2answers
48 views

ogr2ogr keep geometry when converting to CSV?

Using ogr2ogr, how to keep the geometry when converting to CSV? ( Nothing relevant here: http://www.gdal.org/drv_csv.html ) $ ogr2ogr -f "CSV" MyLayer.csv MyLayer.geojson Here is the begin of ...
1
vote
1answer
17 views

Import 2D GML file via OGR2OGR fails with “Did not get at least 3 values or invalid number of set of coordinates”

I have a GML file that seems to mix <gml:posList srsDimension="2"> and <gml:posList> records. OGR2OGR (understandably) crashes when reading these files: ERROR 1: Did not get at ...
0
votes
0answers
11 views

from shapefile to mysql error -Ico command not exists

I am doing this query for pass from shapefile to mysql but obtain that -Ico command does not exist, if i cancel it i obtain: ERROR 1: MySQL driver doesn't currently support database creation. Please ...
4
votes
1answer
81 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
32 views

ogr2ogr doesn't work with admin rights?

I just noticed that ogr2ogr.exe doesn't seem to work when executed with admin right ..? I tested with the following parameters: ogr2ogr.exe -f "GeoJSON" "C:\Users\root\Desktop\Plugin_new\...
0
votes
2answers
44 views

Open source conversion of shapefile to ArcGIS Server JSON

Are there any open source command-line or python tools available to convert a shapefile (or other esri datasource) to ArcGIS Server JSON? I'd like something that emulates the ArcGIS Features to JSON ...
3
votes
1answer
31 views

ogr2ogr difference between -a_srs and -s_srs

What's the difference between the two flags -a_srs and -s_srs. From what I read they both define the EPSG the Input-File has. When using -s_srs ogr2ogr says that -t_srs must be used as well. But when ...
0
votes
0answers
29 views

ogr2ogr merge two GeoJSON to one GeoJSON

Is ogr2ogr capable of merging two GeoJSON files to a new one? It is possible to merge shapefiles to one GeoJSON using the VRT driver. But when trying to do the same using GeoJSON files ogr2ogr fails. ...
1
vote
0answers
18 views

Trying to get all Landscan Urban areas in the USA (from Natural World shp files)

I'm desperately trying to get a json file of all the Landscan urban areas in the USA. The ne_10m_urban_areas_landscan.shp has a list containing polygons of all urban areas in the world with a NAME ...
1
vote
0answers
262 views

ogr2gr loading spatial data into mysql

I am trying to load shapefile into mysql (MYISAM) using ogr2ogr and i get an error that says failed to fetch the requested layer. What could be wrong with my statement is it the issue with quotes or ...
3
votes
2answers
772 views

Convert non-spatial Oracle table to spatial Oracle table in a different database

I'm trying to use ogr2ogr to convert data from a non-spatial table (has X & Y values) in an Oracle database (1) to a spatial format in a different Oracle database (2). This will be scheduled to ...
3
votes
2answers
405 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 ...
5
votes
2answers
76 views

Error when creating spatial index in MongoDB

I am wanting to use MongoDB for some basic spatial calculations (on some fairly large data), but I get an error when trying to create an index on the US Counties shapefile retrieved from the US Census'...
3
votes
1answer
198 views

How do I call ogr2ogr from a C# application?

I have an ogr2ogr (GDAL) command that I run to export points from a database to an XML file. ogr2ogr-f GPX c:\temp\points.gpx PG:"host=localhost port=5432 dbname=SpatialPlayground schemas=public user=...
1
vote
3answers
1k views

Reducing Size of KML file (After converting from Shapefile)

I have a shape-file of size 224 mega byte. I am using ArcGis to convert it to a KML file. The process involves converting the shapefile to a feature layer and then converting the layer to KML. An ...
0
votes
0answers
58 views

Writing shapefile to SQL Server database with ogr2ogr Error

I have been using ogr2ogr to write point shapefiles to a SQL Server Database of mine. I used it 2 weeks ago and it worked fine, but, today when I tried to run it, I get the following error: ERROR1: ...
1
vote
1answer
339 views

Using ogr2ogr to reproject and rename into shapefile?

I'm trying to reproject, move from tab to shp and rename all the .tab contained in a folder tree using ogr2ogr. I'm working with Windows 7, QGIS 1.8 installed with advanced OsGeo4w and gdal 1.9.2. I ...
1
vote
1answer
23 views

Error on join in ogr2ogr

I am doing an ogr2ogr process where i will be making a join between two tables, imported as shapefiles and .csv to join on a column with idential attributes. The code i've made so far looks like ...
1
vote
1answer
278 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 ...
0
votes
0answers
21 views

ogr2ogr failed to create GFS file when converting to GML

I'm trying to convert a simple Shapefile to GML using ogr2ogr commandline tool on Windows. Here's the command: ogr2ogr -f "GML" "C:\Users\root\Bundeslaender\Bundeslaender.gml" "C:\Users\root\...
4
votes
2answers
2k views

Why does ogr2ogr SHP import error out trying to create a database?

All, Can anyone tell me what the error is with OGR2OGR when trying to import a .SHP into MSSQLSPATIAL? ERROR 1: MSSQL Spatial driver doesn't currently support database creation. Please create ...
3
votes
0answers
75 views

Using ogr2ogr in python?

I found this helpful post that got me started using ogr2ogr in python: Using ogr2ogr to convert GML to shapefile in Python? as well as this one: How to convert ArcGIS Server JSON to GeoJSON? I am ...
9
votes
4answers
8k views

Using ogr2ogr to convert GML to shapefile in Python?

I am trying to convert a GML to an ESRI shapefile using ogr2ogr utility in a python script. I have successfully installed the GDAL/OGR package via osgeo but I am now struggling to find/understand ...
1
vote
2answers
22 views

Converting UK OS NGR coordinates to lat/long using ogr2ogr?

How do I convert UK OS NGR coordinates to lat/long using ogr2ogr? I've read through the ogr2ogr page, but I can't see anything obvious on how to do it I've used the FME trial and it was as simple as ...
1
vote
0answers
37 views

ogr2ogr missing drivers [closed]

I have a problem here with installing ogr .. I followed this very usefull tutorial for installing ogr on Windows systems: http://sandbox.idre.ucla.edu/sandbox/tutorials/installing-gdal-for-windows It ...
0
votes
0answers
46 views

Alternative program to ogr2ogr

Is there an alternative program to ogr2ogr when trying to convert file formats? I've played around with ogr2ogr quite a bit lately (on Windows) but I can't get around some issues .. For example when ...
1
vote
1answer
39 views

Failed once again to import shape file to postgis DB using ogr2ogr

Once again I try to import a shape file to my remote postgis database using og2ogr. Last time it was an Odyssey but I have managed to solve all the issues and report them one by one here. I have ...
1
vote
0answers
26 views

Setting default value in FileGDB table column during GDAL/ogr2ogr export from PostGIS?

I'm doing an export for one table (table name: 'schaden_polygon') from a PostGIS-database (db-name: 'mydata') to ESRI FileGDB via ogr2ogr commandline-tool. The PostGIS-table contains a column 'm_uuid' ...
1
vote
3answers
379 views

ogr2ogr without spatialite support - How to fix it?

I am trying to use ogr2ogr to convert OSM data from pbf to spatialite. I used to do so with the following command: ogr2ogr -f "SQLite" -dsco SPATIALITE=YES png-full-last.db planet_137.084,-15....
1
vote
1answer
41 views

ogr2ogr append 1 row to a File GDB feature class's data table

I export a polygon layer from Oracle to a FileGDB using ogr2ogr. I need to append one row to the data table, with '0' for numeric fields and 'No Elements' for the one string field. In ArcGIS, I run a ...
2
votes
1answer
415 views

GDAL 1.9.1 ogr2ogr KML to PostGIS not incuding ExtendedData

I have a KML file utilizing a Schema in the document and ExtendedData in each placemark. The ExtendedData does not seem to pass in conversion to PostGIS or shapefile.
1
vote
0answers
56 views

Merging features by admin or sovereingt

I followed Mike Bostock's 'Let's Make a Map' tutorial to make a GeoJSON map of the EU starting from a 1:10M cultural admin0 shapefile from Natural Earth. The problem that I'm facing if that some of ...
2
votes
1answer
74 views

Converting a CSV to DXF using ogr2ogr from the command line

I am trying to convert a .csv file to .dxf using ogr2org from the command line using the following command: ogr2ogr -f DXF control.dxf opua.vrt This is the .vrt file I am using: <...
1
vote
0answers
14 views

Text imported into SQL Server using ogr2ogr had extra characters at the beginning

I've managed to import some MapInfo data sets into SQL Server using ogr2ogr But when I run a query in SQL Management Studio (SSMS), the various text fields look to be "blank" However if I use the ...
2
votes
1answer
40 views

Problems with 'layer exists ' while running ogr2ogr

I run command: ogr2ogr -f PostgreSQL PG:"dbname=regional host=localhost user=*** password=***" Hsp_09_13.MIF -t_srs EPSG:3857 -nlt MULTIPOLYGON -overwrite -nln postcode_sector_boundaries And I have ...
0
votes
1answer
29 views

Split a shapefile into smaller files on linux command line

I have a shapefile which has ~350,000 entries. This is too big to handle. I'd like to split it into many smaller files, such that each file has 10,000 entries (this means there'd be ~350 shapefiles). ...
1
vote
1answer
62 views

Convert SHP to DGN with ogr2ogr

I want to convert my shp layers into one DGN file using ogr2ogr (QGIS). When I use this tool, I can only select one layer to convert. My problem is I don't know how to select all three layers at the ...
4
votes
1answer
134 views

Import a shapefile to postgis with ogr2ogr gives: Unable to open datasource

I want to use ogr2ogr in order to import a shapefile in a postgis database. I have successfully installed ogr2ogr and I run from the pgsql the following command: ogr2ogr -f "PostgreSQL" PG:"host=...
1
vote
1answer
46 views

Merge Natural Earth SQLite country polygons using ogr2ogr and ST_Union

I'm trying to create a map with the world continents (with a few modifications). As a source I use a sqlite file from Natural Earth. I already introduced my modification in the definition of the ...
1
vote
1answer
68 views

Loading GML data into Postgres with ogr2ogr

I'm working with a new OS dataset, Highways Network, trying to get it loaded into Postgres and set up in some kind of usable state. I've loaded all the data already, but it seems some elements of ...
2
votes
2answers
433 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 ...
4
votes
0answers
55 views

How do I load 1 billion points into PostGIS?

I have a file geodatabase containing research data that I need to load into PostGIS. The GDB contains one feature class with one billion records with three columns (the FID, a FK, and the geometry (...
0
votes
0answers
35 views

What is the ogr2ogr syntax for exporting from Oracle to Spatialite?

I want to export data from Oracle to spatialite, 3 tables with geometry and 1 attribute table. Alternatively, I already have this data written out nightly using ogr2ogr, but the output location is a ...
1
vote
3answers
452 views

Extracting difference between two massive shapefiles using QGIS?

I have two massive shapefiles and I need to create a difference shapefile output between the two. I have a layer where I have satellite coverage (orange) and then a layer where I have high resolution ...
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 ...
0
votes
1answer
32 views

Set PATH variables for ogr2ogr without admin privileges

In the office I use ogr2ogr to convert several file formats such as KML or ESRI shapefiles. Since the commands are the same almost every time I'd like to run ogr2ogr with a batch. I'm using the GDAL ...
7
votes
2answers
4k views

How to convert GML Surface to SHP Using OGR?

I have a very large .gml file with multiple layers in it. I would like to export one of these layers to .shp. It is a polygon layer (of lakes). However, I am getting the error: ERROR 1: ...
4
votes
1answer
253 views

Merging multiple feature classes in file geodatabase with ogr2ogr?

Is there a way to merge multiple feature classes into one feature class in a geodatabase with ogr2ogr? If this isn't possible with ogr2ogr, is there another method? I'm using the ESRI File Geodatabase ...
2
votes
1answer
45 views

Export to DXF from PostgreSQL using ogr2ogr

I have a large dataset in a PostGIS database (OS MasterMap). My aim is to export specific areas of this dataset to DXF, while retaining the attributes of the data as layers in the DXF. My current ...
0
votes
1answer
36 views

Why do I get a 503 error when pushing data to the CartoDB SQL API

I'm using ogr2ogr to push a large (200,000 feature) dataset to the CartoDB API. I'm using where_clauses to upload 500 features at a time, and sleeping every 20,000 features for a minute to give the ...