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
0answers
14 views

osx terminal ogr2ogr batch covert .json to .kml

using osx El Capitan terminal This works fine one file at a time to convert .json to .kml ogr2ogr -f "KML" xxx.kml xxx.json I would like to do all files at once I have tried for %f in (*.json) do ...
1
vote
1answer
58 views

ogr2ogr Shapefiles to Postgres SRS problem

I am trying to import to my Postgresql (9.1+129ubuntu1) + PostGIS (1.5.3-2) database a Shapefile with polygons with the ogr2ogr tool from Gdal-Bin package (1.7.3-6ubuntu3). I know the origin SRS of ...
0
votes
0answers
25 views

Error clipping extent of shapefile with boundary box with ogr2ogr from python [closed]

Trying to clip polygon shapefile with boundary box in ogr2ogr called from python gives error: "FAILURE: Unable to open datasource 'C:\UserData\save.shp' with the following drivers." then lists ...
0
votes
0answers
11 views

Copy specfic layer to new datasource using OGR Swig Java bindings

Is it possible to efficiently copy a specific layer from one datasource to a different datasource using GDAL/OGR Java bindings? I know it is possible to create a new layer in the target data source ...
3
votes
1answer
82 views

Convert KML to GeoJSON with ogr2ogr and remove KML special attributes

I'm trying to convert KML to GeoJSON (or some other formats) using ogr2ogr (look at this question). It's all working fine, except of one problem: I'm always receiving these metadata attributes with ...
1
vote
0answers
40 views

How to convert csv file into geo database file?

I have a csv file that i want to export to a file geodatabase (*.gdb) in C#. I am currently looking into GDAL ogr2ogr commands. They have a way to convert gdb file into csv file but not the ...
2
votes
1answer
29 views

Convert *.asc OSGB36 files to WGS84 GeoTIFF using gdal/ogr2ogr

I am trying to obtain elevation readings using gdallocationinfo (as per other datasets I have) from a set of .asc files containing elevation data (plus an associated .prj file), using WGS84, but I ...
4
votes
2answers
89 views

ogr2ogr of NTF_Lambert_II_etendu is off by about 30 meters

I am converting RPG files in NTF_Lambert_II_etendu to wgs_84 using: ogr2ogr -t_srs EPSG:4326 ilot_2008_027_wgs84_2.shp ilot_2008_027.shp but the result is off by about 30 meters. Surprisingly, the ...
2
votes
1answer
56 views

Split SHP file using ogr2ogr

I am trying to split a SHP file using all the attributes in the column header SUBURB. Below is an example of the attribute table sitting behind the SHP file: Name Suburb ABC BAY ...
0
votes
1answer
16 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
35 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
54 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 ...
0
votes
0answers
15 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
38 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
17 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
65 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
63 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
40 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
27 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
0answers
41 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
58 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
2answers
79 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
85 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
24 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
27 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
121 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 ...
0
votes
0answers
25 views

Styling and saving multiple KMLs at once

is there a way to style multiple KML files at once and then save each one as its original file without going through them individually? I have approximately 600 KML point files that need to remain ...
1
vote
1answer
32 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
63 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
61 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 ...
1
vote
1answer
74 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
19 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
181 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
46 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
38 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
94 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
29 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
38 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
64 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
99 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
76 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
40 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 ...
0
votes
0answers
46 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
51 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
65 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
38 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
35 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
24 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
47 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
182 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 ...