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
21 views

GeoRefrencing in Gdal using x,y of four Corners

I have co-ordinates of all four corners of a raster and i want to Georefrence the raster using those co-ordinates, I can specify the following in SetGeoTransform # (uperleftx, scalex, skewx, ...
1
vote
1answer
31 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
0answers
64 views

How do I get iPython to run on QGIS?

IPython won't run on QGIS (3.2.2 Bonn) I looked at this answer, but it still doesn't work for me. I am fairly new to Python, so don't really know what I am doing. After installing the plugin and ...
0
votes
1answer
217 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
30 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
199 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
72 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
68 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
128 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
227 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
73 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
188 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
1k 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
107 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
71 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 ...
8
votes
6answers
5k 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
136 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
87 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
114 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
352 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
3k 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
108 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
70 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
420 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
939 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
639 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
496 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
517 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
295 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
1k 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
117 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
301 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
362 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
48 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
123 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
256 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
4k 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
738 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 ...
9
votes
2answers
11k views

No module named 'osgeo'

I have installed GDAL and checked on the command line, it is working and when I run the gdal2tiles.py on the command line it works but when I run the same file gdal2tiles.py with python IDLE, I get "...
-3
votes
1answer
1k views

Plot a surface with a DEM and mplot3d [closed]

I want to plot a surface on Python with a DEM that I made on QGIS. I found 2 posts on this topic which were published by the same person: GIS Stackexchange: on this post they show us how to obtain a ...
2
votes
1answer
1k views

Running script over every file in folder using GDAL in Python?

I'm using GDAL to calculate NDVI mean and max and to find other information about .tif Landsat images acquired from Earth Explorer. I stacked the bands into a single .tif image and have a working ...
0
votes
2answers
2k views

Why does my script return 'NoneType'?

I have this script and It return me some problem that I didn't find. from osgeo import ogr import os class checkVectorMCV: def __init__(self, vector_path): self.vector_path = os.path....
1
vote
0answers
220 views

GDAL Open error in C#

I want to open a csv raster data file with GDAL in C# Dataset csvFile = Gdal.Open(fileLocation, Access.GA_ReadOnly); Produce an error saying that At line 4, X is 412267, where as 412555 was ...
1
vote
0answers
100 views

Problem importing qgis.core inside docker container

I'm trying to use QGIS libraries in docker container. When I try import qgis.core I get this error, really I can't figure out what is the cause. Traceback (most recent call last): File "<stdin&...
2
votes
1answer
515 views

How to save json returned by gdalinfo in python variable

When I run the command in osgeo4W shell gdalinfo -json C:\Users\Gurminder\Documents\Git\Dump\s1a-ew-grd-hh-20160725t043517-20160725t043617-012300-01322b-001.tiff I get a large json of my Ground ...
1
vote
0answers
54 views

SPOT 1 HRV Atmospheric correction in GRASS GIS 7 returns NULL values

I'm having trouble using i.atcorr in GRASS 7. I am using 3-band SPOT 1 HRV image (Green, Red, NIR bands). Performed the i.atcorr for each band using the 6S parameters below (last parameter changed ...
1
vote
1answer
1k views

Clipping GeoTIFF file by GeoJSON?

Input GeoJSON file: { "type": "Feature", "properties": { "id": 1 }, "geometry": { "type": "Multipolygon", "coordinates": [[[ [27.397511483867362, 44.161117466010516], [...
5
votes
1answer
2k views

GDAL Python cut geotiff image

I was stuck for 2 or 3 days. I have read many lectures from RS/GIS Laboratory of Utah State University. Also I read «Python Geospatial Development» book and many docs from gdal.org. So, my problem ...