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.

Filter by
Sorted by
Tagged with
1
vote
1answer
54 views

Reconstruct full coordinate reference system stored in a GML file

I have been able to parse a GML file and fetch the polygons I wanted. They can be plotted ok when plotted on their own. I have them stored in a GeoPandas data frame, but I am struggling to set the ...
1
vote
3answers
51 views

Calculating proportion of area that is land within bounding box using Python [duplicate]

I am trying to find the proportion of land in an area specified within a bounding box (in python). The bounding box is given by min/max latitude & longitude coordinates. The initial solution I ...
0
votes
0answers
41 views

Understanding difference between osgeo4mac libraries and basic libraries (PROJ, GDAL, etc)

Is there a meaningful difference between osgeo-gdal and gdal that would make me choose the osgeo version over the basic version? The context here is that I'm trying to install grass on my mac (...
0
votes
1answer
24 views

Geometry geografic transformation with OGR, OSR - UTM to Degree

I am trying make a geotransformation from UTM coordinates to decimal degree coordinates, but i have only zeros as result... I must be missing something, i already take a lock on other users codes but ...
1
vote
1answer
17 views

ogr export gdb to PostGIS doesn't contain geometry for display in GIS [closed]

I'm currently trying to export a .gdb containing polygons to PostGIS which other users will need to display using any software like QGis or ArcGIS. I'm using ogr fom osgeo to export the GDB to PostGIS ...
2
votes
0answers
90 views

Adding support to FileGDB driver when fiona/gdal/osgeo were installed through Anaconda

Is there a way to tweak the fiona/gdal/osgeo packages installed through Anaconda so that they can be used to read/write GDB files using the ESRI FileGDB driver? I have found multiple answers online, ...
1
vote
0answers
21 views

GDAL - Command Line vs. Spyder (Python) Functionality

I am trying to retrieve information from a GeoTiff using the GDAL API in Python (Spyder). Within Anaconda I have my base environment which contains gdal v2.3.3, but I also created a virtual ...
2
votes
2answers
89 views

Setting Config Options for GDAL using Python

I am attempting to invoke the "SetConfigOption" function using the GDAL API to tweak GDAL's default settings to get additional information about GeoTiff. I am specifying the Config Options ...
1
vote
0answers
37 views

ImportError: No module named osgeo

I'm running a .bat script (included) in the cmd prompt. I get the error "ImportError: No module named osgeo" when it tries to call the gdal_merge.py command. I think this has something to do ...
1
vote
1answer
630 views

Cannot convert float Nan to integer with raster data

I have a script that basically takes a low resolution raster grid and creates elevation band text file for this raster based on a high resolution DEM. The data can be accessed from here. On Conda ...
0
votes
2answers
879 views

ModuleNotFoundError: No module named '_gdal'

I am using Python 3.6 and still having this problem,, although I have tried to uninstall both numpy and GDAL and installed them again in the order numpy then GDAL I am using Windows 10. This was my ...
1
vote
1answer
94 views

Unable to replicate GDAL output

I have a set of GRIB files that are fliped (longitude spans from 0 to 365), and I am using gdal to first transform the data to GeoTIFF, and then warp the gridded data to a standard WGS84 longitude (-...
1
vote
2answers
299 views

QGIS 3.10 not recognising projection information from raster created using GDAL

Problem QGIS 3.10 only partly reads projection information from raster file however QGIS 3.4 correctly reads information from same raster file. I thought I had an issue creating the raster – I may ...
0
votes
0answers
19 views

When merging two TIFF files, take the maximum value

When merging 2 TIFF files, if a common area is found (they overlap each other), put the maximum value of 2 TIFFs in this area. I use gdal_merge: merge_command = ["python3", full_file_path(os.path....
0
votes
2answers
170 views

Python: cfitsio library not loaded when importing OSGeo library or using GDAL on Mac

I am trying to use the OSGeo library and GDAL Python bindings in a script for Python 3.7.7 on MacOS 10.15.4 Catalina. However, when I try to compile the script, I receive the following error as soon ...
0
votes
0answers
141 views

Using gdal2tiles on mac

I'd really appreciate some guidance with this. I need to create some map illustrated tiles to use in leaflet.js for a small web-app I'm building. So far though I've lost about five days to installing ...
0
votes
0answers
15 views

How can I understand the GDAL reprojecting process script?

I'm working with dataset reprojection using GDAL, specifically with netCDF files from GOES-16. The procedure consists of enter with that file in a script Python to transform the spherical view into ...
0
votes
0answers
41 views

Set GDAL version used by virtual enviroment in python

How can I make Python 3.6.9 point to a specific version of GDAL (2.1.3 instead of 2.4.1)? I'm working in a jupyter notebook, in a virtual environment in an Ubuntu machine. Trying to import osgeo I ...
1
vote
1answer
60 views

OGR/OSR Lon Lat convention

When I project (lon,lat) coordinates I get a different result depending on the version of OGR/OSR. osgeo.version_info sys.version_info(major=3, minor=6, micro=9, releaselevel='final', serial=0) ...
1
vote
2answers
267 views

How can I create contours from GeoTIFF and Python (GDAL, Rasterio, etc?) into shapefile with prj file

I'm using a few reference StackExchange/Overflow posts here - and manual, but not coming up with what I'm after. I have a GeoTIFF that I'm importing, and I need to develop out contours at regular ...
1
vote
0answers
46 views

Making a QGIS plugin public for users

I created a Python plugin in QGIS and I want to make it public, so that any user could download and use it I serached in https://plugins.qgis.org/plugins/ , but to upload the plugin , I have to have ...
1
vote
0answers
75 views

Are there any ways to composite Sentinel-2 bands with python?

Sentinel-2 satellite bands have different spacial resolutions, so how can I composite bands of satellite image in python (instead of gdal_merge script)? I tried to stack them by numpy, write each ...
2
votes
1answer
492 views

Read GML using Java

I have a use case on reading and extracting data from GML (Geography Markup Language) using Java. There is a sample file in GitHub by clicking here. The imported packages in Java were as follows ...
2
votes
0answers
62 views

Why do I get value of GDAL GetMaximum() different than that of numpy array max() for same image band?

Here is a code snippet from osgeo import gdal import numpy file = gdal.Open('DEMO.TIF') band = file.GetRasterBand(1) max = band.GetMaximum() if not min or not max: (min,max) = band....
4
votes
0answers
38 views

Python osgeo/OGR not returning all features in PBF

I have a PBF file that is a limited export of the Nepal area. I'm trying to pull out all the adminstrative boundaries. If I use osmconvert to turn my PBF file into a OSM file, sure enough I see the ...
5
votes
1answer
186 views

Transforming lat/lon coordinates into an undescribed DATUM from NOAA .grib2 files

I seem to be having issues with converting coordinates. I'm currently working in Python v3.7 osgeo (ogr, osr, gdal) I want to find specific values (like temperature, wind, humidity) based on input ...
3
votes
0answers
573 views

OSError - cannot import geopandas

While trying to import geopandas error occurs: Exception has occurred: OSError Could not find lib geos_c.dll or load any of its variants []. I downloaded GDAL and fiona for Python 3.7 from this ...
0
votes
1answer
394 views

Resample raster from one resolution to another with GDAL Python API

i have some trouble warping one raster to different resolution. My input is a one channel tiff with. I know the geo-coordinates of x_min and y_max. I also know that the pixel resolution is 5 meters. I ...
0
votes
2answers
341 views

Transforming raster with gdal.Warp

I am trying to transform a raster with gdal.Warp in my own python script. Example: In the src raster one pixel presents 5 meters and I am trying to transform it where one pixel would present 6,5 ...
6
votes
1answer
518 views

Differences between OSGEO GDAL and GDAL python bindings?

Question I'm trying to figure what are the differences, and of course, what is the best solution to use, between two python3 bindings: GDAL, imported as import gdal OSGEO.GDAL, imported as ...
2
votes
0answers
35 views

Reprojecting a shapefile Error

I am trying to write a function to reproject a vector file , by taking the original shapefile as input and giving out the name of the reprojected layer . Though when I call this function I get an ...
0
votes
2answers
41 views

Create vector .shp file and draw several lines with various attributes (L, Z, S%, etc) from coordinates pairs

I have a set or coordinates which forms lines from two points (p1-p2, p2-p3,...., p(n-1)-p(n)), I want to create a SHP file in order to draw several lines from these points, which have several ...
0
votes
0answers
97 views

Open .asc file inside .tgz.tar archive without decompressing with Python and GDAL

I am trying to open an .asc file inside a .tgz.tar archive with Python and osgeo.gdal. Here is the link to the official description that this is possible by using /vsitar/ #source file name ...
2
votes
0answers
36 views

GDAL osgeo for python treating Z dimension differently

I have a space defined by a polyhedral surface, and I would like to check if a point is inside this space, and I would like to do this in python with gdal. After trying the default installation of ...
1
vote
1answer
101 views

GDAL module in python error

I have some troubles with GDAL module on Python. When I try to import gdal, console displays this: Файл "c:/rstp/Lib/site-packages/osgeo/__init__.py", строка 48, из <module> __version__ = ...
4
votes
1answer
114 views

Docker container for OSGeo [closed]

Has anyone developed a docker container for OSGeo? Currently, the bootable image can be downloaded from here. It is set up to run in a virtual machine such as Virtual Box, but I am looking to run it ...
2
votes
1answer
800 views

installing gdal from osgeo to work with GeoTIFF

I just installed Anaconda Navigator (and nothing else) in Windows and want to be able to work with GeoTIFF files in Spider (Python 3.7). It is my understanding that Navigator can search for packages ...
1
vote
0answers
90 views

Plotting CDF of the values in a raster (.tif) file, using Python or QGIS?

I have a tiff file with some values and I want to read those values and plot a CDF (Cumulative Distribution Function). So far I only know how to get the mean value from osgeo import gdal gtif = gdal....
1
vote
1answer
714 views

Cutting a portion of a satellite image based on coordinates in GDAL?

I have a satellite image of 7-channels (Basically I have seven .tif files, one for each band). And I have a .csv file with coordinates of points-of-interest that are in the region shot by the ...
0
votes
1answer
937 views

No module named 'osgeo' after installing GDAL on Mac

I installed GDAL on Mac and it was successful because when I type in the terminal : gdalinfo --version it renders me the right version. The issue is when I switch to Pycharm or the default IDLE of ...
0
votes
1answer
603 views

GDAL polygonize only particular values

I want to polygonize .tiff raster file for specific values. For example, using one method I firstly reclassified the raster by gdal_calc.py --calc="A*logical_and(A>0,A<1)" then used gdal....
1
vote
2answers
349 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 ...
2
votes
1answer
696 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
233 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. It worked well and I now have a *.prj file, so basically a WKT-representation of that CRS. ...
1
vote
0answers
1k 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 ...
1
vote
1answer
54 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
31 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
30 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
169 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/...
1
vote
1answer
96 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 ...