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

learn more… | top users | synonyms

0
votes
0answers
9 views

Different KML size from ArcGIS and Ogr2Ogr

I have been converting shapefiles to KML. It seems that using ArcGIS to make a KML (by converting shapefile to feature layer and then using feature layer to kml tool) results in a much larger sized ...
2
votes
1answer
11 views

How do I call ogr2ogr from a C# application?

I have an ogr2ogr (GDAL) command that I run to export points from a database to an XML file. ogr2ogr-f GPX c:\temp\points.gpx PG:"host=localhost port=5432 dbname=SpatialPlayground schemas=public ...
1
vote
1answer
17 views

How do I resolve “relation does not exist”

I have a view, named PointsForGpxExport, that contains points I want to export to a GPX file. The ogr2ogr command I'm trying to use for the export is included below. When I run the command, a GPX file ...
1
vote
2answers
23 views

Reducing Size of KML file (After converting from Shapefile)

I have a shape-file of size 224 mega byte. I am using ArcGis to convert it to a KML file. The process involves converting the shapefile to a feature layer and then converting the layer to KML. An ...
0
votes
0answers
15 views

How to convert dc to shp with free software?

Someone can say me how to convert data from a .dc file (DesignCAD file) to a shp file or postgresql with free softwares ? I can do that easily with all versions of dxf or dwg files but not with dc. ...
0
votes
0answers
23 views

ogr2ogr re-projection produces empty shapefile

I use the following to re-project a shapefile to EPSG 4326 using ogr2ogr: ogr2ogr -s_srs "+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs" -t_srs "+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs" ...
0
votes
0answers
8 views

OGR2OGR converting Interlis to Shapefile fails

I tried an convert of a Interlis 1 file to Shape. For each table there is the following warning: Warning 1: No field definition found for table: Biens_fonds__PosPoint_limite I used different ...
0
votes
1answer
20 views

ogr2ogr KML to SHP generates invalid file names from layer names

I have a collection of very large KML files that I'm trying to convert to .shp. I'm iterating over 200+ KML files with an average size of around 20 MB. Each KML contains multiple layers, some of which ...
5
votes
4answers
79 views
+50

Converting shapefile from Shift_JIS to UTF-8 when the usual methods fail

Long story short, I'm trying to import this ESRI shapefile of Japan into CartoDB. (Sorry, no direct link: to download, click on the orange ファイルのダウンロード button, check 同意する to agree to the T&C, then ...
1
vote
1answer
41 views

error importing shp into postgis using ogr2ogr

I run an automated script that copies a number shapefiles into PostGIS. I have a problem with one dataset which fails during the export. As the roads.shp dataset is maintained by someone else, I ...
3
votes
1answer
56 views

Force OGR to use specific driver for input format

How could one force ogr2ogr to use a specific format to read input files? Out of the box ogr2ogr automatically chooses from it's long list of formats, which most of the time is great. However today ...
0
votes
0answers
14 views

ogr2ogr libkml output - multiple components in OGR_STYLE

I have following command: ogr2ogr -overwrite -f libKML z.kml "MSSQL:server=dev;database=db;trusted_connection=yes;tables=tmp.libkml_test" -where "stabbr = 'CT'" My source table contains a series of ...
0
votes
0answers
9 views

Extract table-embedded attributes in KML using ogr2ogr

I'm loading a number of diverse data files into a PostGIS database, using ogr2ogr. One of these data files is a KML with useful attributes embedded as an HTML table in a description column: ...
0
votes
0answers
27 views

Shapefile to Mysql error using ogr2ogr

I'm following this tutorial. I installed the “GDAL Complete” Framework from kyngchaos.com and I tested the installation on Mac. I have GDAL 1.11.2, released 2015/02/10. When I am trying to run this ...
1
vote
0answers
30 views

clip csv-file with ogr2ogr

I'm trying to clip a csv-file containing xyz-data (points) by an irregular shaped polygon in ogr2ogr. My code runs without any errors or warnings, but it returns an exact copy of the input-csv. What ...
1
vote
0answers
42 views

3d model to point cloud

Excepting FME, is there a way to convert 3d model to point cloud?
0
votes
0answers
29 views

GRIB data interpolation

I've been wrangling around in GFS grid based data (GRIB - mostly 0.5 degree resolution). I'm interested in plotting these by converting to geojson with ogr2ogr (which is quite easy). However, is there ...
1
vote
1answer
25 views

ogr2ogr select feature class from multiple filegdb

From windows command shell how might I merge a single layer from multiple file-gdb's into another file-gdb using ogr2ogr? All input gdb's have identically named feature classes and attribute ...
0
votes
1answer
26 views

Cannot clip FileGDB using Ogr2Ogr

I have a large line feature class (15GB) in a File Geodatabase that I would like to clip. I am trying to use ogr2ogr to do this, however I keep getting the error: ERROR 1: Unable to write feature ...
0
votes
1answer
30 views

Ogr2ogr trying to import and convert shapefile to EPSG:3857

I'm attempting to import a shapefile (along with .prj file) to MySQL using Ogr2ogr and using the t_srs option set to EPSG:3857 (the default for Leaflet and Google Maps) but I'm getting odd results, ...
1
vote
1answer
40 views

Mixing POINT and MULTIPOINT in PostGIS table

I'm trying to load a bunch of GeoJSON files into one PostGIS table. I get this kind of error: Warning 1: Geometry to be inserted is of type Point, whereas the layer geometry type is Multi Point. ...
0
votes
1answer
29 views

ogr2ogr Spatialite to csv very slow

I am using ogr2ogr to extract point data from a Spatialite db to a csv file:- ogr2ogr -f "CSV" commandtmp.csv dtm2.sqlite -lco GEOMETRY=AS_XYZ -progress -explodecollections the Spatialite db is 7GB ...
0
votes
0answers
20 views

Subtract parts of polygon that overlap with ocean

I have some seismic data in format of shapefiles/geojson. The data has no relevance in the oceans so I am looking to strip away those parts of the polygon. What I am currently doing is using the ...
1
vote
1answer
73 views

How to reproject all the vector files in a folder to a particular projection using ogr2ogr?

We have a folder with all sorts of vector files like tab,shp,dxf. Many of the files are in different projection. I would like to convert all the files to EPSG: 4326 and eventually the non-shapefiles ...
0
votes
1answer
28 views

Add new field in postgresql row while using ogr2ogr for shape to postgres

I am using the following ogr2ogr command for putting my shape files to postgresql table. This command runs fine. ogr2ogr.exe -append -lco GEOMETRY_NAME=geom -lco SCHEMA=public -f "PostgreSQL" ...
0
votes
1answer
77 views

ogr2ogr unable to open KML datasource

I downloaded some Wikimapia data using the wikimapia.api. Everything is A-OK since I've opened this in Google Earth and everything is in place. However, I need to turn it into a shapefile, or get the ...
0
votes
1answer
25 views

gdalwarp `-te -5.8 41 10 51.5 -ts 1980 0` not working with mercator?

I was working with native lat/log projection on etopo1: #donwload: curl -L -C - ...
0
votes
0answers
21 views

Using TIGER/Line shape files, how do I get address coordinates?

I've downloaded addressfeature shapefiles from TIGER/Line on the Census Bureau website. I converted one file to CSV using ogr2ogr. I get the following sample output: ...
1
vote
1answer
56 views

ogr2ogr command : chaining -clipsrc and -sql filters?

I'am currently doing a clip then SQL query to select the biggest cities out of Natural Earth data via 2 commands : ogr2ogr -clipsrc 1 52 7 49 ./tmp.shp ...
0
votes
1answer
69 views

How can I convert ESRI personal geodatabase (.mdb) to shapefile using OGR in C#?

I have to create a class in C# in which I would like to insert a function that converts an ESRI personal geodatabase, extracting that features it contains in shp using OGR. I looked at library ...
4
votes
1answer
55 views

How to Specify FID column name in shp2pgsql

In ogr2ogr I can specify the name of FID column using the option -lco FID={columnname} when importing a spatial data in PostGIS database. I am using shp2pgsql in case of shapefile and cannot find a ...
1
vote
2answers
37 views

Convert Natural Earth shape to GeoJSON - (Multi)LineString instead of (Multi)Polygon?

I need shapes of admin regions as GeoJSON (Multi)Polygons. After looking for an appropriate source for way too long, I found this NE Admin 1 dataset. Using ogr2ogr to convert the data to GeoJSON, I ...
0
votes
0answers
42 views

ogr2ogr in java gdal

I would like to code ogr2ogr -f "GeoJSON" destination.geojson source.geojson -s_srs EPSG:3068 -t_srs EPSG:4326 in java-gdal. I tried to understand how it should work by looking at this example but ...
0
votes
0answers
13 views

ogr2ogr problem converting sosi fil to kml (or anything else)

I am trying to convert a SOSI file to KML, but I am getting the following error. Error message ERROR 4: Unrecognized geometry of type 5. ERROR 4: Unrecognized geometry of type 20. ERROR 1: Feature ...
2
votes
2answers
96 views

OGR DXF Closed Polyline Conversion

I'm trying to convert closed polylines into polygons using ogr2ogr from dxf to mssql. Here It says that polylines are converted into POLYGON if they are closed, but I always get the type LINESTRING ...
0
votes
0answers
43 views

Exporting spatial object in mysql to shapefile with spatial reference

Info: Win7, MySQL 5.x and OSGEO4W 1.11 To import a shapeafile to MySQL I use this ogr2ogr command: ogr2ogr -f MySQL MySQL:gis,user=root,password=password C:\posto_pianco.shp -nln pianco_post -a_srs ...
1
vote
0answers
45 views

OGR2OGR FileGDB 2 other format with -SQL query change structure

I'm using GDAL 1.11.1 with ESRI FileGDB Driver, GDB version 10.x. When I use ogr2ogr, my goal is to sort differently my fields and in some case, to rename them. The problem is when I call FileGDB ...
1
vote
0answers
61 views

Export DGN to shape or postgis with multiple mslinks

I need a command line tool to export DGN files to shapefile or PostGIS, I tried ogr2ogr but it only exports type, level, graphicgroup, colorindex, weight, style, entitynum, mslink and text. I need the ...
5
votes
1answer
61 views

Reprojecting a CSV file using ogr2ogr?

I am trying to convert a CSV with fields in one projection system (EPSG:27700) to fields in another (EPSG:4326). I have made a VRT file called landfill.vrt, in the same directory as my CSV file, ...
1
vote
1answer
51 views

ogr2ogr: don't import properties on each feature?

I have a 2MB shapefile that when converted to GeoJSON becomes 10MB: $ ogr2ogr -f "GeoJSON" -t_srs EPSG:900913 landfill.geojson Authorised_Landfill_Sites_010k.shp I can reduce the size of the ...
1
vote
0answers
43 views

Using OGR2OGR with LIBKML (Examples please)

I am trying to figure out how to use GDAL (ogr2ogr) to export spatial data from SQLServer to KML. The standard KML driver works, but it is not very robust. LIBKML has so much promise (layers, styling, ...
1
vote
0answers
61 views

ArcMap KML Multigeometry to Shapefile

I have been troubleshooting this issue for quite some time now. I have a variety of tools available to me: ArcMap, QGIS, as well as OGR2OGR. Unfortunately, I have not had any success with any of these ...
1
vote
0answers
30 views

Reverse clip with ogr2ogr

I'm fairly new to GIS, working on a project where I overlay counties on google maps, and overlay cities on top. I'm using fusion tables, and running into Z-index issues. To get around this I'm hoping ...
1
vote
3answers
201 views

convert csv to kml or geojson, etc using ogr2ogr or equivalent command line tools (use “latitude” and “longitude” attributes for coordinates)

I've just unsuccessfully tried to use ogr2ogr to convert CSV into KML like so: ogr2ogr -f "KML" output.kml input.csv The csv has "latitude" and "longitude" columns. The attributes are all loaded ...
0
votes
0answers
156 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
47 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
127 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
0answers
36 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
80 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 ...
2
votes
1answer
84 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 ...