Questions tagged [ogr2ogr]

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

229 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
1
vote
0answers
139 views

Ogr2ogr transform shapefile into GeoJSON without the geometry

I'm trying to transform a set of shapefiles (49) that contains nearly 2500 LineStrings each and also different columns of information. So my intention is to obtain only this additional information ...
1
vote
0answers
418 views

ogr2ogr MVT Append

I am creating a MVT (Mapbox Vector Tile) MBTile for various layers from my PostGIS database but I cannot seem to get ogr2ogr to append to an existing MBTile. I am currently using the following ...
1
vote
0answers
80 views

Linux (unix) bash, import multiple fgdb to PostGIS using find & ogr2ogr command

I have multiple file geodatabases in different folders and this is the command I made so far: find -path "*/V*/*.gdb" -o -path "*/W*/*.gdb" -o -path "*/R*/*.gdb" -o -path "*/WM*/*.gdb" | while read ...
1
vote
0answers
124 views

ogr2ogr manipulating cpu and memories

My OGR2OGR command is working very hard and I am kind of satisfied but not as fast as I expected. What I am doing is Joining a table to a fgdb feature class and save it to another fgdb. through my mac ...
1
vote
0answers
134 views

Export label to dxf from postgresql by ogr2ogr

I need to export label to dxf from postgresql by ogr2ogr command, label information is text field in PG, but it is always unsuccessful, I always lose the text label information. Those commands are ...
1
vote
0answers
58 views

Avoiding grids when transforming between SRS using ogr2ogr?

I'm trying to use ogr2ogr to transform from NAD27 (EPSG:4267) to WGS84 with my custom "towgs84" Bursa-Wolf parameters. However, I think the ogr2ogr uses grids which are part of the GDAL installation ...
1
vote
0answers
558 views

Insert shp into existing Postgis table with python

I'm creating a Qgis python plugin that allows inserting shp into existing Postgis table, i've tried using ogr2ogr and it's workin when I run the command in FWTools Shell but when I try to run it in ...
1
vote
0answers
57 views

What is causing ogr2ogr to fail to merge shapefiles without a reprojection?

Update 23-04-2018 The main issue has been solved, I (incorrectly) assumed all the files would share the same crs. This isn't the case and zones UTM 13N to 16N are used. So with no target crs for ...
1
vote
0answers
221 views

can you convert multiple shapefiles to a single dxf using ogr2ogr?

I would like to create a dxf from several shapefiles using ogr. The only way I can see to do this would be to create the dxf from one file and then convert the others to the same file using the append ...
1
vote
0answers
322 views

Intersecting two geodatabases with ogr

I am trying to create an intersection between two different layers of two different geodatabases using ogr2ogr, but without success. I have been using the following command line prompt: ogr2ogr.exe ...
1
vote
0answers
1k views

ogr2ogr export to geopackage error

I am trying to export a table from postgres to a geopackage. But I get the following errors with the following command. ogr2ogr -f GPKG /opt/data/ways.gpkg "PG:host=postgres dbname=osm user=postgres ...
1
vote
0answers
50 views

Merging and generalising polygon data with ogr2ogr and SQL

I have some building data that is already generalised to blocks of buildings rather than individual buildings, and I want to create another set of data from it that is generalised again to urban areas....
1
vote
0answers
755 views

Shapefile to GeoJson with Rails

I have a requirement to create a layer on map, Client have provided me only the shape files(.shp). As i am very new to GIS, i was reading about it and found we need to convert the shapefile into ...
1
vote
0answers
261 views

How to merge USGS contour data from files into state?

Long story short, I'm looking to take 1/3 arc-second 1x1 degree contour shapefiles from the USGS National Map Viewer and transform that into a contoured map of a particular state, but am encountering ...
1
vote
0answers
304 views

SQLite error with ogr2ogr

I'm trying to extract centroids from polygons. I have already done it on Linux Fedora, MAC OS-X shell. The result was good. Now I need to run the same command on UBUNTU shell, but it returns the ...
1
vote
0answers
90 views

strange zoom/pan behavior in QGIS on layers extracted from USGS Geopdf topo

Starting with a USGS geopdf topo 7.5 quad, I extracted the layers to a spatialite database using ogr2ogr: ogr2ogr -a_srs "WGS84" -f sqlite fisher.sqlite UT_Fisher_Towers_20170216_TM_geo.pdf I then ...
1
vote
0answers
117 views

The cut vector by changing the parameters using OGR

I have cut_test_puzzle.shp and kontur.shp https://yadi.sk/d/-5c6s9VX3HEwYY layer of the cut_test_puzzle.shp has some intersection with each other, is the zorder on a field that identifies the object ...
1
vote
0answers
664 views

How to use ogr2ogr to only add new features to an existing layer?

It seems like the correct usage is as follows: ogr2ogr -update -append -lco SCHEMA=mySchema -f MSSQLSpatial "MSSQL:server=myServer;database=myDb;trusted_connection=yes;" "myShapeFile.shp" But it is ...
1
vote
0answers
425 views

Convert MIF and MID files into postgis tables

I have tables like this: CREATE TABLE postcode_area_boundaries ( ogc_fid INTEGER, wkb_geometry GEOMETRY(MultiPolygon,3857), postarea VARCHAR(2), area_km DOUBLE PRECISION, area_mi ...
1
vote
0answers
275 views

After osm to pgsql conversion with ogr2ogr, can't add/view tables in qgis?

I'm converting an osm .pbf file to a postgres/PostGIS database with ogr2ogr. I can view the tables in psql, but when I connect to the database in qgis, I can't see any of the tables after connecting ...
1
vote
0answers
137 views

Cannot access CartoDB with OGR

I'm having issues using OGR to interact with tables on my CartoDB account. Initially I was trying to upload data using ogr2ogr: ogr2ogr --config CARTODB_API_KEY abcdefghi -t_srs EPSG:4326 -f CartoDB ...
1
vote
0answers
266 views

ogr2ogr transform failure: "illegal axis orientation combination"

I'm attempting to use ogr2ogr to reproject a MA community boundaries shapefile (available here). Question: what part of the command causes the transformation fail? Is either my code or the source ...
1
vote
0answers
218 views

ogr2ogr ascii --> Shape

I have plenty of Digital Terrain Model (DTM) data in ASCII format as *.txt files. Now I want to convert them into separate ESRI shapefiles as a batch. Does anyone know how I can handle this issue?
1
vote
0answers
552 views

How to convert GeoJSON with mixed and NULL geometries to SQLite?

I am trying to convert a GeoJSON file into SpatiaLite, so I can load it as a SpatiaLite layer into QGIS, as described here. Converting the file in QGIS with "save as.." did not work (see also here), ...
1
vote
0answers
809 views

ogr2ogr StringList to FGDB

I am trying to run ogr2ogr to convert geojson to FGDB, but running into an interesting edge case. In the below example I have a 'tags' field which is a string list. { "type": "FeatureCollection", ...
1
vote
0answers
110 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
97 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
74 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
34 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
36 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
106 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
211 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
605 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
719 views

Crop geotiff with bounding box

In a project using gdal I need to crop a geotiff file with a bounding box in pixel or coordinates epsg:4326. The cropping of large images works fine. The next step is to manage cases where the image ...
1
vote
0answers
291 views

Using osx terminal ogr2ogr to batch convert .json to .kml?

using osx El Capitan terminal This works fine one file at a time to convert .json to .kml ogr2ogr -f "KML" xxx.kml xxx.json I would like to do all files at once I have tried for %f in (*.json) ...
1
vote
0answers
774 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
61 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
184 views

Use ogr2ogr to get KML out of PostGIS

I am trying to export a Postgis database table into KML using ogr2ogr. When I execute this command in terminal (Ubuntu 12) I just get the "documentation" back but no result or error: ogr2ogr -f "KML" ...
1
vote
0answers
348 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
388 views

ogr2ogr losing all ExtendedData attributes of KML

I'm trying to convert a KML to a shapefile using ogr2ogr, but whenever I do, I end up with only blank Name and Description fields on the elements, losing the ExtendedData that is attached in the KML. ...
1
vote
0answers
342 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
351 views

Importing OpenStreetMap historical data with ogr2ogr?

I am trying to import historical OpenStreetMap data obtained here: http://osm.personalwerk.de/full-history-extracts/2014-11-24/continents/ I downloaded the Australia-Oceania file, I am trying to ...
1
vote
0answers
75 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
3answers
202 views

Python: ogr2osm create osm file from WFS

Does anyone know if ogr2osm can use WFS Layer as input source to create a osm file i could not find anything in the documentation expect that it should support all ogr file formats. If so how can I ...
1
vote
0answers
47 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
374 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
151 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
2k 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
1k views

Import .gfs file into PostGIS?

Is it possible to import a .gfs file into PostGIS? I can open the .gfs file in QGis, so I assume it is a geographic file of some kind: but I'm not sure how to get it into PostGIS. I have Googled but ...
1
vote
0answers
108 views

QGIS crashes when trying to display features form MySQL

I import shapefiles into MySQL using the following command: ogr2ogr -f MySQL MySQL:GIS,host=localhost,user=root,password=root /home/user/Public/myshape.shp -nln Shape_table -update -overwrite -lco ...