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
1answer
18 views

Filter OGR datasource in Python (or XML)

I'm trying to streamline the process whereby we build tiles (of ~30 layers, representing planning zone and zone-overlay boundaries). I have a strong preference for FOSS tools. A couple of our people ...
0
votes
0answers
22 views

Can styling be applied to a kml (from a shp) using ogr2ogr

Is it possible to generate a styled KML using ogr2ogr (ie pen width and colour?) I cannot seem to find anything in the ogr2ogr documentation. My code so far is; ogr2ogr.exe -f "KML" prow-kml.kml ...
1
vote
2answers
35 views

Running the ogr2ogr utilities in a batch file. Problems with command project

I have made a batch file containing a list of two commands. The first (-clipsrc) works properly, but the second not (-s_srs EPSG:4326 -t_srs EPSG:3857). Could anyone tell me where is the fail?. This ...
2
votes
0answers
27 views

How to clip or erase a csv file with a non-rectangular shapefile?

I can clip a csv file with a ogr2ogr having 4 extents of a rectangular polygon. Is it possible to clip a csv file with a non rectangular shapefile?
0
votes
1answer
37 views

ST_Intersect with ogr2ogr and Spatialite

I am trying to intersect Spatialite datasets with ogr2ogr, the OGR Virtual Format and SQL Syntax. I can't seem to locate whether the error is in my SQL query or my VRT file. Data ...
0
votes
0answers
23 views

Merging polygons in SHP

Is it possible to merge polygons, using ogr2ogr cmdline tools? I.e. taking a SHP file and generate a new one, where records are merged when a field has the same value?
4
votes
2answers
137 views
+50

How to make a local copy of a large WFS dataset?

We are writing a application in which a part of the job is to fetch a relatively large (>10000 features) and often updated dataset from a WFS server, store a local copy, and do geospatial analyses on ...
1
vote
1answer
22 views

ogr2ogr does not set osm_id for all multipolygons

I used ogr2ogr to convert from osm data (pbf) to spatialite : ogr2ogr -progress -f SQLite -dsco spatialite=yes france.simple.spatialite france-latest.osm.pbf then, a large part of the imported data ...
1
vote
1answer
29 views

GDAL does not recognize EPSG code of a shapefilefile regrojected by ogr2ogr

I am using ogr2ogr to reproject shapefiles. For example: ogr2ogr -s_srs EPSG:1234 -t_srs EPSG:3857 dest.shp srs.shp ogr2ogr then creates dest.shp, dest.shx, dest.dbf and dest.prj as expected. The ...
0
votes
1answer
32 views

How to export Extent as shapefile from multiple shapefiles using OGR?

I want to export EXTENT as Rectangular shp file from multiple shape using OGR2OGR?
1
vote
2answers
60 views

Extracting difference between two massive shapefiles using QGIS?

I have two massive shapefiles and I need to create a difference shapefile output between the two. I have a layer where I have satellite coverage (orange) and then a layer where I have high resolution ...
0
votes
0answers
39 views

ogr2ogr converting ESRI shape to Mapinfo interchange

I'm trying to convert .shp files to .mif files on Ubuntu Linux using ogr2ogr: "ogr2ogr -f "MapInfo file" -dsco FORMAT=MIF mprec.mif mprec.shp" I don't get any errors but when I open the resulting ...
1
vote
0answers
27 views

ogr2ogr latitute longitude conversion formats

trying to convert shape files into mysql tables. Able to create table and load data successfully using OGR2OGR. Only challenge I see is latitude/longitude is not exactly the same format as one of my ...
2
votes
1answer
33 views

Perform affine transformation on shapefile with OGR, GDAL, or other command line tools?

Transformations with WKT or EPSG code are made easy with ogr2ogr, but are there tools for me to define my own affine transformation to apply to the coordinates of a shapefile? Or, in general, is ...
3
votes
1answer
54 views

ogr2ogr postgres import: check if dataset exists

I have a PostGIS database which I update daily with ogr2ogr using CSV files. This works great. Is there a way to check whether the actual value of a column already exists in the table (e.g. ...
3
votes
1answer
31 views

Reprojecting to same srs shifting the layer

I am using ogr2ogr to reproject a shapefile. Here is what I have done. I have a shapefile A.shp. I used the following command to create B.shp: ogr2ogr -t_srs EPSG:3857 B.shp A.shp Now I reprojected ...
0
votes
1answer
23 views

How to set encoding when using ogr2ogr to export from oracle db to mapinfo table?

I am trying to automate the export of spatial data from a oracle database to mapinfo .tab files. Using this thread I made my script. However I can't see how to set the encoding right. My data have ...
1
vote
0answers
40 views

Suppress verbose output when something goes wrong with ogr2ogr

Whenever ogr2ogr is not able to read a file, it seems to produce pages of output: Unable to open datasource `file.geojson' with the following drivers. -> ESRI Shapefile -> MapInfo File ...
1
vote
1answer
60 views

How Does Ogr2Ogr Simplify Work?

Can someone explain how the ogr2ogr simplify works? I am trying to use raster data which has a spectral resolution of 30m. The vector file that I am trying to import into Google Fusion is large in ...
1
vote
1answer
36 views

How to convert from .shp to .csv using python and either gdal_translate of ogr2ogr

I am trying to convert .shp files to csv using either gdal_translate or ogr2ogr and python but its not work. if i run the following from qgis its not giving an error but at the same time its not ...
0
votes
0answers
13 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 ...
3
votes
1answer
24 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
61 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
53 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
24 views

How to convert dc to shp with free software?

Someone can tell 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
29 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
10 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
29 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
103 views

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
55 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
73 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
30 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
13 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
51 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
31 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
45 views

3d model to point cloud

Excepting FME, is there a way to convert 3d model to point cloud?
0
votes
0answers
47 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
34 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
34 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
44 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
52 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
32 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
25 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
85 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
34 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
113 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 ...
1
vote
1answer
31 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 - ...
1
vote
0answers
23 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
65 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
93 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 ...