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
15 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
246 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
0answers
9 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'...
0
votes
0answers
14 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
67 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
17 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
24 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
41 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
33 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
20 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
313 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
36 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
409 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
50 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
57 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: <...
3
votes
2answers
357 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 ...
3
votes
1answer
180 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
0answers
13 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
36 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
25 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
53 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
81 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
36 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
55 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 ...
3
votes
2answers
758 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 ...
2
votes
2answers
394 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
51 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
30 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
391 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
24 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
231 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
42 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
34 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 ...
1
vote
0answers
20 views

Identifying suitable head (H) for hydro power estimation from 30m SRTM DEM data using focal statistic analysis

I am doing my project on identifying suitable sites for locating small-scale hydro power. I have all other necessary variables but I am confused about extracting Head (H) values in meters from SRTM ...
3
votes
3answers
41 views

What is the easiest way to avoid shapefile columns being imported as PostGIS `numeric(p,s)` data type?

Considering the number of shapefiles I've imported to PostGIS (using shp2pgsql or ogr2ogr), I'm a little surprised I haven't come across this before. But I have a shapefile that has numeric columns ...
3
votes
2answers
61 views

Ogr2ogr is rounding numeric field from PostgreSQL to 6 decimals

I am using ogr2ogr to convert the data from PostgreSQL to GeoJSON. PostgreSQL contains field named shape.area, type numeric, which stores values up to 17 decimal places, like 0.15627328781960101. The ...
2
votes
2answers
63 views

Converting shapefile to postgis without giving bounding box

ogr2ogr -progress --config PG_USE_COPY YES -f PostgreSQL PG:"<myconnection>" -lco DIM=2 /path/to/myshapefilename.shp myshapefilename -overwrite -lco GEOMETRY_NAME=geom -lco FID=id -spat ...
2
votes
0answers
40 views

Using ogr2ogr for clipping vector files

I am looking for alternative (more efficient) methods for clipping large feature class datasets. When using the 'Clip' tool in ArcGIS, often times the tool will crash after many hours of processing. ...
1
vote
3answers
269 views

ESRI Shapefile not loading into SQL Server

I have been loading a number of shapefiles into SQL server 2012 using ogr2ogr.exe and the MSSQLSpatial driver. Up until this point, I have been very successful with doing so. However, I have now run ...
1
vote
0answers
46 views

Is spat the correct flag to use in my ogr2ogr command?

I have an ogr2ogr command that I'm using to convert part of a Postgres database to a Geojson. I ingested all of Canada in my database and to start, I want to grab all of the buildings in the Toronto ...
4
votes
3answers
2k views

Converting multilayer KML files to GeoJSON using ogr2ogr

I have a kml file that I'm trying to convert to GeoJSON. However, it turns out there's multiple layers, and ogr2ogr isn't happy. $ ogr2ogr -f GeoJSON shapes.json shapes.kml ERROR 6: GeoJSON driver ...
4
votes
1answer
30 views

How to resolve error when launching OSeo4W Shell: Windows cannot find .bat file?

I downloaded and installed OSGeo4W to use ogr2ogr, but the the program OSGeo4W will not run. On launching the shell, I receive an error stating the .bat file cannot be found in specified directory (...
6
votes
1answer
126 views

Why isn't QGIS detecting CRS from .prj file?

I have a number of 1 km hexagonal grids that cover various counties in the United States in a postgreSQL/postGIS database. Each grid has the CRS EPSG:3857, and the counties layer has EPSG:3857. When ...
1
vote
1answer
33 views

Export Line Feature using ogr2ogr.

I am trying to export a line feature class from an oracle spatial database to a file geodatabase. I can export polygons with no problem, but cannot find the appropriate command '-nlt' for Line ...
1
vote
1answer
32 views

Convert KML polygons to lines

I've been given a KML file which should consist of linear features (train lines), but for some reason they're all represented as <Polygon> types. Each appears to have the right data, from end of ...
3
votes
1answer
72 views

ogr2ogr: encoding issues when importing from Oracle Spatial to PostGIS

I'm trying to import some spatial tables from Oracle Spatial to PostGIS using ogr2ogr, but I can't figure out why the special characters on the attribute tables get messed up while I'm doing it. My ...