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 [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
0answers
23 views

Why coordinate metric is not saved correctly GDAL?

I am trying to export a numpy array to GeoTIFF format with GDAL. The exportation seems to work correctly expect for coordinates. When I open the file with QGIS and I move the cursor on the image, ...
0
votes
0answers
12 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
31 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
44 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
39 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
20 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
39 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
37 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\...
2
votes
0answers
25 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
25 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
69 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 &...
0
votes
1answer
229 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
48 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
513 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
36 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
287 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
104 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
84 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
137 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
0answers
240 views

AttributeError: module '_gdal' has no attribute 'ptrcreate'

I have already imported module 'gdal' and it works well, but when I try to run the code as is shown below, there will be error: 'AttributeError: module '_gdal' has no attribute 'ptrcreate'. import ...
0
votes
2answers
106 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
276 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
2k 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
146 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
76 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 ...
9
votes
6answers
6k 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
144 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
109 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
147 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
399 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
117 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
80 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
452 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
662 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
554 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
567 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
326 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
4answers
2k 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
122 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
337 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
391 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
57 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. ...
3
votes
0answers
138 views

GDALINFO not displaying what is in .TFW file

I'm trying to alter the metadata in a Geotiff header via a .tfw file. When I change Pixel Size in the .tfw file, that is reflected in GDALINFO how I would expect. However, when I change the Origin ...
3
votes
1answer
273 views

Use Python binding of osgeo - Union two linestring layers into one

I am using the Python GDAL/OGR bindings. I have two linestring shapefile layers. They are the census TIGER streets and a new set of line segments that represent lines connecting census block ...
3
votes
2answers
1k views

Reading a shapefile as an array using Python?

I am trying to read a shapefile as an array with Python but I keep getting the same error: Warning 1: Failed to find field ID on layer shapefile_maido_tipe, skipping. ERROR 4: `temp.tif' not ...
2
votes
2answers
6k views

Installing Python-GDAL with OSGEO?

I have been trying to install python gdal with OSGEO for some time now with no success. I have removed. I have tried with "Express and Advance" as suggested by OSGEO4W site. The error is always "No ...
3
votes
1answer
762 views

QGIS 2.18 Couldn't Load QGIS Utils

I ran into an issue and had to reinstall QGIS 2.18, but I can't seem to get it to properly work though. Whenever I install it it says "QGIS 2.18 is already installed on your computer..." even though I ...