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
245 views

FWTools ogr2ogr command does not seem to recognise dim parameter

I am trying to convert a 3D shapefile to 2D via FWTools shell. This is the command I am trying ogr2ogr REGC2013_GV_Clipped_lonlat_2d.shp REGC2013_GV_Clipped_lonlat.shp -dim 2 Which returns the ...
1
vote
1answer
315 views

Error during conversion of shapefile to MySQL using ogr2ogr

I have installed MS4W in Windows 7. I get an error when I try to convert a shapefile to MySQL database using GDAL/OGR ogr2ogr. This is the command I'm trying: C:\ms4w\tools\gdal-ogr>ogr2ogr -f ...
0
votes
1answer
180 views

OGR2OGR workaround for gpx-json conversion bug

ogr2ogr produces invalid GeoJSON when multiple layers are involved (http://trac.osgeo.org/gdal/ticket/3842). For example: ogr2ogr -f GeoJSON "$f.json" "$f" tracks routes For me the bad GeoJSON ...
2
votes
1answer
244 views

ogr2ogr - function getsrid(geometry) missing error {PG to File}

I am issuing the following statement ogr2ogr -a_srs EPSG:27700 -f "MapInfo file" "test.tab" PG:"host=xxx user=xxx dbname=xxx password=xxx active_schema=xxx" -sql "Select * from sale_region" and I ...
0
votes
2answers
59 views

Making development patterns more efficient with ZSH

A common pattern I find myself encountering is converting a CSV to a projected GeoJSON as described here. That entails 3 steps, and I'd like to get it down to the following: GEOIFY {file} ...
10
votes
1answer
2k views

GeoJson to ESRI Shapefile using ogr2ogr

I have a GeoJson file that I want to convert to ESRI Shapefile using ogr2ogr in FWTools. I tried using ogr2ogr -F "ESRI Shapefile" filename.shp geojsonfile.json OGRGeoJSON I got output ERROR ...
1
vote
0answers
202 views

problem with WFS Data, GDAL, Python, ArcGIS, & Defining Projection

I'm pulling in data in gml2 format with a EPSG#4267 from a wfs. I create a datastream in python and then run the following from the python window in ArcMap: data = datastream.read() #write the gml ...
2
votes
1answer
68 views

POLYGON25D WITH OGR2OGR

I know how to convert a csv file with xyz coords to point25d with ogr2ogr and vrt file but the coords in the files are the vetices of 3dpolygon (firsth and last ones are the same coords). I want to ...
3
votes
1answer
114 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
378 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 ...
2
votes
1answer
710 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
90 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
1k 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
172 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
437 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
92 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
299 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
220 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
146 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
364 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
74 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
96 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
501 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 ...
3
votes
5answers
2k views

How to convert KML with tracks to Shapefiles?

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: ...
2
votes
1answer
1k 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
186 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
553 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
385 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
261 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
186 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
515 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
83 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
142 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 ...
1
vote
3answers
2k 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 ...
5
votes
4answers
3k 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
527 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
148 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. ...
4
votes
1answer
771 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
315 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
318 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
73 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
738 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
177 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
150 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
266 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
373 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: ...
3
votes
1answer
391 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
2answers
879 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
1k 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" ...