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

learn more… | top users | synonyms

0
votes
1answer
21 views

Attempting to convert from GML to GeoJSON produces garbage

The file seems to convert without error, however when I attempt to display it on anything or any map, the coordinates are always rendered as a straight line across the top of the projection. I am not ...
0
votes
1answer
38 views

Determining of vector dataset single files to specify its size on a disk

I wonder how to get size of disk space that a specific vector dataset occupies on a disk. I didn't find any ogr2ogr util or OGR Python method that can return a list of files that belongs to given ...
1
vote
1answer
83 views

Gdal ogrinfo CSV unable to open datasource

When I try to import a csv file into a PostgreSQL table with the Gdal ogr2ogr tool I get the "Unable to open datasource" Failure. So I tried to open it with the tool ogrinfo and I get the same ...
1
vote
0answers
20 views

SQL Server aggregate function in ogr2ogr command

I would like to define create a GeoJSON bounding box using SQL Server's EnvelopeAggregate function, embedded in an ogr2ogr command. I have the following command: ogr2ogr -f GeoJSON envelope.json ...
1
vote
0answers
53 views

converting shp to fileGDB with ogr2ogr changes geometry type?

I'm converting a shapefile to file geodatabase with GDAL 1.11.3 and the ESRI FileGDB driver. ogrinfo on the .shp gives: $ ogrinfo NED1_Index.shp INFO: Open of `NED1_Index.shp' using driver `ESRI ...
0
votes
0answers
21 views

Use ogr2ogr to get KML out of PostGIS

I am trying to export a Postgis database table into KML using ogr2ogr. When I execute this command in terminal (Ubuntu 12) I just get the "documentation" back but no result or error: ogr2ogr -f "KML" ...
0
votes
1answer
134 views

Converting multi-geometry GML with ogr2ogr not working

I am having difficulties with GML loading in PostGIS with ogr2ogr. It is a GML of buildingparts containing both polygons and (label)-points. In this example (below) I have a selection of 9 objects. ...
4
votes
1answer
193 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
52 views

Improving performance when importing file geodatabase into PostgreSQL?

I have a file geodatabase created with ArcMap 10.1 that contains one feature class with 650 million points. The feature class contains the shape field and an identifier. The .gdb is approximately ...
0
votes
0answers
51 views

Converting DXF to GeoJSON with ogr2ogr

I'm trying to convert my DXF to GeoJSON with ogr2ogr, but I can't get it to include blocks. ogr2ogr -f "GeoJSON" "/Desktop/test2.geojson" "/Desktop\drawing.dxf" -sql "SELECT * FROM entities" ...
2
votes
1answer
72 views

Writing GeoJSON data into PostGIS in perl?

I am working with GeoJSON files and need to store them in PostgreSQL using perl. I can do this in 2 steps: open (JSON,">$path/tmp/current.json"); print JSON $fullJSON; close JSON; followed by: ...
0
votes
1answer
98 views

Convert SQL Server spatial table with unknown coordinate reference system to GeoJSON with ogr2ogr

I have a table in SQL Server with an STSrid of 0. I would like to convert this table to GeoJSON using ogr2ogr. The problem is, despite converting to EPSG:4326, the resulting coordinates are not valid ...
1
vote
3answers
217 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 ...
3
votes
0answers
108 views

Dissolving polygons in a large dataset

I need to dissolve polygons by the ID attribute in a large dataset (+-1gb shapefile). I have been struggling to find an efficient method to do this. I have tried the following methods: Postgis ...
1
vote
1answer
26 views

Polygons created for holes after running ST_Collect

I ran an ST_Collect query on a polygon dataset using ogr2gor -dialect sqlite -sql SELECT ST_Collect(geometry),id FROM wl_test GROUP BY id The result is a multipart polygon, which is what I want, ...
0
votes
1answer
60 views

Ogr2ogr unable to export S57's Symbol to Shapefile

I am using ogr2ogr tool to convert the S57 files to shapefile. However in the resulted shapefile, I am unable to show the original icons from the S57. For example, the SOUNDG layer be represented by ...
1
vote
2answers
261 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 ...
1
vote
1answer
37 views

Iterate over polygons to convert WFS features

So my first question on stackexchance. With ogr2ogr its possible to convert WFS features to SQlite with the following: ogr2ogr -f "SQLite" OUTPUT.sqlite WFS:"INPUT_WFS_url" It works. But there ...
1
vote
2answers
99 views

ogr2ogr unreadable dbf file header

I'm trying to convert Mapinfo tab file to ESRI shapefile using ogr2ogr either with sqlite dialect or without. When using sqlite dialect, ogr2ogr -overwrite -f "ESRI Shapefile" -dialect sqlite -sql ...
1
vote
0answers
95 views

SRID of geoemtry exported in PostgreSQL with ogr2ogr

I use ogr2ogr to export geometric data from EDIGEO files to some PostgreSQL table in append mode, but the output geometry SRID is always set to zero. Can I do something to specify the output geometry ...
2
votes
1answer
127 views

Node GDAL for ogr2ogr conversion

I currently have some scripts that use OGR2OGR to translate data form various source formats like ESRI Shapefile, GML etc to other file formats but especially to my PostGIS database. My normal ...
1
vote
1answer
26 views

Reprojecting a shapefile with ogr2ogr when a line is crossing the international date meridian

I have a line shapefile with a local transverse mercator projection ("+proj=tmerc +lat_0=50 +lon_0=172.5 +x_0=0 +y_0=0 +a=6371000 +b=6371000 +units=m +no_defs") and I want to reproject it into ...
3
votes
2answers
391 views

Can ogr2ogr read .kmz files? How?

Attempting a run-of-the-mill ogr2ogr process with a KMZ file failed: FAILURE: Unable to open datasource `Rail.kmz' with the following drivers. Is there a trick? (Obvious workaround is to unzip the ...
2
votes
2answers
63 views

Convert NAD_1983_Georgia_Statewide_Lambert to NAD83

All I have a ESRI generated shapefile that uses: NAD_1983_Georgia_Statewide_Lambert Here is the projection information: ...
2
votes
0answers
67 views

ogr2ogr ST_Difference operation on OGRVRTDataSource

I'm trying to subtract from one shapefile the portions of another which overlap using the following: land.shp: subunits.shp lakes.shp COOKIE=subunits CUTTER=lakes; \ echo ...
1
vote
0answers
159 views

What if 'geometry_columns' already exists in MSSQL Server Database?

When trying to load a .SHP into MSSQLSpatial using OGR2OGR, I get the following error: ERROR 1: Error initializing the metadata tables : [Microsoft][ODBC SQL Server Dr iver][SQL Server]There is ...
0
votes
0answers
33 views

ogr2ogr losing all ExtendedData attributes of KML

I'm trying to convert a KML to a shapefile using ogr2ogr, but whenever I do, I end up with only blank Name and Description fields on the elements, losing the ExtendedData that is attached in the KML. ...
1
vote
1answer
54 views

Connecting points located in opposite side of international date meridian

Given a list of coordinates, I need to create a line shapefile joining each of the point with a Python GDAL/OGR script. The procedure described here Convert XY points to a line? works fine in almost ...
1
vote
1answer
103 views

Adding fileGDB driver to gdal 1.11.1

I need to use the fileGDB driver in gdal, however I can't figure out how to install the driver. This is the only kind of documentation I found but it doesn't make any sense to me: ...
2
votes
2answers
130 views

ogr2ogr - Lost projection when converting geojson to MapInfo Tab

I have the following geojson that I would like to convert to MapInfo tab with ogr2ogr: ogr2ogr -f "MapInfo Tab" output.tab input.geojson geojson: { "type":"FeatureCollection", "crs":{ ...
1
vote
1answer
121 views

ogr2ogr - Convert geojson to shapefile create offset in coordinates

I want to convert this geojson file below into a shapefile using ogr2ogr command ogr2ogr output.shp input.geojson. However, an offset is appearing in the output coordinates that make the shapefile ...
1
vote
1answer
49 views

Problem using ogr2ogr to convert postGIS table to personal geodatabase

I need to convert a PostGIS table to a personal geodatabase using ogr2ogr. I can convert tables to a shapefile without a problem but whenever I try to convert it to .mdb using the ODBC driver, I get ...
1
vote
0answers
81 views

ogr2ogr *.tab to postgres: Failng on date format

I'm importing some MapInfo tab files into a PostgreSQL database running the following command in FWTools Shell: ogr2ogr -f "PostgreSQL" PG:"dbname='<the_database>' host='<the_host>' ...
1
vote
1answer
63 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
96 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
56 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
44 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 ...
1
vote
0answers
29 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
62 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
350 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
363 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
43 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
38 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
188 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
78 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
176 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
65 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
193 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
287 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 ...