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
0answers
182 views

CSV rows to Polyline with OGR

I'm not sure if I can complete this operation in one step - but someone might be able to help me. My input file is a csv file with PointID, x, y, z and LineID columns. I'm looking to combine all ...
3
votes
0answers
397 views

How to save table from PostgreSQL to MapInfo File?

I have two tables: 1 with geometry in WGS 2 with geometry in Local System I tried this: ogr2ogr -f "MapInfo File" output2.tab PG:"host=localhost user=postgres password=123456 dbname=postgis" -sql ...
3
votes
1answer
917 views

How do I split polygons that cross the dateline?

I have a dataset of country borders which I obtained from: http://thematicmapping.org/downloads/world_borders.php/ I have that dataset in both shp and SQL, but I'll put out there that I don't feel ...
1
vote
1answer
521 views

Exporting vector to kml with ogr2ogr without extended data

If I convert a shapefile as kml in QGIS, GRASS or ogr2ogr directly, defining the name and/or description field with the -dsco tag, all columns in the attribute table of the input layer are exported to ...
4
votes
1answer
496 views

Importing multiple shapefiles with tablespace and inheritance defined

In the UK we are very fortunate to have the Ordnance Survey who provide the whole of Britain in vector format. The data is provided as over 60 tiles, each of which contains something like 16 ...
12
votes
2answers
6k views

ogr2ogr converting to shapefile - how to select feature types?

Shapefiles can only have one geometry type, but many other formats (kml, geojson) can have multiple types. When converting to shapefiles, is it possible to to tell ogr2ogr to create multiple ...
2
votes
4answers
4k views

How to convert SHP into GPX or JSON?

I would like to convert the tree inventory shape files of London (Canada) into a GPX file and if possible into a JSON file. You can download the archive from their Open Data website. It contains the ...
4
votes
1answer
763 views

Why are GeoJSON coordinates different exported from QGIS vs. ogr2ogr?

I have a shapefile with a Google Mercator projection (900913) that I need converted to GeoJSON. I need to do this on a regular basis amongst other things so I wrote a shell script to do it using ...
1
vote
0answers
112 views

Question about the bound box I'm getting from ogr2ogr

I'm using ogr2ogr to create geojson from a shapefile using the -lco WRITE_BBOX=YES argument. Everything is working great except the bound box (bbox) doesn't seem to be the traditional "left, bottom, ...
1
vote
2answers
1k views

OGR DXF to KML conversion

I'm trying to convert a DXF 2010 file to KML using ogr2ogr: ogr2ogr -f "KML" outfile.kml infile.dxf In the file, $INSUNITS is 6, that's meters, if I'm correct? The problem is that DXF is not ...
6
votes
7answers
6k views

ogr2ogr convert all shapefiles in a directory

I have a directory with several shapefiles. How can convert all these shapefiles to MapInfo with ogr2ogr. I know how I can convert one file. And I can make a batch script writing a line for each file. ...
1
vote
0answers
45 views

How to load GeoJSON files directly onto QGIS? [duplicate]

Possible Duplicate: Plugin or script to get QGIS to display geoJSON in a layer Is there a way to do this? Or is there a way i can put it onto PostGIS and then load it onto QGIS? I actually ...
2
votes
1answer
1k views

How to reproject shapefile using ogr2ogr

I have shapefile in EPSG:2834 and I want to reproject it into EPSG:4326. I am trying to use ogr2ogr in Windows; however, I get this failure output: C:\Users\Nik\Desktop\Logan_Lines>ogr2ogr -t_srs ...
5
votes
2answers
550 views

Translating all features in a shape file

I have a friend with a bit of a problem. He has 1000+ shape files mapping paddocks and being used for precision agriculture. He's recently discovered the base station positions used to create these ...
9
votes
7answers
2k views

How to add field with filename when merging shapefiles with ogr2ogr?

I'm merging some shapefiles and I had some problems doing so inside QGIS, so i'm using ogr2ogr directly. I'm doing this (in a batch): ogr2ogr -overwrite %destination% %n1% ogr2ogr -update -append ...
5
votes
1answer
436 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 ...
3
votes
1answer
4k views

Converting kml to shape file via ogr2ogr including all attributes

Here is the example kml file I am using: <kml xmlns="http://www.opengis.net/kml/2.2"> <Document> <name>My Golf Course Example</name> <Placemark> <name>Club ...
5
votes
2answers
2k views

ogr2ogr kml to shp conversion created 184 shapefiles?! What am I missing?

I'm trying to convert this KML dataset of ice arenas to a shapefile using ogr2ogr (GDAL 1.8). After some initial troubleshooting to get the script running, it's creating 184 different shapefiles (736 ...