Questions tagged [ogr]

The OGR Simple Features Library is a C++ open source library (and commandline tools) providing read (and sometimes write) access to a variety of vector file formats including ESRI Shapefiles, S-57, SDTS, PostGIS, Oracle Spatial, and Mapinfo mid/mif and TAB formats. OGR is a part of the GDAL library

The OGR Simple Features Library is a C++ open source library (and commandline tools) providing read (and sometimes write) access to a variety of vector file formats including ESRI Shapefiles, S-57, SDTS, PostGIS, Oracle Spatial, and Mapinfo mid/mif and TAB formats.

OGR is a part of the GDAL library

212 questions
1
vote
1 answer

Geodjango Import Shapefile with LayerMapping and OGR

I am trying to load a shapefile into Django My folder vnm_polbn_adm3_2014_pdc.dbf vnm_polbn_adm3_2014_pdc.prj vnm_polbn_adm3_2014_pdc.qpj vnm_polbn_adm3_2014_pdc.shp vnm_polbn_adm3_2014_pdc.shx When I'm running…
Simon GIS
  • 1,045
  • 2
  • 18
  • 37
1
vote
0 answers

Invalid srid in postgis when importing data by ogr2ogr

I am using postgis 12 with postgis 3.0.0 and gdal 3.0.0 to copy data in it. The command i am using is ogr2ogr -f "PostgreSQL" PG:"host=127.0.0.1 dbname=db user=user port=5432 password=1" "file.geojson" -nln mutable The issue here is when i check…
Sandeep Kumar
  • 234
  • 5
  • 14
1
vote
0 answers

Code using fiona is failing when trying to dissolve polygons due to different geometries

Using fiona, I am trying to dissolve a layer with hundreds, sometimes thousands, of geometries based on a dissolve field. So, geometries with the same dissolve field value will have a unary union function done to them to keep the geometries the same…
Alec
  • 11
  • 1
1
vote
1 answer

Read GRASS vector datasources in Python using GeoPandas

I am trying to read a GRASS GIS vector layer into a GeoPandas Dataframe. As I was not able to enable the GRASS GIS (read-only) drivers in Fiona see related issue I made a "hackish" method (which works) to read a GRASS GIS vector layer into a…
epifanio
  • 1,228
  • 1
  • 16
  • 26
1
vote
1 answer

How can I cascade union OGR Multipolygons

I have 2 OGR Multipolygons that intersect, hence I want to cascade Union them. I tried this but it returns me empty and doesn't union it. Seems this works only on Polygons and not Mul;tipolygons. What's the best way? >>geom =…
Atihska
  • 4,803
  • 10
  • 56
  • 98
1
vote
0 answers

Load OSM data into PostgreSQL using Python-OGR

I want to load OSM data into PostgreSQL database using Python script. When I am trying this Python script, it doesn't load OSM data into database. Can anyone guide me? I know how to load data in PostgreSQL using osmosis but currently I am looking…
poonam patel
  • 135
  • 13
1
vote
0 answers

ogr2ogr unable to kml

on Centos 6 (vps). I have problem to convert kml to shapefile. [root@vps208386 tmp]# ogr2ogr --version GDAL 2.2.3, released 2017/11/20 To check the ogr2ogr, I had converted a shapefile to kml, and works okay ogr2ogr -f 'kml' output.kml…
Paul Goyes
  • 59
  • 8
1
vote
1 answer

Running GDAL/OGR functions from server on onclick client event

This question comes from my poor understanding of how GDAL/OGR is supposed to work server-side, but before trying it I'd like to know if what I want is feasible with this library. Basically, I am developing a webGIS application where the user should…
umbe1987
  • 2,894
  • 6
  • 35
  • 63
1
vote
0 answers

"gdalconst_wrap" dll missing or unreadable when trying to open a shapefile with GDAL/OGR

I'm having quite the strange issue by trying to use Gdal in C#. Here is my code, using the NuGet of GDAL in Visual Studio : // Launch the Gdal Configuration + loading of drivers before…
Gwynbleidd
  • 11
  • 4
1
vote
2 answers

writeOGR layer creation failed - MySQL

I am trying to load multi polygon boundaries to mysql. Here is what I have tried so far, Installed gdal with mysql driver. Checked with ogrDrivers() in R, it returns MySQL in the list of drivers. db <- 'testdb' user <- 'testuser' pwd <- '****' host…
ds_user
  • 2,139
  • 4
  • 36
  • 71
1
vote
1 answer

ndk-build undefined reference errror

I'm using ndk-build to build a set of shared library(.so) for my android project. I configured and made the source code of C++ library(gdal-2.2.2). everything was ok.("./configure & make & make install" was successful). So i created my jni folder…
Mahdi Nazari Ashani
  • 372
  • 1
  • 5
  • 22
1
vote
1 answer

Reproject XY points of GeoTiff to Lat/Long using GDAL/OGR C++

I'm using the GDAL/OGR API (C++) to reproject XY points into Lat/Long coordinates from a given Tiff. I'm able to achieve it right now, but, the coordenates that i am getting do not correspond to the actual coordinates i am trying to get. I realized…
1
vote
1 answer

Append feature to an existing shapefile

Using python I'm trying to open a shapefile, append a feature and save it. I think it goed wrong in the creation of a feature in a layer cause that function returns 6 (and 0 means no errors I think). My code: # -*- coding: utf-8 -*- from osgeo…
Yorian
  • 2,002
  • 5
  • 34
  • 60
1
vote
1 answer

GDAL CreateFeature doesn't add a Feature to the Layer

I'm running Python 2.7 on Ubuntu 17.10, with osgeo v2.2.1 installed via apt. My code loads osgeo and 1) tries to create a shapefile with 1 layer and 1 field, 2) create a polygon (4 points geometry), then 3) add the polygon to the shapefile's…
Tehem
  • 21
  • 3
1
vote
1 answer

OGRGeometry Intersection

i need intersect 2 OGRGeometry. In my code, i'm defining a OGRPolygon that will be intersected with other OGRGeometry. This my OGRPolygon: OGRLinearRing ring; OGRPolygon poly; ring.addPoint(-300, 300); ring.addPoint(300, 300); …
Zharios
  • 183
  • 1
  • 18