1
vote
1answer
58 views

ogr2ogr reprojection works on command line but shifts output when same command run from inside python?

Reprojection with ogr2ogr works fine on command line, but shifts the polygon to northeast when same command is run from inside python using os.system(...) Any ideas why this could be? I hard-coded ...
3
votes
1answer
30 views

Lambert_Conformal_Conic: converting from shapefile to geojson fails

I have a shapefile that also contains a proj file that looks like so: PROJCS [ "MGI_Austria_Lambert", GEOGCS [ "GCS_MGI", DATUM [ "D_MGI", ...
0
votes
1answer
29 views

GDAL: Update spreadsheet from polygons in a shapefile

I am a beginner with GIS data, and have been looking for an answer but have not yet found it. I have a spreadsheet with lat/long points. I also have a shapefile with several numbered polygons over a ...
3
votes
1answer
107 views

Debugging ogr2ogr “AddGeometryColumn failed” and “Terminating translation prematurely after failed translation of layer”

As noted in the title, I'm getting the following error: ERROR 1: AddGeometryColumn failed for layer pretty_polys, layer creation has failed. ERROR 1: Terminating translation prematurely after failed ...
0
votes
0answers
50 views

How can you calculate the union/merge two polygons in ogr2ogr?

I want to calculate the union/merge two overlapping polygons using ogr2ogr (as I have 300+ to do). I want the output to be the same as you would get if you used the 'Merge shapefiles to one' command ...
0
votes
1answer
83 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
2answers
79 views

Convert shapefiles from WGS84 to Miller Projection

I have some shapefiles of the world from Natural Earth at WGS84. I would like to convert them to the Miller Projection. I have ogr2ogr, but I'm not sure what the parameters for this conversion ...
3
votes
2answers
237 views

Error exporting data from Oracle to shp using ogr2ogr

I have an oracle table which I would like to query/make a selection. I would then like to export the selection to a shp file. I'm using gdal and ogr2ogr. Following the guidelines here and here I ...
0
votes
0answers
18 views

converting from JSON to Shape files [duplicate]

I have a quick question about converting JSON to Shapefile. I'm trying to convert multiple polygon geometry JSON files into a single shape file and I'm not sure what kind of json this is ?[I'm ...
0
votes
2answers
49 views

Is there any way to use open source tools to make sure that lines on a map dont overlap?

I am a generalist developer getting the hang of basic gis. I made this geojson map by clipping and converting different shapefiles. The problem is that the precincts of New Orleans extend into the ...
2
votes
1answer
201 views

Converting JSON/GeoJSON files to Shapefiles

I have a quick question please about converting JSON/GeoJSON files. I'm trying to convert some JSON files into something I know how to work with (shapefile, R objects or PostGIS). I'm afraid I have ...
1
vote
2answers
68 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
60 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
193 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 ...
1
vote
2answers
665 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 ...
5
votes
1answer
209 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
3answers
260 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 ...
0
votes
3answers
217 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 ...
-1
votes
1answer
65 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
207 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 ...
1
vote
2answers
248 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
1answer
285 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
196 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. ...
1
vote
2answers
207 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 ...
3
votes
1answer
232 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
167 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: ...
2
votes
2answers
321 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' ...
2
votes
4answers
1k 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: ...
3
votes
2answers
174 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 ...
1
vote
1answer
79 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 ...
2
votes
1answer
137 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
723 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
0answers
221 views

How to convert shapefile to mapinfo file preserving special characters?

I have to convert a bunch of shapefiles to mapinfo files on a machine without a MapInfo license, so I am using ogr2ogr to perform this task. The problem is that when opening the mapinfo files in ...
2
votes
2answers
2k views

How do you open shapefiles with ogr2ogr

I'm following along the D3 tutorial, and on this line: ogr2ogr \ -f GeoJSON \ -where "adm0_a3 IN ('GBR', 'IRL')" \ subunits.json \ ne_10m_admin_0_map_subunits.shp run into the following ...
4
votes
1answer
3k views

How to re-project shapefiles?

I wanted to re-project a QGIS project, but there is no such option. When searching for an answer I see ogr2ogr suggested for this task, by re-projecting each vector layer (shapefile in this example). ...
2
votes
2answers
611 views

What can go wrong in UTM to WGS1984 conversion (shifted data)

I try to convert .shp files to OSM data with shp2osm and ogr2osm but the output data is shifted. Semi-Cross-Posting Warning: I have already asked a questions on the OSM help site, but this questions ...
10
votes
3answers
5k views

How to create a GeoJSON that works with D3?

I'm simply trying to convert a .shp file to a geoJSON format using: ogr2ogr -f geoJSON output.json input.shp After executing the command nothing seems to be wrong. Here's an excerpt from the ...
3
votes
4answers
3k views

How do I use ogr2ogr to convert a GML to shapefile in Python

I am trying to convert a GML to an ESRI shapefile using ogr2ogr utility in a python script. I have successfully installed the GDAL/OGR package via osgeo but I am now struggling to find/understand ...
5
votes
1answer
1k views

OGR Shapefile to CSV: Using Python to get WKT for multipart Polys.

Using ogr2ogr and python, I'm running into a wall with trying to create a csv with WKTs for a shapefile that contains multipart polygons. Currently this is this code I'm using (found it on interweb): ...
3
votes
2answers
1k views

merge shapefile using ogr2ogr and retrieve the attribute of both

Ciao, I have two shape files that I want merge (overlay/intersect) having in the destination the attributes of the two sources file. ogr2ogr file_merged.shp tl_2010_us_uac10_conus_albersUA.shp ...
9
votes
5answers
2k views

How can I update ogr2ogr to include the PostgreSQL driver?

I'm trying to use ogr2ogr to upload a shapefile to a remote PostGres installation. When I ran this command: celenius:~ celenius$ ogr2ogr -f PostgreSQL PG:"host=255.34.00.00 user=postgres dbname=mydb ...
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 ...
6
votes
7answers
5k 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 ...
5
votes
2answers
545 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 ...
5
votes
1answer
431 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 ...