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 ...
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 ...
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 ...
1
vote
1answer
15 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
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. ...
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 ...
1
vote
0answers
17 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 ...
0
votes
0answers
55 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
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 ...
5
votes
2answers
74 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
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\...
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 ...
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 ...
1
vote
0answers
35 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
45 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
38 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
24 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
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
73 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
127 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
45 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 ...
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
34 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
1answer
65 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 ...
0
votes
1answer
31 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 ...
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
44 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
87 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
66 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 ...
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
1answer
36 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 (...
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 ...
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
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 ...
1
vote
1answer
40 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 ...
1
vote
0answers
53 views

ogr2ogr - Shapefile database SQL query; missing .cpg and .xml

I am using gdal and ogr2ogr to perform a SQL query on a database of shapefiles with the code below. The geoprocessing works and the appropriate shapefile is extracted from the query, but when I print ...
1
vote
1answer
34 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 ...
3
votes
1answer
84 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 ...
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. ...
3
votes
2answers
53 views

Conversion of .shp to EPSG:4326 has slight offset

I just started this project where I need to project the Dutch municipalities on a map. Luckily this seems very easy with the help of GeoJSON. However, I'm having a slight issue where my conversion to ...
0
votes
1answer
57 views

ogr2ogr - Clipping postgis and creating geojson

I'm trying to create a geojson file data based on data from my local postgis database using ogr2ogr. I'm trying to clip to a specific area and when I start to run the command, everything starts fine, ...
1
vote
1answer
28 views

Use ogr2ogr to delete content of table and load new data from shapefile

Is it possible to load a shape file to a postGIS database by replacing the content of the table with the new content of the shape file WITHOUT DROPING the table? I want to do this using ogr2ogr. In ...
0
votes
0answers
27 views

Installation and execution of GDAL

I am trying to install GDAL on the remote server. I do: pip install GDAL==1.9.1 It gets installed and then I try to do: gdalinfo --version But I get 'command not found'. I understand that I ...
0
votes
1answer
52 views

Converting shapes using OGR2GUI

I am trying to convert a MapInfo .TAB file to a Shape file while setting the projection of the target to NAD83 UTM Zone 19. The latest version of OGR seems to not have this projection available in the ...
1
vote
1answer
54 views

ogr2ogr Set Feature to Column Name?

I'm converting PostGIS data to PDF via GDAL 2.0.2 with below. ogr2ogr -f "PDF" mypdf.pdf PG:"host=domain.com user=me password=mypassword dbname=mydb" -sql "SELECT geom, state_name, sub_region, ...