Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [ogr2ogr]

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

0
votes
0answers
4 views

Suitable Image or container that has ST_MakeValid functionality

I'm looking for an easy to deploy machine image that would allow me to use the ST_MakeValid function. I'm looking to use this in an ogr2ogr call, but can't get a version compiled correctly against ...
2
votes
0answers
32 views

Running gdal ogr2ogr command from python

I have an ogr2ogr command which uploads an ESRI File Geodatabase to a PostgreSQL database, updating/overwriting the existing data: ogr2ogr -f "PostgreSQL" PG:"host=hosting_url port=5432 dbname=...
0
votes
0answers
28 views

Turn a single MultiPolygon into many small Polygons?

I have a large GeoJSON file with a single very complex MultiPolygon, and I would like to turn it into an identical file with many small Polygons. How can I do this? I can use ogr2ogr or mapshaper or ...
0
votes
1answer
56 views

Converting self-intersecting polygons into distinct polygons

How to convert self-intersecting polygons into distinctive, well behaving polygons? My polygon inputs consist of self-intersecting polygons, which fails the st_isvalid test, ie: the below statement ...
0
votes
1answer
35 views

How can I write a zipped shapefile with ogr2ogr and /vsizip/?

After reading a bit of GDAL Virtual File Systems docs, I am trying to write a zipped Shapefile using this gdal command involving the use of /vsizip/: ogr2ogr -f "ESRI Shapefile" /vsizip/test.zip\test....
0
votes
2answers
65 views

QGIS SERVER - convert WFS GetFeature GML as Shapefile with ogr2ogr

I'd like to use ogr2ogr with the WFS driver to convert the GML response of my QGIS Server 3.4.2 GetFeature layer into Shapefile. I have to do this from a WebGIS JavaScript application I am developing, ...
1
vote
1answer
11 views

Keep only one geometry type when clipping polygons to sqlite with ogr2ogr

I have a regular grid of polygons and want to clip them using ogr2ogr. While using sqlite files as destination I stumbled over some wierd behavior: When clipping polygons exactly at their borders, a ...
1
vote
0answers
32 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 ...
0
votes
0answers
30 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 ...
0
votes
1answer
17 views

ogr2ogr polygon to point with point inside the polygon

Can ogr2ogr be used to convert a polygon to a point but the point must remain inside the polygon? It does not matter where the point is as long as it is inside the object polygon.
2
votes
1answer
48 views

dbf to shp within BASH (ogr2ogr would be ideal)

I have a CSV with many points and attributes that I'm trying to convert into a shapefile but I'm having no luck. I have installed gdal-bin and can use my terminal environment to create a shapefile ...
2
votes
1answer
131 views

Using ogr2ogr to convert multiple GML files to a postgis table

I have a folder with 150 .gml (addressbase) files I need to upload to my postGIS/postgres database. After the first gml is uploaded, the rest will be appended to it to form a single table. However I ...
1
vote
0answers
36 views

Import ArcSDE db to Postgres/PostGIS

Is it possible to import an ArcSDE db in PostGIS? I don't have experience with ArcSDE and then I don't have any idea to what is the data exportation format of this software. A customer asked me to ...
1
vote
2answers
216 views

Migrating US Census GDB file to PostGIS — ERROR: tables can have at most 1600 columns

I'm working with data from the U.S. Census. Specifically, I've downloaded gdb files from here. I have the gdb file ACS_2016_5YR_TRACT.gdb on my server and I'm attempting to create a psql table with ...
0
votes
0answers
38 views

ogr2ogr merge fgdb (while importing to PostGIS)

I have millions of records and hundreds of tables in several file geodatabases.. The tables name in these FGDBs are all same but just in different areas. For instance, the Admin table, you see below,...
0
votes
1answer
37 views

ogr2ogr import fails with “ERROR 1: GeoJSON object too complex”

I'm trying to import a large (8.8GB) GeoJSON file to a Postgres 9.6 database with the following command: ogr2ogr -f "PostgreSQL" -nln final_diffs PG:"host=localhost dbname=inspire user=me" diffs....
1
vote
1answer
95 views

Export multiple shapefiles to one DXF file using Python

I'm trying to convert shapefiles into one DXF file using pyqgis, I started with one layer, the problem is that I can't open the DXF file after conversion. I've tried two approaches but still getting ...
1
vote
0answers
24 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 ...
0
votes
0answers
9 views

How not to lose attribute fields when using ogr2ogr to reproject WAsP file

I'm trying to use ogr2ogr to reproject a WAsP (.map file) and keep losing the attribute fields. I have two fields I want to be rewritten to the reprojected file: z_left, z_right Currently the ...
2
votes
1answer
92 views

Unicode encoding problem in ogo2ogr GeoJSON export from PostGIS

I have few tables those have some unicode value of different language. When I am trying to export the data from PostGIS to GeoJSON using ogr2ogr the returned GeoJSON showing wrong unicode language ...
0
votes
1answer
33 views

Batch convertion of .tab files to a single .gml using ogr2ogr

My task is to convert .tab files from a directory (C:\Users\Vadim\Downloads\vec\MapInfo\snp) to a single GML file (snp.gml). I use OSGeo4w Shell. So I wrote a following command: ogr2ogr -f "GML" C:\...
0
votes
0answers
8 views

ogr2ogr loop through feature classes in FGDB except one feature class

I have multiple fgdb and I wanted to merge this to one FGDB and this is the command I used so far find . -path "*/*1*/*.gdb" -o -path "*/*2*/*.gdb" -o -path "*/*3*/*.gdb" \ -o -path "*/*4*/*.gdb" -o -...
1
vote
0answers
19 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 ...
0
votes
1answer
38 views

OGR2OGR Differencing Vector Layer

This is related to the link attached below and in my case, it is not working properly. Can ogr2ogr "reverse clip" (or "clip out" or "erase" or "difference") ...
2
votes
1answer
51 views

Joining CSV file to Shp file using ogr2ogr and python

I am having problems with the code below i.e. parsing the SQL string in python. I keep getting an error. I am joining a CSV file called lookup_scales.csv to a shp file called RC_CATALOGUE_GRANTED. I ...
1
vote
0answers
93 views

How to style KML through LIBKML layer creation options?

I am exporting a layer from PostgreSQL to KML using the sf package in R - though I am also capable of doing it directly with ogr2ogr. I get a workable KML that looks like this. <Placemark> ...
-1
votes
1answer
81 views

Convert esriGeometryPolyline to GeoJSON

I would like to extract the "Existing KinderMorgan Trans Mtn Tar Sands Pipeline" from this ArcGIS REST service and convert it to GeoJSON. Ogrinfo can't read the JSON (it's not standard ESRI JSON): ...
1
vote
0answers
49 views

Importing SHP to MSSQL using OGR2OGR?

I am trying to import a Shapefile which is in EPSG:4326 coordinates to MSSQL Database but its failing. I am following the below command: ogr2ogr -f MSSQLSpatial -overwrite "MSSQL:server=...
0
votes
1answer
56 views

ogrmerge cannot open input files specified as a pattern

I have several geojson files which I am trying to merge using the ogrmerge.py script. For some reason I am getting ERROR: Cannot open *.geojson when I run ogrmerge.py -o merged.geojson *.geojson -f ...
7
votes
1answer
127 views

Using shp2pgsql instead of ogr2ogr to import shapefile to PostGIS? [closed]

I may very well be doing something wrong here, but: If I import some shapefile to a PostGIS database using shp2pgsql, I have to first figure out the SRID/EPSG of that shapefile. I think this is, at ...
2
votes
2answers
73 views

ogr2ogr sql: what is the name of the geometry field?

I have the following ogrinfo -so output about a shapefile: Layer name: PREDEFINED Geometry: Polygon Feature Count: 58075 Extent: (425995.430000, 336399.500000) - (447356.663000, 359782.760000) Layer ...
0
votes
0answers
25 views

ogr2ogr: is it possible to transform to WKT and reproject at the same time?

I would like to use ogr2ogr to transform an input GML to WKT CSV, and from EPSG:27700 to EPSG:4326. This is my command: ogr2ogr -f CSV output.csv input.gml -sql "select id as gmlid, OGR_GEOM_WKT ...
2
votes
0answers
51 views

Serverless geospatial data type conversion (similar to ogr2ogr)

Is it possible to run ogr2ogr or Python/Fiona in a serverless environment where each feature gets processed in parallel and where you don't have to specify the properties of a virtual machine upfront? ...
0
votes
0answers
53 views

Using GDAL to clip data from Oracle Spatial to SHP has unwanted attribute data

I am using GDAL Library ogr2ogr to export data from Oracle Spatial to ShapeFile and also clipping it as per Bounding Box extents. The geometric clipping is working fine, but the output dbf file ...
0
votes
0answers
20 views

Cronjob to load OSM data into PostgreSQL with ogr2ogr fails

I try to load daily updates from OSM into a PostgreSQL database. For this I download daily dumps from Geofabrik and load them into my database using ogr2ogr. My script runs fine when running from ...
2
votes
1answer
66 views

Convert Shapefile from EPSG:5320 to 4326

I am trying to need Electoral District boundary data available at the below-mentioned link to SQL Server. https://www.elections.on.ca/en/voting-in-ontario/electoral-district-shapefiles/open-use-data-...
1
vote
2answers
135 views

Find the extent of a GeoJSON FeatureCollection

How can I get of the extent of all features within a GeoJSON FeatureCollection with Python 3? One extent for all features, not one per feature. The Feature collection includes multiple points ...
-1
votes
1answer
46 views

Why can't I specify a special geomfield using ogr2ogr

my command like this: ogr2ogr -f "GEOJSON" -geomfield "the_geom" /Users/ziwen/work/test/ttt.geojson "PG:host=localhost dbname=g-default user=postgres password=xxxxxx" -sql "select * from data.city" ...
1
vote
1answer
42 views

Error while Importing data from .SHP files to spatialite using OGR2OGR

I was trying to import data from files provided here http://download.geofabrik.de/europe/france.html specifically http://download.geofabrik.de/europe/france/languedoc-roussillon-latest-free.shp.zip ...
0
votes
1answer
58 views

GDAL ogr2ogr OracleSpatial to Shape: Multipolygons with wholes/multiparts are missing

We're holding geodata in an Orcale database (11g) with spatial extension. I want to unload specific polygons and convert them into Shape for further local processing. The table where I'm unloading ...
1
vote
1answer
51 views

ogr2ogr reprojection issues

I have a geodatabase that I would like to convert to shapefile with epsg:4326 projection. For this I use ogr2ogr. However when I reproject, the results are off. They seem to have shifted? Any idea ...
0
votes
0answers
43 views

ogr2ogr missing OSM features

I am wondering why ogr2ogr is dropping certain features when exporting to GeoJSON and how to change this behavior. In the following picture, all the features extracted by ogr2ogr are coded in ...
0
votes
2answers
498 views

Python library for KML to GeoJSON?

I am writing a Python script to reproject a KML file to WGS 84 and then to convert it to a GeoJSON. I am aware of and use the GDAL command line tool ogr2ogr (which was the answer to this question in ...
0
votes
0answers
23 views

Load shapefile in PostgreSQL with intersection rule

I have one segmentation shapefile vector that I would like to load in a PostgreSQL database. However I need to remove the polygons created in background values of landsat image. Since I have a big ...
1
vote
0answers
139 views

Pulling Spatial Data in Geography Format From MS SQL Server 2008 Using ogr2ogr

Can the MSSQLSpatial driver support geography fields queried from MS SQL Server 2008 as spatial data? Background I have been using unixODBC on an Ubuntu 16.04 machine with ODBC Driver 17 for SQL ...
0
votes
1answer
86 views

Import multiple KML files into single table with preserving layer name as (additional) column

I have bunch (1000+) of KML files like this: <Document> <name>Shape 10</name> ... <Placemark> <name></name> <MultiGeometry> ... </...
0
votes
0answers
61 views

ogr2ogr: Transformation from NAD27 to WGS84 not working

I'm trying to use ogr2ogr to transform from NAD27 to WGS84 and check the precision afterwards. For that, I used a GML file with coordinates -124.0, 48.0 It looks like this: { "type": "...
1
vote
0answers
39 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
28 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 ...
6
votes
2answers
657 views

Uploading Geopackage contents to PostgreSQL

As a bit of background, we are looking to transition away from the use of shapefiles. We've already started using Geopackages for desktop work (QGIS / ArcGIS) but often have a requirement to upload ...