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
71 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
442 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
150 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
158 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
311 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
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
2answers
693 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
72 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
54 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
199 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
22 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
66 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 ...
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 ...
0
votes
1answer
63 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
246 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
263 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
110 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
83 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
56 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
214 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
1answer
85 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
840 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
150 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
82 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
283 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 ...
1
vote
0answers
1k 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
373 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
210 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 ...
1
vote
3answers
299 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
303 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
3answers
305 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
753 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
278 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
71 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
536 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
115 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
238 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
97 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
193 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
275 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
169 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
277 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
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 ...
4
votes
1answer
189 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 ...
4
votes
1answer
350 views

Is there a way to handle file names with spaces in ogr2ogr?

I'm trying to convert .shp files to .kml files. I used a batch file to find all .shp files in a directory and its sub-directories and convert them to .kml. Some converted and some gave me the error ...
0
votes
1answer
100 views

Placemark name not shown after converting from .shp to kml

I've converted a bunch of .shp files to .kml using ogr2ogr and I've noticed that the placemark names in Google Earth are not reflected in the newly made kml files. I have also used ogr2gui and found ...
0
votes
1answer
207 views

How can i save Shape file as sql script with ogr2ogr?

I have a some Shape files and i want to convert it into sql scripts. I know that ogr2ogr can put data into data base itself. But i want to have a sql script which can be executed and put data to DB. ...
2
votes
1answer
482 views

Can OGR2OGR batch file run in cmd.exe?

I have very little experience in dealing with ogr2ogr, and currently I am trying to find out if there is a way I can automate batch conversion of .shp files to kml using windows services schedule. So ...
1
vote
2answers
243 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 ...