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

learn more… | top users | synonyms

4
votes
0answers
55 views

How do I load 1 billion points into PostGIS?

I have a file geodatabase containing research data that I need to load into PostGIS. The GDB contains one feature class with one billion records with three columns (the FID, a FK, and the geometry (...
4
votes
0answers
327 views

How do I clip Geojson FeatureCollection with another Geojson polygon

I have a GeoJSON file that contains one FeatureCollection with a bunch of features that are polygons. I also have the boundary of the continental USA in another GeoJSON file. I'd like to clip the ...
4
votes
0answers
641 views

Ogr2ogr: Unable to open datasource problem

I downloaded the Precints shapefile from the City of Boston's data hub, and I'm trying import it into SQLServer (I'm running the Express verson). I've already created the database in the SQLServer (...
4
votes
0answers
715 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
0answers
74 views

Using ogr2ogr in python?

I found this helpful post that got me started using ogr2ogr in python: Using ogr2ogr to convert GML to shapefile in Python? as well as this one: How to convert ArcGIS Server JSON to GeoJSON? I am ...
3
votes
0answers
61 views

ogr2ogr imports GML data (not from OSM) to Postgis but without the other_tags “hstore”-column

The problem I'm encountering some issue trying to use ogr2ogr to import some GML input data (not OSM) into Postgres. I'm trying to use COLUMN_TYPES=other_tags=hstore to store all the fields not ...
3
votes
0answers
128 views

Dissolving polygons in a large dataset

I need to dissolve polygons by the ID attribute in a large dataset (+-1gb shapefile). I have been struggling to find an efficient method to do this. I have tried the following methods: Postgis ...
3
votes
0answers
251 views

How to clip a big shapefile from another shapefile's extent

I am working on mangroves in Sundarbans (Bangladesh / India), using Landsat pictures. I need to equalize them in reflectance, before classification, for the evolution of the biomass in this region. I ...
3
votes
0answers
68 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 ...
3
votes
0answers
336 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
0answers
40 views

Using ogr2ogr for clipping vector files

I am looking for alternative (more efficient) methods for clipping large feature class datasets. When using the 'Clip' tool in ArcGIS, often times the tool will crash after many hours of processing. ...
2
votes
0answers
49 views

How to remove projection in terminal from .shp file with valid .prj available

I have .prj, .shp, .sbn, .sbx, .shx, .dbf files where the content of the .prj file is the following: PROJCS["S-JTSK_Krovak_East_North",GEOGCS["GCS_S_JTSK",DATUM["D_S_JTSK",SPHEROID["Bessel_1841",...
2
votes
0answers
82 views

ogr2ogr ST_Difference operation on OGRVRTDataSource

I'm trying to subtract from one shapefile the portions of another which overlap using the following: land.shp: subunits.shp lakes.shp COOKIE=subunits CUTTER=lakes; \ echo '<OGRVRTDataSource>...
2
votes
0answers
65 views

How to install CartoDB driver for ogr2ogr?

I'm trying to import data from my postgis DB directly into CartoDB. I've seen in this forum's post that I can do that with ogr2ogr, a GDAL tool, in this way: ogr2ogr -t_srs EPSG:4326 --config ...
2
votes
0answers
43 views

Can ogr2ogr “reverse clip” (or “clip out” or “erase” or “difference”) one shapefile from another?

Is there a means in ogr2ogr to "clip out" one shapefile from another? I know ogr2ogr -clipsrc B.shp out.shp A.shp will remove any part of A.shp that is NOT in B.shp. Is there an ogr2ogr command to ...
2
votes
0answers
83 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?
2
votes
0answers
94 views

3d model to point cloud

Excepting FME, is there a way to convert 3d model to point cloud?
2
votes
0answers
195 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, ...
2
votes
0answers
151 views

ogr2ogr fileGDB translating points

I am converting data from spatialite to fileGDB (and reverse) for a project using QGIS and ArcGIS. When I convert using ogr2ogr (or QGIS) from spatialite to fileGDB, the points are translated ...
2
votes
0answers
161 views

What is causing invalid spatial reference error using ogr2ogr converting PostGIS to FileGDB in a Feature Dataset?

I am trying to use ogr2ogr to convert a layer from PostGIS to a FileGDB. I want the layer to be created inside a Feature Dataset. The spatial reference of the source layer is EPSG:3500. The spatial ...
2
votes
0answers
172 views

ogr2ogr does NOT save “styles”, say “color”, information; how do I get around it?

I'm using ogr2ogr to convert KML to GeoJSON and I'd like to extract style information along with the data. The bash script I am using is: filekml="/tmp/poly.kml" filegeojson="/tmp/poly.geojson" ...
2
votes
0answers
223 views

How to export postgis points as blocks in dxf with ogr2ogr

I'm trying to export postgis points as blocks to DXF format. I have a simple table in postgis with columns: CREATE TABLE pod_com_azimuth ( ogc_fid integer, rotation double precision, pointtype ...
2
votes
0answers
357 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 ...
2
votes
0answers
221 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 ...
1
vote
0answers
17 views

Trying to get all Landscan Urban areas in the USA (from Natural World shp files)

I'm desperately trying to get a json file of all the Landscan urban areas in the USA. The ne_10m_urban_areas_landscan.shp has a list containing polygons of all urban areas in the world with a NAME ...
1
vote
0answers
24 views

Setting default value in FileGDB table column during GDAL/ogr2ogr export from PostGIS?

I'm doing an export for one table (table name: 'schaden_polygon') from a PostGIS-database (db-name: 'mydata') to ESRI FileGDB via ogr2ogr commandline-tool. The PostGIS-table contains a column 'm_uuid' ...
1
vote
0answers
56 views

Merging features by admin or sovereingt

I followed Mike Bostock's 'Let's Make a Map' tutorial to make a GeoJSON map of the EU starting from a 1:10M cultural admin0 shapefile from Natural Earth. The problem that I'm facing if that some of ...
1
vote
0answers
14 views

Text imported into SQL Server using ogr2ogr had extra characters at the beginning

I've managed to import some MapInfo data sets into SQL Server using ogr2ogr But when I run a query in SQL Management Studio (SSMS), the various text fields look to be "blank" However if I use the ...
1
vote
0answers
20 views

Identifying suitable head (H) for hydro power estimation from 30m SRTM DEM data using focal statistic analysis

I am doing my project on identifying suitable sites for locating small-scale hydro power. I have all other necessary variables but I am confused about extracting Head (H) values in meters from SRTM ...
1
vote
0answers
46 views

Is spat the correct flag to use in my ogr2ogr command?

I have an ogr2ogr command that I'm using to convert part of a Postgres database to a Geojson. I ingested all of Canada in my database and to start, I want to grab all of the buildings in the Toronto ...
1
vote
0answers
53 views

ogr2ogr - Shapefile database SQL query; missing .cpg and .xml

I am using gdal and ogr2ogr to perform a SQL query on a database of shapefiles with the code below. The geoprocessing works and the appropriate shapefile is extracted from the query, but when I print ...
1
vote
0answers
69 views

ogr2ogr FAILURE: Couldn't fetch requested layer 'ùnlt'!

I am getting the following error message with ogr2ogr while try to convert into MySQL. I have tried PGeo,Shapefile and FileGDB. FAILURE: Couldn't fetch requested layer 'ùnlt'! My environment is ...
1
vote
0answers
67 views

ogr2ogr - mapinfo to geojson. Merging shapes with certain values

I'm just starting out with this so apologies if I explain things poorly. I have some mapinfo files (TAB, IND, MAP etc) and I am trying to convert to Geojson. I can do this using ogr2ogr ogr2ogr -...
1
vote
0answers
39 views

Ogr2ogr: Shape to MySQL. Delete (or ignore) “geometry_columns” and “spatial_ref_sys”

Im exporting a shapefile to my MySQL database. But as standard it also add the additional metadata tables: "geometry_columns" and "spatial_ref_sys" Is there a way to either delete these tables or ...
1
vote
0answers
123 views

How to convert csv file into geo database file?

I have a csv file that i want to export to a file geodatabase (*.gdb) in C#. I am currently looking into GDAL ogr2ogr commands. They have a way to convert gdb file into csv file but not the ...
1
vote
0answers
26 views

SQL Server aggregate function in ogr2ogr command

I would like to define create a GeoJSON bounding box using SQL Server's EnvelopeAggregate function, embedded in an ogr2ogr command. I have the following command: ogr2ogr -f GeoJSON envelope.json "...
1
vote
0answers
63 views

converting shp to fileGDB with ogr2ogr changes geometry type?

I'm converting a shapefile to file geodatabase with GDAL 1.11.3 and the ESRI FileGDB driver. ogrinfo on the .shp gives: $ ogrinfo NED1_Index.shp INFO: Open of `NED1_Index.shp' using driver `ESRI ...
1
vote
0answers
125 views

SRID of geoemtry exported in PostgreSQL with ogr2ogr

I use ogr2ogr to export geometric data from EDIGEO files to some PostgreSQL table in append mode, but the output geometry SRID is always set to zero. Can I do something to specify the output geometry ...
1
vote
0answers
190 views

What if 'geometry_columns' already exists in MSSQL Server Database?

When trying to load a .SHP into MSSQLSpatial using OGR2OGR, I get the following error: ERROR 1: Error initializing the metadata tables : [Microsoft][ODBC SQL Server Dr iver][SQL Server]There is ...
1
vote
0answers
92 views

ogr2ogr *.tab to postgres: Failng on date format

I'm importing some MapInfo tab files into a PostgreSQL database running the following command in FWTools Shell: ogr2ogr -f "PostgreSQL" PG:"dbname='<the_database>' host='<the_host>' port='...
1
vote
0answers
120 views

ogr2ogr conversion error - Can't create fields of type Binary on shapefile layers

I'm having trouble using the ogr2ogr tool on the command line. My data is stored in SQL as binary, type is mixed polygons and multipolygons. I am using the following command for conversion from SQL to ...
1
vote
0answers
34 views

Import .shp into postgre using ogr2ogr

I'm trying to import a .shp into postgre using ogr2ogr but i'm stuck with an error with the select clause, any ideas? ##vsmap_path=vector ##millesime=number 2015 from qgis.core import * import os ...
1
vote
0answers
65 views

ogr2ogr: export intersected gml using shapefile

I'm trying to do the same as the ogr2ogr example given by http://gis.stackexchange.com/a/119404/6458 The difference is that my inputs are a GML and a shapefile. Export.shp should only contain the ...
1
vote
0answers
213 views

Using a ShapeFile spatial index with ogr2ogr and ogr.DataSource.ExecuteSQL()

I created a spatial index foo.qix for a foo.shp with ogrinfo -sql "CREATE SPATIAL INDEX ON foo" foo.shp However, when I do a query with ogr2ogr and look at it in strace, it doesn't use that index: ...
1
vote
0answers
14 views

Include <link> in GPX when writing from ogr2ogr

http://www.gdal.org/drv_gpx.html seems to indicate that ogr2ogr should be able to write <link>[1] elements into a GPX file, however when using ogr2ogr to convert from PostGIS to GPX, I get the ...
1
vote
0answers
70 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 ...
1
vote
0answers
152 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
0answers
77 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
77 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: WKT,TLID,TFIDL,TFIDR,ARIDL,ARIDR,...
1
vote
0answers
259 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 ...