Questions tagged [ogr]

The OGR Simple Features Library is a C++ open source library (and command line tools) providing access to vector file formats.

Filter by
Sorted by
Tagged with
1 vote
0 answers
47 views

How to combine ODA File Converter with OGR (GDAL) so that dwg is a format option

I have downloaded ogr/gdal with QGIS 3.34.1 and I have downloaded the ODA file converter from https://www.opendesign.com/guestfiles/oda_file_converter However, I am not sure how to combine the two so ...
guest_231213's user avatar
1 vote
1 answer
23 views

How to assign a layer to a group in GDB datasets using gdal python

I'm currently working with ESRI GDB datasets and I can easily open hierarchical geodatabases and walk the tree using the API that gdal provides. root_group = ds.GetRootGroup() for g in root_group....
Alireza S.N's user avatar
0 votes
1 answer
28 views

ogr2ogr -where: match features from OSM PBF with unset "seasonal" field

I have an .osm.pbf file from Geofabrik and want to extract all lakes that are not seasonal or intermittent to an SHP file, using ogr2ogr. I am currently using the following command: ogr2ogr -where &...
TheEagle's user avatar
  • 115
1 vote
1 answer
65 views

GDAL add custom fields to GPX files using the command line (batch)

Using the GDAL/OGR command line, how could one add some fields to a GPX file ? I simply need to add the gpx filename to its content, e.g. in a new field called datasource in each (there are several ...
swiss_knight's user avatar
  • 10.2k
0 votes
0 answers
19 views

Ogr AddPointZM does not work. Cannot create any geometry with ZM values

I am trying to create LineStringZM using ogr java bindings. My code is below: private Geometry prepareLineString(Layer ly) { var result = new Geometry(ogr.wkbLineStringZM); for (int i = 0; i ...
Michael's user avatar
1 vote
0 answers
50 views

How to extract layers from a mpkx file?

I would like to use the World Terrestrial Ecosystems data published by the USGS. It is made available in the form of a compressed file in the mpkx format. I expect this file to contain one or more ...
Luís de Sousa's user avatar
0 votes
0 answers
31 views

Exporting records with more than 250 characters in a field to GML

I am trying to export OSM vectors to the GML format like: v.out.ogr input=network output=network.gml format=GML I get an error that the field a_other_tags has more than 250 characters: ERROR 1: ...
Jeshua Lacock's user avatar
1 vote
0 answers
44 views

OGR_STYLE label style line breaks

I am trying to create a GeoSpatial PDF using gdal_translate. Using the vrt file i am able to generate OGRFeatures having STYLE OGRFeature():23 OGR_STYLE (String) = SYMBOL(id:"icn_cabinet_external....
Mandeep's user avatar
  • 11
0 votes
0 answers
113 views

Read KML file with GDAL/OGR and access all its attributes

I have a KML file and I'm trying to access a specific attribute named "styleUrl". A feature of this KML looks like this: <Placemark> <name/> <styleUrl>BoundaryStyle</...
Jérémy OLIVIER's user avatar
0 votes
0 answers
37 views

Python OGR error when intesecting line by polygon

When I try to find the intersection of a line gdb layer with a polygon layer I get the following error: Can only insert a LineString/MultiLineString/CircularString/CompoundCurve/MultiCurve in a ...
Robert Thomas Almodovar's user avatar
1 vote
1 answer
59 views

Does GDAL have an error with calling multiple functions on the same line of code?

I typed this code on Python interpreter but the Python shell restart on the last line: from osgeo import ogr shp_ds = ogr.Open(r'C:/Users/admin/countries.shp') lyr = shp_ds.GetLayer(0) #python shell ...
Duststar's user avatar
0 votes
1 answer
104 views

Python OGR: NoneType Error only when writing to OpenFileGDB, reading works fine

I have a peculiar situation when trying to write to a .gdb using OGR. I get a NoneType error following any OGR function after ogr.Open() when I specify the data source as writable. From previous ...
Airv's user avatar
  • 3
1 vote
1 answer
171 views

Converting DXF to shapefile with custom attributes (color)

I am trying to convert .dxf to .shp with passing color attribute to entities in .shp. When using ogrinfo -al test.dxf I can see colors for line and text features: OGRFeature(entities):13 Layer (...
desese's user avatar
  • 11
0 votes
2 answers
203 views

ogr2ogr cannot open datasource ogrinfo can open

I've got a random .osm.pbf from Geofabrik which I'm trying to extract a small region of: $ ogr2ogr -f OSM -spat 7 48 8 49 data/osm/extract.osm.pbf data/osm/germany-latest.osm.pbf ERROR 1: OSM driver ...
TheEagle's user avatar
  • 115
0 votes
0 answers
26 views

Setting CRS in Python 3 / tkinter

I've written some code to create a GUI which creates and then converts .CSV to .SHP. I'm mostly done however, I've made a mistake in the way I want to select CRS (using a drop down list), the code ...
LiMoNiZeR's user avatar
1 vote
1 answer
212 views

In QGIS Georeferencer: Mysterious OGR Driver Error: not found OGR

I have been georeferencing Vector files (gpkg and shp) in the new Georeferencer in QGIS 3.30.1. The files are pretty large, have multiple million features and a size of roughly 2-3gb. I have ...
David SSS's user avatar
0 votes
2 answers
120 views

Exporting polygon as DXF using PyQGIS

I am working on a script to export my dissolved polygon into Dxf but I get an error. Could somebody teach me how to do this? Here is my code: from qgis import processing from datetime import datetime, ...
PyCher's user avatar
  • 171
2 votes
1 answer
170 views

WFS in PostGIS OGR FDW results in "ERROR 1: No schema information loaded."

I am trying to add the WFS data of a german state to PostGIS using the PostgreSQL OGR Foreign Data Wrapper: CREATE SERVER server_mv FOREIGN DATA WRAPPER ogr_fdw OPTIONS ( datasource 'WFS:https://www....
bugmenot123's user avatar
  • 10.8k
0 votes
0 answers
79 views

Working with NHDPlus data in GDB file format using GeoPandas

I am trying to work with the NHDPlus High Resolution dataset from the USGS. Looking at the documentation, there should be all sorts of data table available as well as mapping layers but the only thing ...
Wesley Young's user avatar
2 votes
2 answers
351 views

How to extract geometries with M-values from a feature layer in Python?

Problem statement I am aware that geopandas (due to the limitations of shapely and pygeos) does not read geometries with M-values - when reading a layer that has them, geopandas now just drops those ...
Felipe D.'s user avatar
  • 2,411
0 votes
0 answers
57 views

writeAsVectorFormatV3 on MacOS with filename on server returns OGR error

I am on MacOS and working with Samba connected server. I have write rights on it but when I try to export a QgsVectorLayer from a delimited text file with : layer = QgsVectorLayer("file:///path/...
dmjf08's user avatar
  • 1,263
2 votes
0 answers
248 views

How to create Block References in dxf files using GDAL?

I need to use GDAL to create dxf files in AutoCAD. I have already implemented the creation of point-line geometry layers and label layers, but now the creation of Block References keeps failing. In ...
DXnima's user avatar
  • 21
0 votes
1 answer
78 views

Ogr2Ogr appending duplicate records (2X Times) to PostgreSQL Table

I'm synchronizing data from AmigoCloud's table with a PostgreSQL table. I'm using GDAL's ogr2ogr module in osgeo environment. The command I'm running is as follows: ogr2ogr -append -f PostgreSQL PG:&...
RMT's user avatar
  • 39
1 vote
0 answers
49 views

Using Python OGR to reproject SQL Spatial Data

I currently have a heap of GDAL scripts that reproject from one SQL feature class into a new SQL feature class, but I want to convert these into Python scripts using the GDAL library, to clean up my ...
Joshua J Geoghegan's user avatar
2 votes
1 answer
58 views

ogrinfo / ogr2ogr : sql values with accents

I'm trying to access data that is stored in a MSSQL spatial database and it seems to me that OGR is having some problems with accents. I'm not sure if maybe there is an encoding parameter or something ...
mikibok's user avatar
  • 47
0 votes
0 answers
59 views

Create shapefiles with GDAL and Android studio Warning error on shapefiles created in projection WGS_1984_UTM_Zone_18S

This is my method that creates the shapefile, but the file gets a warning when opened in ArcMap: The added layers have an extension that is not consistent with the associated spatial reference ...
Liber Peña Panduro's user avatar
0 votes
0 answers
21 views

Attribute fields exporting as org_name, I want it to stay as the original field name

I am exporting a QGIS map as a gpx file, and some of the attribute table fields I have added are turning into ogr_name or ogr_length etc. I need it to stay as the regular field name as I have to ...
Cas's user avatar
  • 1
1 vote
0 answers
158 views

Create DXF file with ogr2ogr, that is visualized in AutoCAD

with ogr2ogr I try to create a DXF file, that is labeled and visualized in AutoCAD directly. What I did to visualize point objects: ogr2ogr --config GDAL_DATA "X:\OSGeo4W64\share\gdal" -f &...
Kai Behncke's user avatar
0 votes
0 answers
168 views

When ogr2ogr hits rasters in a file geodatabase

I would like to use ogr2ogr.py to batch convert feature classes and tables in a collection of ESRI file geodatabases into geopackages, but some of these gdbs have rasters in them, apparently in SDE ...
Evan Thoms's user avatar
0 votes
1 answer
162 views

Incorrect coordinate translation using GDAL.NET compared to gdaltransform and epsg.io

I am working on a project to convert between one coordinate system, provided by an EPSG code, and EPSG:4326 or EPSG:4979 (WGS84 CS to include heights above ellipsoid). Testing the following ...
TJames's user avatar
  • 29
0 votes
0 answers
590 views

GeoPandas fails silently when reading GeoJSONs

I have a file example.geojson. This file has 68 features (jq '.features | length' example.geojson returns 68). If I try to load this file to a GeoPandas dataframe (gpd.read_file docs), I can choose ...
zabop's user avatar
  • 1,812
0 votes
0 answers
28 views

Intersection between shapefiles using gdal [duplicate]

From three .tif files I got the relative associated .shp files through gdaltindex. Now, I'd like to create a new .shp file given by the intersection of the three shp. files previously obtained. How ...
Salvo's user avatar
  • 31
2 votes
0 answers
47 views

Is any GIS processing in Python bound to be single threaded due to the GIL?

I'm processing a really complex geometry using Python and ogr, which is taking forever to compute. Looking at the CPU usage, I've noticed that it never exceeds 100% (more than 100% signals that the ...
Francesco Ghizzo's user avatar
0 votes
1 answer
108 views

Install and run GDBee file geodatabase SQL tool

GDBee is a Python tool for querying file geodatabases using SQL (outside of ArcGIS): https://github.com/AlexArcPy/GDBee I want to install and run GDBee in Windows 10 (64-bit). As a novice, here's what ...
User1974's user avatar
  • 1,122
2 votes
1 answer
105 views

Working with CIRCULARSTRING in OGR's sqlite dialect

ogrinfo ":memory:" -dialect sqlite -sql "SELECT ST_GeomFromText('Point(1 2)')" gives me a dataset with a geometry column: INFO: Open of `:memory:' using driver `SQLite' ...
bugmenot123's user avatar
  • 10.8k
0 votes
1 answer
166 views

Export shapefile to MapInfo file using Python OGR

I'm trying to save/copy a shapefile to a .tab format with Python OGR. Every attempts give me the following error: RuntimeError: CreateFeature() failed: cannot re-write already existing feature 1 ...
Yann 's user avatar
  • 11
1 vote
0 answers
31 views

Converting OGR layer into GeoPandas [duplicate]

I have a huge Geopackage (20 GB), and I want to read in a small subset without overloading my memory. I've figured out how to do this using the Geopackage's Rtree: # Point to huge Geopackage gpkg = ...
Andrew Plowright's user avatar
0 votes
1 answer
114 views

Convert a layer from WGS 84 to WGS 84 / Pseudo-Mercator during GRASS import

I have a bash script that does the following: export PATH=$PATH:/usr/local/grass/bin GRASSDATA=/output/grassdata && \ MAPSET=PERMANENT && \ MAP=outputAmtrakMap && \ rm -rf $...
Mayor of the Plattenbaus's user avatar
1 vote
1 answer
90 views

v.in.ogr does not provide any error information

I am using the mundialis/grass-py3-pdal:8.2.0-alpine docker image to run GRASS. I run the following from the bash command line (inside the container): /usr/local/grass/bin/v.in.ogr input=/path/to/...
Mayor of the Plattenbaus's user avatar
1 vote
0 answers
235 views

QGIS 3.22.11: Cannot save vector layer after modifications (OGR error, non-finite values)

I have a (self-created) shapefile and add e.g. another polygon to the file (or delete a vertex or any other modification) then try to save the file and finish editing, and this message comes: Could ...
AlexaPl's user avatar
  • 11
1 vote
0 answers
51 views

Looking for proper GIS terminology - polygon with a cut in it

(QGIS,GDAL/OGR) I have a polygon produced by contouring that has a small short overlapping line segment. I am wondering if there is a proper GIS term for this and whether there is an automated method ...
Brendan's user avatar
  • 83
1 vote
0 answers
330 views

Convert a single point (lat, long) to raster-projection from a tiff file, and finding the nearest pixel

I have a TIFF file and a list of coordinates, of which I'd like to get the information from the TIFF file for each coordinate. I'm quite new to working with geodata, but after a bit of searching I ...
Ablu_68's user avatar
  • 11
1 vote
1 answer
459 views

Using GDAL/OGR to remove a specific layer from a geopackage

Is there any way to remove some layers from geopackage instead of creating new geopackage with only layers I need. Example:- I have a geopackage containing: Bars (Point) Bars_reprojected (Point) ...
Mahmoud Soliman's user avatar
1 vote
2 answers
765 views

Loading a ogr data object into a geodataframe

I have been experimenting with ways to work with large datasets in python and I started using ogr method of loading a layer with an sql query to speed up data access as oppose to loading the entire ...
MrKingsley's user avatar
  • 1,443
1 vote
1 answer
210 views

OGR Python API FlatGeobuf edits are not persisted

I'm using GDAL 3.5.1 OGR's Python bindings (on MacOS) to create features within a FlatGeobuf file but my changes are not being persisted. Relevant Code: data_path = "/Users/user/data/trails.fgb&...
tomfumb's user avatar
  • 3,678
0 votes
1 answer
197 views

ogr2ogr auto conversion of text to date type

I have a question regarding ogr2ogr's auto-conversion of text fields to date fields, specifically in the case of additional text following the date. input.geojson file: { "type": &...
Wulan's user avatar
  • 9
1 vote
2 answers
78 views

GDAL Script Failing since GDA2020 Shift - unable to find EPSG 7855

I have a series of ogr2ogr scripts that run daily on our Intramaps server. Since shifting our GIS data to GDA2020 I notice these scripts fail with ERROR 6: EPSG PCS/GCS code 7855 not found in EPSG ...
Josh's user avatar
  • 313
0 votes
1 answer
165 views

How to commit in batches using OGR in Python

When working with OGR in Python you have to set your target_layer and target_datasource to None in order to commit the features to the database. But I'm handling a large dataset of 2,7 million records....
botenvouwer's user avatar
0 votes
0 answers
250 views

GDAL OGR OCI driver takes unreasonable long time to load from oracle database

For quite some time I'm trying to get OCI to work with GDAL. I created a docker image with the driver installed and I use the python api to do the work. When I try to load and print just 20000 records ...
botenvouwer's user avatar
1 vote
1 answer
211 views

What could go wrong when merging multiple GeoJSONs?

Attempt I - ogrmerge I have a few GeoJSONs in a directory called jordsmonnfiles. I want to get one GeoJSON file with the features from the files matching the pattern jordsmonnfiles/jordsmonn_*JK1....
zabop's user avatar
  • 1,812

1
2 3 4 5
22