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

learn more… | top users | synonyms

2
votes
1answer
89 views

How to add a progress bar to an ogr2ogr script

Hello GIS Folks, We have started using ogr2ogr to upload MapInfo tables into Microsoft SQL server in my workplace. Some of the tables are massive (>1,20,000 records) and there is no ...
2
votes
3answers
2k views

GDAL 1.10 ogr2ogr OSM “Unable to open datasource”

I have a problem with ogr2ogr and osm file. I install from source (on Ubuntu 12.04.2 LTS) newest GDAL libary and OGR still can't read osm files. gdal-config --version 1.10.0 ogr2ogr --version GDAL ...
1
vote
2answers
302 views

How to extract features with specific coordinates from a ShapeFile?

I would like to extract a number of features from a ShapeFile which match with specific latitude/longitude values. I am interested if/how this can be done with QGIS and ogr2ogr. The output should be ...
1
vote
1answer
478 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 ...
0
votes
1answer
67 views

VSI File API support in ogr2ogr

It seems that support for streaming input is wishy-washy in ogr2ogr. For example, why can I do this: curl "http://data.usgin.org/arizona/wfs?service=WFS&version=1.1.0& ...
3
votes
1answer
811 views

ogr2ogr coverting DXF to shapefile, why am I losing part of the feature?

I'm starting to mess around with some of the GDAL toolsets, specifically the ogr2ogr. I'm working with converting a 2000 ACSII DXF file to shapefiles depending on geometry. Everything seems to work ...
1
vote
1answer
127 views

Can I append to different tables using ogr2ogr?

I have been through many related questions and links but I am still confused as to how/if this is achievable. So, I have defined tables in my postgis database and I would like my ogr2ogr commnand to ...
1
vote
1answer
330 views

Converting Tab to Shp Using OGR2OGR with Python on linux

First i downloaded http://svn.osgeo.org/gdal/trunk/gdal/swig/python/samples/ogr2ogr.py and i am importing this. How can i get ogr2ogr to run in my script? nothing seems to be working and i not sure ...
2
votes
1answer
86 views

Load PGDB with filename

this is my first question here and I have done extensive searches but still can't find the (full?) answer I'm looking for. Hopefully someone can help! I am loading a number of personal geodatabases ...
3
votes
1answer
201 views

Projection of Shapefiles for Spain (INE)

I downloaded the official shapefiles for the municipalities of Spain from INE here. It has a lot of shapefiles, but I found out that the right one for what I need is esp_muni_0109.shp. I would like ...
2
votes
2answers
146 views

Extract PostGIS line features to GPX

I have a request to provide GPX files of certain trails (around 100) that are present in OpenStreetMap. Given a local PostGIS install with OSM data, I think the process would be something like: ...
1
vote
1answer
108 views

issues using ogr2ogr to reproject and rename into shp

I'm trying to reproject, move from tab to shp and rename all the .tab contained in a folder tree using ogr2ogr. I'm working with Windows 7, QGIS 1.8 installed with advanced OsGeo4w and gdal 1.9.2. I ...
2
votes
2answers
285 views

Driver error when converting MapInfo file to Shapefile with ogr2ogr

I am trying to convert a MapInfo file to an ESRI shapefile using GDAL's ogr2ogr command as described here, but I am getting the following error: FAILURE: Unable to open datasource `Iceland2pts.mif' ...
1
vote
0answers
68 views

OGR Error : Silly size requested

I'm scripting OGR functionality in order to filter some mapinfo tables and convert them into sqlite files. ogr2ogr -f "SQLITE" newtest.sqlite test.tab -sql "SELECT cols FROM test WHERE .." where ...
1
vote
1answer
76 views

Offset shapefile to start from prime meridian

I have Natural Earth shapefile (for example this file: link) covering whole globe in -180:180 range. I want to offset this file, so that it starts from Greenwich prime meridian instead -180. How can ...
1
vote
3answers
392 views

Export Shapefile To KML - Google Maps Layers/Tiles

I need to convert a shapefile (either polygon shp with millions of polygons or polyline shapefile derived from the polygons) into a format to use online in Google Maps. I currently use GDAL codes ...
1
vote
4answers
1k views

How to convert KML (Google Latitude) to SHP on Linux?

I downloaded a KML track from Google Latitude. The service allows to download the tracked route from the user's profile providing a link such as: ...
1
vote
1answer
901 views

Loading shapefile to a specific table in postgis using ogr2ogr

I have already created a geometry table in postgis. I want to load several shapefiles into that table using ogr2ogr. But I didn't find the parameter which could specify that table. ogr2ogr -append ...
1
vote
1answer
157 views

Transform GeoRSS from WGS84 to UTM 33N with ogr2ogr

Is this really not supported or do I have missed something in my code? If it is not possible with ogr2ogr, do you know of any other open source methods to reproject from GeoRSS to GeoRSS or from shp ...
2
votes
1answer
399 views

Batch convert OSM/PBF data

I need to import some OSM data about a region of Italy into a SHP file or Postgres DB, possibly with batch process. I already use OGR2OGR to batch import data from SHP to Oracle and Postgres and I ...
2
votes
1answer
285 views

Converting mixed mapinfo tab files

Hi I need a little help/ ideas on how to convert tab files. The problem: I have many TAB files produced daily by 3 party app, I need to batch import the files into postgres. Most files import fine, ...
0
votes
1answer
200 views

ogr2ogr extract shp-file by extent with bash script

I'm batch extracting features from shp-files in a directory with this bash script: Is there a way to avoid the loop? I somewhere read that you can process folders but I was not able to get the right ...
3
votes
2answers
169 views

Is it possible to create CAD file from shapefile and also create CAD blocks from the database fields

I am trying to find out if there is any software or plugin/code that I can bundle that will take a shapefile and export it to a CAD file with CAD blocks generated so our CAD mappers can just move the ...
3
votes
1answer
417 views

Export KML ExtendedData with OGR2OGR

I would like to export with ogr2ogr the data I have in a kml as ExtendedData <Placemark> <ExtendedData> <SchemaData schemaUrl="#15540_punti"> ...
1
vote
1answer
75 views

BBox missing when converting TIGER to GeoJSON

I can't get the bounding boxes of polygons if TIGER/Line shape files when converting them to GeoJSON using FWTools. The other default information is present and there is no difference between the ...
1
vote
3answers
131 views

Why is ogrinfo showing no layers from an ESRI FileGDB?

I have an ESRI File Geodatabase (FileGDB) (size is 15+GB), which has over 10 layers, when I open it up in ArcGIS, everything seems to be working. I want to move this database to postgreSQL with OGR ...
0
votes
2answers
1k views

How to move and open shapefiles with ogr2ogr?

I'm a total newb following along the d3 map tutorial. at this line: ogr2ogr \ -f GeoJSON \ -where "adm0_a3 IN ('GBR', 'IRL')" \ subunits.json \ ne_10m_admin_0_map_subunits.shp I get ...
4
votes
4answers
2k views

How to convert multipoint layer to point

I have a Spatialite layer which is multipoint (following a QGIS Save As from shapefile). I need it to be PostGIS and POINT. I have tried ogr2ogr -nlt POINT and got 'new row for relation "xxx" violates ...
2
votes
1answer
398 views

Can you explain this WKT multipolygon format?

I am confused by the output I'm getting from ogr2ogr when converting a shapefile to WKT. What I'm expecting to see is something in the form below (from Wikipedia): MULTIPOLYGON (((40 40, 20 45, 45 ...
2
votes
1answer
125 views

Natural Earth: How to get the position of all provinces that belong to a state

This question is about Natural earth 1:10 states and provinces.shp file. I'm using ogr2ogr and want to know the name of the id i need to pass . In purpose of pulling out the right states regions. ...
3
votes
1answer
544 views

Setting geometry types importing to PostGIS with OGR

I'm using ogr2ogr to import data into a PostGIS database. Each dataset I need to import has (theoretically) the same exact data structure, but it appears that they are not the same geometry types. ...
2
votes
1answer
281 views

Converting from shp to geojson fails

I'm following Mike Bostock's tutorial, let's make a map, but for a map of Mexico. I want to display state boundaries. I was able to get the map of Mexico from Natural Earth Data's world maps. My ...
1
vote
0answers
254 views

How to import 3D geometries from DXF, VRML or X3D into PostGIS 2

we plan to develop a webbased 3D GIS using PostGIS 2 and GeoServer with a W3DS. The architecture works fine, but i have problems to import 3D geometries into PostGIS. The geometries come from AutoCAD ...
1
vote
1answer
68 views

How does ogr2ogr determine which transformation to use and how big would the introduced error be?

I want to convert TIGER data GEOGCS["GCS_North_American_1983", DATUM["North_American_Datum_1983", SPHEROID["GRS_1980",6378137,298.257222101]], PRIMEM["Greenwich",0], ...
2
votes
3answers
569 views

Ogr2Ogr SQLite Geometry Functions

I believe title is all clear.I'm using Ogr2ogr utilities & binaries to read geometry. I used something like this: ogr2ogr -f "SQLite" test2.sqlite test.sqlite -sql "SELECT ...
1
vote
1answer
131 views

Ogr_wrap problem

I'm having problems with my csharp project in developing a console application.I've added references of ogr_csharp.dll & osr_csharp.dll & gdal_csharp.dll. In the line Ogr.RegisterAll(); ...
3
votes
0answers
124 views

How do I clip Geojson FeatureCollection with another Geojson polygon

I have a GeoJSON file that contains one FeatureCollection with a bunch of features that are polygons. I also have the boundary of the continental USA in another GeoJSON file. I'd like to clip the ...
1
vote
1answer
216 views

Projecting shp from GK3 to UTM32 with BeTa2007

I've experimented with projections of shapes, used the official provided grid beta2007 for germany and noticed differences between transforming by double exporting over custom CRS in QGIS and ...
2
votes
1answer
305 views

How to debug ogr2ogr ERROR 1: Did not get at least 2 values or invalid number of set of coordinates?

I'm trying to convert a government data contour GML (http://geo.data.linz.gv.at/katalog/geodata/hoehenschichten/2011/1m-Hoehenschichten.gml) to Shapefile. It seems like it was created by FME: ...
2
votes
1answer
283 views

Does ogr2ogr Convert from PostGIS to File Geodatabase (FGDB_BULK_LOAD YES) work?

I am trying to export a lot of data from a PostGIS database to a File Geodatabase. The command I used to use was ogr2ogr -progress -append -f "FileGDB" -gt 66536 -sql "SELECT * FROM line" ...
4
votes
1answer
643 views

Can't export a polygon shapefile to MySQL using ogr2ogr?

I am having problems with ogr2ogr and keep getting different versions of the error: ERROR 1: MySQL error message: The used table type doesn't support SPATIAL indexes. Description: ALTER TABLE ...
2
votes
1answer
867 views

How to use non-native spatial data from MS SQL Server with ogr2ogr?

I have some tables in MS SQL Server (2012) with WKT string columns. I want to export these data to a MapInfo tab file. Currently I am using the following command: ogr2ogr -f "MapInfo File" ...
2
votes
0answers
206 views

How to convert shapefile to mapinfo file preserving special characters?

I have to convert a bunch of shapefiles to mapinfo files on a machine without a MapInfo license, so I am using ogr2ogr to perform this task. The problem is that when opening the mapinfo files in ...
0
votes
1answer
91 views

Should a GDAL Plugin be the same version as GDAL aready built into QGIS

Should a GDAL Plugin be the same version as the GDAL that's aready built into the QGIS version installed? Or,can another different version of GDAL be built and it installed as a Plugin for QGIS, ...
3
votes
1answer
394 views

ogr2ogr from Postgres to GeoJSON missing crs key

I'm using ogr2ogr to convert some OSM data for Greenland (not really important for the question), from a PostGIS database to a file containing GeoJSON. The problem is that the GeoJSON gets written ...
3
votes
1answer
2k views

How do you open shapefiles with ogr2ogr

I'm following along the D3 tutorial, and on this line: ogr2ogr \ -f GeoJSON \ -where "adm0_a3 IN ('GBR', 'IRL')" \ subunits.json \ ne_10m_admin_0_map_subunits.shp run into the following ...
4
votes
1answer
261 views

Can ogr2ogr be used to append multiple DBF files?

Can ogr2ogr be used to append multiple DBF files? It works with SHP files, but I can't see how to do it with DBF files on their own. It ought to be possible, considering DBF is a subset of SHP.
3
votes
2answers
918 views

How did QGIS fix a shapefile's character encoding, and can I do this on the command line with ogr2ogr?

Solved: I'm not sure why, but it works fine if I specify --config SHAPE_ENCODING "ISO-8859-1" in my ogr2ogr command. For whatever reason, this allowed ogr2ogr to go from the original TigerLine ...
4
votes
1answer
2k views

How to re-project shapefiles?

I wanted to re-project a QGIS project, but there is no such option. When searching for an answer I see ogr2ogr suggested for this task, by re-projecting each vector layer (shapefile in this example). ...
2
votes
2answers
544 views

What can go wrong in UTM to WGS1984 conversion (shifted data)

I try to convert .shp files to OSM data with shp2osm and ogr2osm but the output data is shifted. Semi-Cross-Posting Warning: I have already asked a questions on the OSM help site, but this questions ...