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

GDal problem “no suitable image found” when I run “ogr2ogr” command

I am trying to run "ogr2ogr" command macbook$ sudo ogr2ogr -f "PostgreSQL" PG:"dbname=test user=postgres" /Users/macbook/planning.gdb But I am getting this error: dyld: Library not loaded: ...
0
votes
0answers
23 views

ogr2ogr - extracting S-57 layers

I'm trying to extract the layer DEPARE from an S-57 datafile and convert it into a shapefile. I'm using ogr2ogr from OpenGeo Suite 4.5 (GDAL 1.11.1) on Windows 7 64 bit. The problem is that when I ...
0
votes
1answer
30 views

clipping ESRI shapefiles along with shx and dbf

I've seen other answers detailing how one can clip a .shp file with ogr2ogr but this just returns a clipped set of geographic features. I also want to clip the .shx and the .dbf in the same manner. ...
3
votes
3answers
103 views

Plotting Geo Points with “by arc centered at” Instructions

A recent Supreme Court decision redefined the legal boundaries of California along the Pacific Ocean: http://www.theverge.com/tldr/2014/12/15/7397085/supreme-court-california-boundaries-map I am ...
0
votes
1answer
143 views

ogr2ogr GeoJSON GeometryCollection

All, I have a Postgres/PostGIS DB with two geometries in a single table. I want to export them as a GeoJSON GeometryCollection (see here) but I can't seem to get the GEOMETRY_AS_COLLECTION layer ...
3
votes
2answers
538 views

Convert non-spatial Oracle table to spatial Oracle table in a different database

I'm trying to use ogr2ogr to convert data from a non-spatial table (has X & Y values) in an Oracle database (1) to a spatial format in a different Oracle database (2). This will be scheduled to ...
1
vote
1answer
51 views

Finding an ogr2ogr equivalent of SelectLayerByLocation

So I'm trying to take individual grid point buffers and only select the regions that the points intersect with (via SelectByLocation). Generally I run the following code to: Explode multipart ...
0
votes
0answers
22 views

How can I prevent ogr2ogr from trying to get the SRID from PostGIS?

I'm running ogr2ogr for a PostGIS to GeoJSON export like this: ogr2ogr -s_srs EPSG:4326 -f GeoJSON unique_geoms.json "PG:host=localhost dbname=local_data user=local_user password=local_pass" -sql ...
0
votes
0answers
12 views

PGeo: MDB Tools driver not found

I'm trying to load a Access .gdb(.mdb) database into postgis using ogr2ogr. I'm running Ubuntu 14.04 with gdal 1.10. I've install both unixODBC and mdbtools as per the instructions at ...
1
vote
1answer
101 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
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: ...
1
vote
0answers
172 views

Trying to use OS Translator plugin and cant find ogr2ogr.exe

I have installed the OS Translator plugin from the Faunalia Repository but when I try to use the plugin I get a "Can't find ogr2ogr[.exe], can't continue" error message. I have tried reinstalling the ...
1
vote
0answers
40 views

Importing 2014 TIGER County Shape Files to 2012 SQL Server?

Last year, I figured out how to import TIGER Census Block shape files into 2012 SQL Server with no issues. I assumed I would use similar code to do the county shape files but I keep getting a few ...
2
votes
1answer
38 views

ogr2ogr + MapInfo TAB + SQLite (SpatiaLite) = unicode problems

I'm adding MapInfo TAB files to SQLite (SpatiaLite) database using those arguments: ogr2ogr -f "SQLite" dataset.sqlite somelayer.tab -dsco spatialite=yes Source file somelayer.tab have ...
3
votes
1answer
79 views

ogr2ogr window closes after termination

I'm using ogr2ogr for export from PostGIS to FileGDB. It works fine, but after termination the command window closes immediately. Is there a way to keep it open and get some kind of message or report ...
1
vote
2answers
278 views

How to convert Shapefile to TopoJSON with grouping neighbor shapes by some criteria

I have a shapefile with countries, which I convert to GeoJSON using ogr2ogr and then converting that json to another TopoJSON, using topojson command-line tool. Everything works like charm, but now I ...
2
votes
2answers
61 views

How to export thousands of features from PostGIS to a single GeoJSON file?

I know how to export one feature from a PostGIS database using ogr2ogr: $ogr2ogr -f GeoJSON out.json "PG:host=localhost dbname=xxx user=xxx password=xxx" -sql 'select id, county, wkb_geometry from ...
0
votes
0answers
29 views

error converting shapefile to geoJSON with Ogre online tool

I am using on online tool built with ogr2ogr to convert shapefiles to geoJSON: http://ogre.adc4gis.com/ It's worked well except for one shapefile, and I can't see why... The shapefile has only six ...
2
votes
1answer
33 views

ogr2ogr: Can I add a field when I import to PostGIS?

I have a bunch of GeoJSON files that I want to import to a PostGIS database. I can import individual files perfectly as follows: ogr2ogr -f PostgreSQL PG:"host=x user=x dbname=x password=x" ...
1
vote
0answers
24 views

Import .gfs file into PostGIS?

Is it possible to import a .gfs file into PostGIS? I can open the .gfs file in QGis, so I assume it is a geographic file of some kind: but I'm not sure how to get it into PostGIS. I have Googled but ...
0
votes
0answers
18 views

Projection of COSMO-EU?

I have data points of COSMO-EU data stored in WGS84 coordinates. Now I try to transform them into coordinate system where the points becomming arranged to a regular grid. Does anybody knows the Proj4- ...
1
vote
1answer
32 views

How to define layer style for KML layer within OGR Virtual Format?

I have the following OGR virtual format data source, which includes a few GeoJSON files and one KML file: <OGRVRTDataSource> <OGRVRTUnionLayer name="union"> ...
4
votes
2answers
888 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 ...
0
votes
1answer
101 views

ogr2ogr from MIF to KML including MID generating split kmls

I have a set of MIF and MID files that I would like to translate to KML. I used ogr2ogr to transform the MIF into one big KML which worked ok like so: ogr2ogr -f "KML" geo-kml geo-mif I have two ...
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
3answers
1k views

How to preserve non-ASCII characters in ogr2ogr import?

I want to import a list of international place names and their locations into a SQL Server database using ogr2ogr. The source data is a CSV file encoded in UTF-8. I've prepared a five-record sample ...
1
vote
1answer
141 views

Aggregate/dissolve MySQL geometry

On Centos, I have a MySQL 5 database with a MyISAM table that has a geometry column with a spatial index, containing US county boundaries. Trying to combine/aggregate/dissolve some of these into as ...
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 ...
0
votes
1answer
14 views

ogr2ogr - gpx to PostGIS has wrong timezone adjustment

A gpx track point: <trkpt lat="52.321775959804654" lon="-72.647269548848271"> <time>2014-10-01T16:07:19Z</time> </trkpt> is imported with ogrogr in my PostGIS ...
1
vote
1answer
440 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
0answers
29 views

ogr2ogr fileGDB translating points

I am converting data from spatialite to fileGDB (and reverse) for a project using QGIS and ArcGIS. When I convert using ogr2ogr (or QGIS) from spatialite to fileGDB, the points are translated ...
0
votes
0answers
32 views

Overlapping gpx imported to PostGIS with ogr2ogr

I can successfully import track points from gpx file into my PostGIS database the usual way: ogr2ogr -f "PostgreSQL" PG:"dbname=ABC user=usrname password=123" firsttracklog.gpx However, I have a ...
0
votes
1answer
50 views

ogr2ogr convert DXF to GeoJSON with defined geometry

I trie to convert a DXF file into a GeoJSON file with: ogr2ogr -f 'GeoJSON' -sql "SELECT * FROM entities WHERE layer = 'geom_test'" test.json dfxtest.dxf Is it possible to convert only geometries ...
1
vote
2answers
79 views

OGR2OGR and SQL: selecting 30 biggest places from a country?

I use ogr2org to filter naturalearth places.shp : ogr2ogr -f GeoJSON -where "ADM0NAME = 'India' AND POP_MAX > 500000" places.tmp.geo.json ne_10m_populated_places.shp I would prefer to select the ...
1
vote
1answer
39 views

OGROGR and SQL: unexpected reserved keyword error?

As I do the following query on naturalearth places.shp : ogr2ogr -f GeoJSON -sql "SELECT * FROM ne_10m_populated_places WHERE ADM0NAME = 'India' ORDER BY POP_MAX DESC LIMIT 1,30" places.tmp.geo.json ...
0
votes
1answer
34 views

Export shapefile From PostGIS

I've a website where I'm giving the functionality of creating and editing line features. I'm using Leaflet-Draw plugin for drawing, PostGIS for storing the data and GeoJSON to display it on map. My ...
0
votes
1answer
31 views

Problem 'unable to open datasource" with ogr2ogr to reproject shape file

I have no idea why i get the following error: FAILURE: Unable to open datasource `Sydney2.shp' with the following drivers. I have already checked successfully the shape with ogrinfo. I am using the ...
1
vote
0answers
39 views

What is causing invalid spatial reference error using ogr2ogr converting PostGIS to FileGDB in a Feature Dataset?

I am trying to use ogr2ogr to convert a layer from PostGIS to a FileGDB. I want the layer to be created inside a Feature Dataset. The spatial reference of the source layer is EPSG:3500. The spatial ...
3
votes
2answers
124 views

Piping data to ogr2ogr

Is it possible to directly pipe data to ogr2ogr? I'm trying to curl a GeoJSON file and pipe it to ogr2ogr to covert it to another format. Without using a pipe, I was able to achieve this by first ...
5
votes
1answer
456 views

Ogr2Ogr exported this boundary 90 degrees incorrectly

I've got some GEOGRAPHY data in my Sql Server 2008. I wish to export it as a shapefile (so I can import it into QGIS) and when I do, it's rotated 90 degrees to the left and then flipped 180 degrees to ...
0
votes
1answer
19 views

Merging separate country features together into one region

I am trying to creating a map of the UK where Scotland and England are merged into one shape and not separate shapes for each country. As a minimum working example, I'm following Mike Bostock's Let's ...
3
votes
1answer
1k views

How to Import ESRI Geodatabase format .gdb into PostGIS

I ran into a problem when loading a ESRI Geodatabase format .gdb into PostGIS. I have data 2.5GB GDB file. I followed some tutorials on the internet, but it seems that doesn't work out. I created a ...
1
vote
1answer
41 views

GeoJson based on shapefile : large coordinates

I'm quite new to GeoJson (for use with d3), and in need of some help. When I convert my available shapefile (.shp) with ogr2ogr to a GeoJson-file, the resulting coordinates are very big numbers (in ...
1
vote
3answers
45 views

Lossless conversion from shapefiles to XML/JSON/Text

I'm a software developer and I need to create a custom tool that imports ESRI shapefiles (shp + shx + dbf), manipulates the content and then exports new shapefiles. To avoid a complex binary reading ...
2
votes
1answer
50 views

Can ogr2ogr write data to a file geodatabase feature dataset?

I am dumping postgis tables into a file geodatabase and it works great--the result is a file geodatabase full of featureclasses. But is it possible to write these featureclasses into feature ...
0
votes
1answer
136 views

Why do I get an error when I try and clip a shapefile to a shapefile using ogr2ogr?

I want to clip a shapefile to a shapefile. The input shapefile is a 1 m vector grid generated in QGIS. The tile I'm clipping to is just a simple polygon (the geometry is contained within the 1 m ...
1
vote
1answer
176 views

How to call ogr2ogr from command line with Python 2.7 from ArcGIS 10.2 for Desktop?

I am trying to access ogr2ogr in the command line, and this is the message I receive: 'ogr2ogr' is not recognized as an internal or external command, operable program or batch file. This is ...
0
votes
0answers
50 views

Google Tracks convert kml to shape and preserve attributes

I've been attempting to convert a Google Tracks kmz file to an ESRI shapefile using the GDAL and libkml(http://www.gdal.org/drv_libkml.html) which I built on my Ubuntu 14.04 (64-bit) system. The kml ...
2
votes
1answer
57 views

Export PostGIS line to AutoCAD with graphical direction information

Some time ago I managed to export from PostgreSQL to AutoCAD DXF format a line (LINESTRING) using ogr2ogr program with a PostgreSQL Query, and it works (I can visualise it by the QuantumGIS). Now I ...
1
vote
1answer
142 views

How to Set the Vertical Coordinate system when creating 3D Shapefile?

I have data of wells in CSV format, which I'm converting to a 3D shapefile, using ogr2ogr. The latitude and longitude are in WGS84, while the depth is from the WGS84 geoid. I have the OSGeo4W ...