Stack Exchange Network

Stack Exchange network consists of 175 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 [osgeo]

The Open Source Geospatial Foundation (http://www.osgeo.org), or OSGeo, is a not-for-profit organization whose mission is to support and promote the collaborative development of open geospatial technologies and data.

0
votes
1answer
45 views

How to extract FileGDB's domains without ArcGIS?

I'm trying to get an ESRI File Geodatabase domains by using the GDAL\OGR library. By doing so, I wish to edit this datasource using QGIS' Attributes Form with designated value map widgets that point ...
1
vote
1answer
54 views

Open .tiff, set projection, then re-save in Python with GDAL

I am trying to set the projections of a .tiff file from another file with GDAL in Python. I successfully set the projections, but how do I re-save the .tiff afterwards? Here is my code: ds = gdal....
2
votes
2answers
98 views

Check if custom CRS already exists, find EPSG

I created a "custom" CRS with specifications I got from someone who needs the data in that specific system. I worked well and I now have a *.prj file, so basically a WKT-representation of that CRS. ...
0
votes
0answers
48 views

Installing OSGEO and GDAL in Ubuntu

I'm trying to run a Python program which needs to import from osgeo import gdal, ogr import osgeo.ogr, osgeo.osr from osgeo.gdalconst import * But when I run it outputs Traceback (most recent call ...
0
votes
1answer
22 views

Transforming to GPS coordinates using projections with osgeo with Python

I am trying to transform a shapefile and its datum to GPS (EPSG Projection 4326 - WGS 84) but I get very different result on Google Earth, I write: from osgeo import ogr, osr file_name = 'POIS.shp' ...
1
vote
0answers
27 views

QGIS library to OSGEO library codes

is there any way to convert the scripts which is produced in QGIS as python scripts from processing modeler to codes using osgeo library codes? i want some codes that can be used in QGIS algorithm in ...
0
votes
1answer
10 views

Determining Appropriate DBDB-V Subdataset

I am using DBDB-V v6.2 and GDAL, specifically the dbdbv6_level0c.h5 HDF5 file and the GDAL 2.3.3 C# binaries. Using these lines of code I can easily find the full list of Subdatasets used in the ...
0
votes
0answers
70 views

osgeo4mac QGIS 3.4.4 issues with gdal's merge

I'm trying to run the gdal mosaic tool from QGIS3 homebrew osgeo4mac, but when I run it I get this error: 2019-02-11T18:25:17 INFO gdal_merge.py -ot Float32 -of GTiff -o /private/var/folders/...
0
votes
0answers
102 views

MacOS error when installing GDAL in conda: pyopenssl and setuptools dependency

I was trying to install GDAL on MacOS Mojave 10.14.3 using these following methods: conda install -c conda-forge gdal conda install -c conda-forge/label/gcc7 gdal conda install -c conda-forge/label/...
1
vote
1answer
52 views

Resampling two raster files

I have two rasters, one for road network and another one for the DEM of the country. I have to overlay the road network raster on top of DEM raster so as to get the elevation of roads. But my rasters ...
0
votes
2answers
60 views

Opening KML file from ArcGIS server with GDAL?

I am able to open the google KML sample by running: ds = gdal.OpenEx( fn, 0 ) But when using a specific file that I get from my country's database, it doesn't work. I've solved the problem by ...
2
votes
0answers
54 views

Is there a GDAL function similar to OpenCV's WarpPerspective?

I't trying to mosaic a GeoTiff raster against another. Initially, they were both georeferenced in WGS-84 CRS. Using OpenCV, I calculated a homography transformation (a 3x3 projection matrix), that ...
0
votes
1answer
84 views

Install osgeo live package in existing Ubuntu?

I am using Ubuntu. In my secondary computer I use Lubuntu based OSGEO-LIVE 12.0. OSGEO-LIVE is a great software when it comes to any GIS application and reduces tedious work of individual package ...
0
votes
0answers
239 views

gdal.Open error: 'NoneType' object has no attribute 'GetRasterBand'

I am running a python script which calibrates a hydrologic model, this script uses gdal from Osgeo. Following is the command I am giving python: from osgeo import gdal infile="G:\ARORA\vic_inputs\...
3
votes
0answers
53 views

Using a Python IDE with OSGeo

I have the latest version of OSGeo4W64 installed on my Windows machine. I find it very convenient to have all the Python modules for QGIS, GDAL and GRASS all in one place. I would like to set up an ...
2
votes
0answers
55 views

gdal_translate does not crop the GeoTIFF file [closed]

When I use gdal_translate to crop the GeoTiff file, the output file is saving the same as the input file. Nothing changed. The size needs to decrease at the boundaries I specify. What can I do? from ...
0
votes
1answer
1k views

No module named osgeo - continued

I'm having this issue when I try to use the Polygonise(raster to vector) tool in QGIS 3.4.3 (Madeira) on a Mac running Mojave: File "/usr/local/opt/gdal2-python/bin/gdal_polygonize.py", line 36, in &...
2
votes
1answer
1k views

Missing osgeo in QGIS 3.4 Madeira (macOS High Sierra)

I am trying to install QGIS 3.4 on my Mac. When I open QGIS I get a message that osgeo is missing. Couldn't load plugin 'processing' ModuleNotFoundError: No module named 'osgeo' Here are ...
1
vote
1answer
105 views

Can't get dataset from raster map(.tiff) using GDAL on VS2012 C++

Can someone help me regarding this problem? It seem the code can't read the data set of my raster map.It will throw this exception (popup to break or continue). Unhandled exception at ...
0
votes
1answer
985 views

Installing osgeo (“osgeo not found”)

I'm using Win10 (with the bash shell) and one of my python scripts requires gdal/osgeo. I ended up trying multiple install methods (gdal was successful with all of them, but I couldn't use osgeo), ...
0
votes
1answer
63 views

Splitting a Shapefile based off coordinates in Python using osgeo (ogr) or pyshp

I'm having trouble with splitting a shapefile of all the regions in Mongolia into a smaller shapefile based off some input coordinates. The big shapefile I'm trying to split can be found here: https:/...
0
votes
1answer
535 views

QGIS 3 and Python import qgis.core error

I am trying to set up QGIS3 and python so I can write a script that uses GDAL- I want to do this from the OSGEO4W shell. I have read a lot of questions and followed some tutorials which led me to do ...
2
votes
1answer
171 views

Can you draw an actual line instead of a cutline with GDAL?

I'm fairly new to GDAL and I have some GeoTIFF files that I would like to highlight some bodies of water on. I have gotten pretty far, but I have one problem. The only way I am able to highlight a ...
2
votes
0answers
132 views

different results ogr2ogr command line vs osgeo import ogr with reading osm data

I am trying to read in openstreetmap data (osm.pbf) files into python. Initially, I've always used the ogr2ogr command line approach to convert the data I want from the osm.pbf to a shapefile and then ...
1
vote
0answers
173 views

GDAL/OGR Returning wrong reprojected shapefile

I use the script in this link to reproject a shapefile and save it. The target projection is derived from a georeferenced raster. The problem is while the target coordinate system is UTM 33N (epsg: ...
0
votes
2answers
302 views

Extracting coordinates from multipoint geometries?

I found this guide to get pixel value of raster under point: Getting pixel value of GDAL raster under OGR point without NumPy? I've a problem here: for feat in lyr: geom = feat.GetGeometryRef() ...
4
votes
2answers
445 views

pyQGIS 3.0 script not running with processing import

I have problems using version 3 of QGIS with Python 3. I followed different tutorials like this one : how to use pyqgis processing runalg clipvectorsbypolygon But it seems to be working only with ...
0
votes
2answers
3k views

Python 3.6 error import osgeo

I'm trying to install GDAL osgeo lib into Python 3.6 on Debian Stretch I installed neccessary packages like: sudo apt-get update && sudo apt-get install -y \ binutils \ libproj-dev \ ...
1
vote
1answer
234 views

Unable to import shapefile data (both POLYGON and MULTIPOLYGON) to postgis using GDAL osgeo, ogr

I am trying to import shapefile data (polygons with all of the user fields) to postgis using osgeo. My code fails when shapefile contains both POLYGON and MULTIPOLYGON data. from osgeo import ogr, ...
2
votes
2answers
79 views

can't calculate numeric field with ogr python

I have created two functions: one to add a field to a layer and one to calculate a field. I am having issues with the calculate field function when trying to calculate values for a numeric column. I ...
12
votes
6answers
7k views

QGIS 3.0 can't load plugin processing, no module named 'osgeo', on Manjaro Linux

I have installed QGIS3 from the AUR package, as well as all optional dependencies: https://aur.archlinux.org/packages/qgis/ However, when launching, I receive the following error: Couldn't load ...
0
votes
1answer
173 views

Managing multiple Python interpreters (ArcGIS, OSGeo, etc.)

I currently have several Python interpreters installed through ArcGIS, OSGeo and Anaconda. C:/OSGeo4W64/bin/python.exe C:/Python27/ArcGIS10.4/python.exe C:/Users/[UserName]/Anaconda3/python.exe ...
0
votes
1answer
137 views

Invalid field name by using GetFieldAsString from ogr.py [closed]

I use a little algorithm to transform values from an openstreetmap-file into a table (.dbf). I use the function: GetFieldAsString("string") from ogr.py and everything is fine, but when the "string" ...
1
vote
1answer
201 views

OSGeo4W64 to OSGeo4W (32bit) Environ setting issue

I normally use my Python script using OSGeo4W64 command shell on my 64-bit PC (Windows10). Now, I'm trying to use my script on a 32-bit machine (Windows10). In the 32-bit machine, there's an issue ...
3
votes
1answer
526 views

PyQGIS ImportError: DLL load failed:

I'm trying to create a PyQGIS standalone script in windows 10 but I have some errors. First I have read this post and I follow comment of Mr. @caiohamamura but I have semi-success I think, and I don'...
2
votes
1answer
4k views

Got “ImportError: No module named osgeo” in gdal_calc but not in main script [closed]

I could import gdal without any problem in my main Python script with: from osgeo import gdal I could also use gdalwarp, gdal_translate with no issue. But when it comes to gdal_calc, I got the error:...
2
votes
1answer
142 views

.DEM files unsupported with OSGEO?

I've downloaded the .DEM files from the NASA SRTM30 dataset (found here) however trying to open these yields ERROR 4: "E140N90.DEM" is not recognized as a supported file format. This is the the same ...
2
votes
1answer
90 views

osgeo ogr layer fieds - have become invisible

We have e python script, using osgeo, that accesses a PostgreSQL database for GIS data. The script have unexpected stopped working, and I have been able to boil it down to: .GetFieldCount() returns 0, ...
1
vote
1answer
507 views

Saving MultiLineString to Shapefile and KML/KMZ with Python [closed]

What is the fastest way to save MultiLineString to Shapefile (without attributes) and KML/KMZ? Preferred open-source libraries like fiona, shapely etc. from osgeo import ogr multiline = ogr.Geometry(...
0
votes
0answers
1k views

GDAL and JP2: Python3 installation through PIP

I have JP2 files, which I have procured from ESA Sentinel 2 website. I am interested in processing them through GDAL and Python3. I have manageed to install Python3 and GDAL. GDAL was installed ...
4
votes
0answers
694 views

Install OSGeo module in virtualenv

How can you install the osgeo module in a virtualenv? I downloaded QGIS using KyngChaos (www.kyngchaos.com/software/qgis) following https://arset.gsfc.nasa.gov/sites/default/files/land/webinars/...
2
votes
1answer
612 views

GDAL conda install on Mac OS trouble

I'm trying to install gdal on my new computer in the anaconda environment using conda but having issues. All I've done so far is install Anaconda for python 3.6 and install gdal as described here + a ...
0
votes
1answer
654 views

Module has no attribute Warp?

I'm using GDAL v2.14 on my Windows 10 machine. In that environment, I have two gdal python bindings. One is import gdal, the other is import osgeo. I installed Python's gdal using http://www.lfd.uci....
6
votes
2answers
404 views

Overlapping Polygon becoming hole when converting geojson to shapefile

I'm trying to convert a geojson MultiPolygon which contains two overlapping polygons to a shapefile, however I noticed that the resulting shape has a smaller area. Upon inspection it's because the ...
8
votes
1answer
2k views

Crop a raster using rasterio and geopandas

I am cropping a set of historic aerial photographs. These photographs have large black areas in the edges (0 value). However there is also valid data with a 0 value. The workflow I am using is: Load ...
1
vote
5answers
3k views

GDAL/OGR Geometry Type Python

Taking a long shot but does anyone have an idea of whether GDAL or OGR has a function to determine a shapefile or layer geometry type using python? I specifically want the output to print "POINT" for ...
2
votes
1answer
128 views

Line network segment length

I am looking for a way to calculate the segment lengths of a line network. I am probably missing just the right vocabulary to search for the best approach, so I guess asking here would be a good idea. ...
1
vote
1answer
409 views

ogr2ogr add geometry from x y when importing to postgis

Im importing a xlsx with x y coordinates to a postgis database, with the following command: ogr2ogr -overwrite -progress -nln data -nlt POINT -f PostgreSQL "PG:host=Localhost user=postgres password=...
2
votes
1answer
433 views

Dissolve ogr geometries in Python [closed]

I parse a geoJson file resulting in a list of osgeo.ogr.geometry-classes (all Polygons). I also have a new one which I want to dissolve with the rest. I'm using the ogr package in python, it does ...
1
vote
0answers
75 views

NITF Metadata not displaying properly in OSGeo Shell. Works in FWTools

I'm using gdalinfo in the OSGeo Shell to display information on a directory of NITF's. For the majority of the NITF's, gdalinfo is saying the all the corner coordinates are 0, which is incorrect. ...