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

learn more… | top users | synonyms

4
votes
1answer
139 views

How do I teach ogr2ogr about a projection?

I have JSON generated from ArcGIS that I want to convert to GeoJSON in EPSG 4326. This fails: $ ogr2ogr -f GeoJSON -t_srs EPSG:4326 out.geo.json in.arcgis.json OGRGeoJSON ERROR 6: EPSG PCS/GCS code ...
2
votes
1answer
417 views

Converting multilayer KML files to GeoJSON using ogr2ogr

I have a kml file that I'm trying to convert to GeoJSON. However, it turns out there's multiple layers, and ogr2ogr isn't happy. $ ogr2ogr -f GeoJSON shapes.json shapes.kml ERROR 6: GeoJSON driver ...
1
vote
1answer
81 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 ...
1
vote
1answer
61 views

If using ogr2ogr to load a PostGIS DB, does the PG string need host and port arguments?

The ogr2ogr command in this question How to Import ESRI Geodatabase format .gdb into PostGIS was missing the host and port arguments, or so I thought. My answer included something like this ogr2ogr ...
0
votes
1answer
289 views

Will MapInfo only read PostGIS data that has been loaded via EasyLoader?

NMZ says in this thread that MapInfo will only read data in PostGIS that has been loaded by MapInfo's EasyLoader. I wasn't sure if this was still the case so I've loaded data into postgis via ogr2ogr ...
1
vote
1answer
98 views

Lost relation when importing from OSM to PostgreSQL with ogr2ogr

I am currently trying to import all administrative boundaries (countries, states, cities, etc) from OSM. I downloaded a small file from Geofabrik (Corsica), in order to run my tests. I understand ...
1
vote
1answer
141 views

In Ogr2OGR: what is SRS?

I am trying to understand this command: ogr2ogr -f "MapInfo File" original.tab wgs84.shp -s_srs EPSG:27700 -t_srs EPSG:4326 I don't understand the s_srs and t_srs paramaters. The help file says ...
1
vote
1answer
244 views

Merge multiple geometry type TAB files in QGIS/OGR

I have a number of vector layers with all types of geometry (point, line/multiline, poly) and I want to combine them into a single layer in QGIS. I know MapInfo can do it but with the other 99% of my ...
1
vote
1answer
105 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
2answers
363 views

Dissolve/aggregate polygons with ogr2ogr or gpc?

I have a large number of polygons representing the boundaries of US counties which I need to merge into as few polygons as possible. Is it possible to do this with non-commercial software, or ...
1
vote
2answers
67 views

Which format to choose to convert to ShapeFiles?

Given the following format options: all.json, all.xml, all.xls, all.csv, all.kml, all.gjson Which one is the best/easiest to convert the data into standard ERSI Shapefiles which contains the ...
0
votes
0answers
39 views

ESRI 3D generate file format to ShapeZ

Can GDAL (ogr2ogr) convert ESRI 3D generate file format (class PointZ, LineZ and PolylineZ) to 3D Shapefiles? The format description can be found here: 3D Formats information. The PolylineZ format ...
1
vote
1answer
147 views

Python ogr2ogr language character encoding

In python script i'm exporting .shp files to .csv/.gpx/.kml import ogr, ogr2ogr ... ogr2ogr.main(["","-f", "CSV", csvfile, shpfile, "-lco", "GEOMETRY=AS_WKT", "-lco", "SEPARATOR=SEMICOLON"]) ...
0
votes
0answers
21 views

From NBM to UWN

Okay, I'll start this off by saying that I'm not a GIS expert by any means. I'm also working with data and places that most people don't work with, but I'm hoping it can be boiled down to basics. I've ...
0
votes
0answers
59 views

Export additional data with ogr2ogr

I am trying to import my ESRI-shapefile with OGR2OGR to an existing mysql table. This works fine but unfortunately only the featureID and the geometry data is exported. How do I add the labels of the ...
1
vote
1answer
546 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 ...
0
votes
1answer
57 views

check if the district belongs to the province

I'm building map viewer using d3js and data from WFS service. In Poland we have 3 levels of administrative divisions: province district community Using WFS service I can get exact boundaries of ...
1
vote
1answer
145 views

When trying to convert an .e00 file into a shapefile with ogr2ogr, getting “ERROR 4: This looks like a compressed E00 file”

When I ran this command: ogr2ogr topo.shp flowe86hyp.e00 I got this error: ERROR 4: This looks like a compressed E00 file and cannot be processed directly. You may need to uncompress it first ...
0
votes
1answer
207 views

Convert from Gauss-Kruger to Bing coordinates / projection

I am trying to convert a shapefile with ogr2ogr from Gauss-Kruger (zone 4) to Bings coordinate system / projection using the advice given in ...
1
vote
2answers
99 views

How to update polygon longitude if negative?

I have a polygon, with longitude in [-180, 180], with 2 parts around the dateline. I want to make a map centered on the date line. My plane is to: 1./ update the longitude, so that if lon < 0 , ...
3
votes
1answer
72 views

Ogr2ogr does not support file name with non-ASCII character?

I tried to use the following script to convert shapefile to mif: ogr2ogr -f "MapInfo File" D:\docs\arcgis_data\shp_mif\BOU.mif D:\docs\arcgis_data\shp\BOU.shp it works. But I found that if the ...
1
vote
1answer
48 views

Ogr2ogr driver error when convert shapefile to mif [closed]

I use the following script to convert shapefile to mif: ogr2ogr -f "MapInfo File" D:\docs\arcgis_data\shp_mif\BOU.mif D:\docs\arcgis_data\shp\BOU.shp But I got the error: ERROR 6: Unable to open ...
4
votes
1answer
158 views

ogr2ogr: How to specify element type for DXF creation

I am trying to create a DXF from a Polygon Shapefile using ogr2ogr: ogr2ogr -f DXF parcels.dxf parcels.shp The problem is that the polygons are written as hatch elements. How do I specify that ...
0
votes
0answers
116 views

ogr2ogr converting MS SQL Server spatial view to MapInfo TAB -error in datum and encoding

Running this ogr2ogr command: ogr2ogr -f "MapInfo File" "D:\V_GeoNode.tab" \ "MSSQL:Server=xxx\SPECIFIC;Database=db1;UID=xxx;PWD=xxx" \ -sql "select * from V_GeoNode" -a_srs "EPSG:25832" It returns ...
0
votes
1answer
78 views

how can the ogr2ogr help to merge a shp file?

I have over 30 shp files which is named "street.shp" into the sub-folder. There is over 30 sub-folders. In the sub-folder, there is another shp files which may be named a building.shp...etc. I only ...
1
vote
2answers
578 views

How to change shapefile longitude from -180 - 180 to 0 - 360?

I have a shapefile of world countries, with longitude between -180° and 180°. How can I change the shapefile (eg. with ogr2ogr) for having longitude between 0 and 360°. Following OSGEO/Trac ...
1
vote
2answers
123 views

sqlite version error with ogr2ogr

I am trying to randomly select some points from a shape file using ogr2ogr and an SQL query via sqlite but it seems to baulk at the sqlite version: ogr2ogr -sql "SELECT * FROM probe_2004to2012 WHERE ...
3
votes
1answer
71 views

New attribute creation using ogr and regex

I've got a folder full of dxf files with elevation values included as part of a long text attribute. I've written a regex expression to extract the elevation value, and would like to add it as a new ...
5
votes
1answer
198 views

ogr2ogr selecting features by attributes

I am writing a shapefile after some processing; however, in the final step I need to do some selection by attributes from the the shapefile. I am using the command in a shell with the aim of using it ...
0
votes
0answers
39 views

Copy Z-coordinate from S57 SOUNDG to Shp

I'm trying to create a shapefile from an S57 SOUNDG Layer, where i want to put in in a separate column the Z-coordinate of the SOUNDG Layer in the resulting Shapefile....any ideas on how to achieve ...
0
votes
0answers
731 views

D3 adding topojson - no data visible

Yesterday I asked what would be the best method of creating an overlay in a web map that would allow for some interactivity. Create interactive map with no server Thanks to a variety of people who ...
0
votes
1answer
255 views

ogr2ogr DXF to PostgreSQL some LINESTRING coordinates mirrored to the negative longitude

I have been using ogr2ogr GDAL tool to migrate geospatial data from DXF file to PotgresQL database without much problems. But now there is a special problem I can not fix. I have a DXF file with ...
4
votes
1answer
162 views

GDALWARP and OGR2OGR / CS2CS not agreeing on transformation

I am trying to transform some data (both raster and vector) from WGS84 to a Croatian Coordinate system defined by: +proj=tmerc +lat_0=0 +lon_0=15 +k=0.9999 +x_0=5500000 +y_0=0 +ellps=bessel ...
0
votes
3answers
234 views

Create ESRI shape file with attributes from mySQL

I have some geometry which can be perceived as regions within a country and wish to create a shape file which contains all the regions along with some attributes (e.g. name, population, area code, etc ...
1
vote
3answers
217 views

Batch processing Topojson

Can i convert more than one shape file .shp to topojson. Can this be performed using batch processing.?? I can convert shape file to topojson one by one but i have about 6000 files and i don't want ...
0
votes
0answers
36 views

How to retain crs data when datum-shifting using ogr2ogr?

I'm converting a shapefile from OSGB36 to WGS84 using ogr2ogr like so: ogr2ogr -f "ESRI Shapefile" new.shp original.shp -s_srs EPSG:27700 -t_srs EPSG:4326 However, the original contains the ...
0
votes
3answers
189 views

How to find the attributes of a shapefile from the command line?

I'm following Mike Bostock's tutorial "Let's Make A Map." He explains how to filter a shapefile using ogr2ogr based on the attributes of the features. I can open a shapefile in QGIS and look at the ...
5
votes
2answers
566 views

OGR merge shapefiles of different geom type into a single GeoJSON feature collection

I'd like to merge shapefiles of different geometry types into a single geojson feature collection, but OGR says it doesn't support update of GeoJSON files: $ ogr2ogr -f GeoJSON -t_srs crs:84 -lco ...
1
vote
2answers
212 views

Is it possible to convert regular JSON to GeoJSON?

My apologies if this is a repeat question, I searched here and couldn't find an answer. I have JSON data I've exported from Openpaths.cc which contains lat and lon values. However, the data is not in ...
-1
votes
1answer
63 views

How can I reproject a shp file in NAD_1983_UTM_Zone_15N to something more standard

I have a public shp file data set which is in a format that doesn't contain actual latitudes and longitudes (prj file below). I'd like to load it into SQL and be able to utilize the latitude and ...
1
vote
1answer
425 views

Export Postgis Geometry POINT as Label text to DXF or DGN

I really need to export, by the ogr2ogr command or similar, text information related to a geometry position from my PostgreSQL(with PostGIS) database to an AutoCAD DXF layer file or to a Microstation ...
1
vote
1answer
85 views

Reading non-spatial Access tables with ogr2ogr

I am trying to read a whole Access database into Postgis using the ogr2ogr (Version 1.9.1) command. For some reason however, it only reads spatial tables and no non-spatial tables. All my attempts to ...
1
vote
1answer
195 views

Multiple input shapefiles for ogr2ogr sqlite spatial operations

I'm running up against an issue doing a spatial operation requiring multiple input shapefiles using ogr2ogr and sqlite. I have: ogr2ogr -f "ESRI Shapefile" output.shp input.shp -dialect sqlite -sql ...
0
votes
0answers
86 views

How to specify the version of output SQLite database in ogr2ogr?

I'm having issues with a .sqlite database that I generate from PostGIS using ogr2ogr. The data appears to export into SQLite properly, and it loads in TileMill fine, but when I try to add any of the ...
2
votes
2answers
175 views

Change python + ogr2ogr.exe to python + ogr

I have written several complicated python scripts that end up using ogr2ogr to load or translate data. I have been converting these scripts to standalone exe files meaning the team do not require ...
0
votes
1answer
198 views

ogr2ogr: issue with batch clipping shapefiles with converted kml file as clip source

I wrote this script that (running in MSYS) converts a kml to shp and applies a re-projection to it. The resulting shp then has the same SRS as the shps that I want to clip with it. I use a for loop to ...
1
vote
0answers
128 views

ogr2gr loading spatial data into mysql

I am trying to load shapefile into mysql (MYISAM) using ogr2ogr and i get an error that says failed to fetch the requested layer. What could be wrong with my statement is it the issue with quotes or ...
1
vote
2answers
237 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 ...
4
votes
2answers
752 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 ...
4
votes
1answer
172 views

Why does ogr2ogr silently skip some rows?

I have a CSV file called office_locations.csv that contains point data. I want to load it into a SQL Server geospatial database using ogr2ogr. The CSV file is encoded in UTF-8. It contains a header ...