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
17 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 ...
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\...
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 ...
3
votes
0answers
68 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
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
34 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
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: <...
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
26 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
82 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 ...
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
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 ...
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 ...
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 ...
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
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 (...
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
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
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 ...
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 ...
1
vote
0answers
44 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
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 ...
3
votes
1answer
73 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
45 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
53 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, ...
0
votes
1answer
24 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
26 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
46 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
52 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, ...
1
vote
0answers
40 views

ogr2ogr FAILURE: Couldn't fetch requested layer 'ùnlt'!

I am getting the following error message with ogr2ogr while try to convert into MySQL. I have tried PGeo,Shapefile and FileGDB. FAILURE: Couldn't fetch requested layer 'ùnlt'! My environment is ...
0
votes
1answer
36 views

How to extract a shapefile with a SQL expression from a database of shapefiles using PyQGIS or OGR [duplicate]

I have a shapefile Water_Districts.shp that consists of several water district polygons. I am trying to use the script below to 'extract' a specific polygon with the name Cache La Poudre River listed ...
4
votes
2answers
70 views

ogr2ogr sql query from text file

In ogr2ogr or ogrinfo, I can successfully query an Oracle database using this command as a test: ogrinfo -al -so "OCI:USER/PASSWORD@SERVER/DATABASE" -sql "SELECT * FROM SCHEMA.TABLE" However, ...
0
votes
1answer
67 views

Combining GeoJSON Features

I haven't been able to find a solution with the source so am trying to work on the output file. I have also asked this question on SO I have a large (200MB) geoJSON file that has a lot of complex ...
1
vote
0answers
57 views

ogr2ogr - mapinfo to geojson. Merging shapes with certain values

I'm just starting out with this so apologies if I explain things poorly. I have some mapinfo files (TAB, IND, MAP etc) and I am trying to convert to Geojson. I can do this using ogr2ogr ogr2ogr -...
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
36 views

Truncate a Shapefile field with SQL and ogr2ogr

I want to create a new attribute which is the first 8 characters of another, using ogr2ogr. To my surprise, this didn't work: ogr2ogr -f "ESRI Shapefile" a.shp b.shp -sql "select FID,left(FLOORKEY,8) ...
0
votes
1answer
40 views

Converting Shapefiles to KML and extruding on height

I am working on a free/open source workflow to ingest OSM data and convert it to a KML so I can view it in 3D with Google Earth. I used ogr2ogr to convert to a shapefile and have extracted the height ...
0
votes
1answer
78 views

JSONs made from shapefiles are not plotting (using folium or Leaflet alone)

My goal is to plot two shapefiles as layers on an interactive map. The files I'm using live at https://github.com/AnnaMag/maps. I transformed shapefiles to .geojson using ogr2ogr -f ... e.g. ...