Questions tagged [gdal]

GDAL (Geospatial Data Abstraction Library) is an open source translator library & set of command-line utilities for processing raster spatial data formats. As a library, it presents a single abstract data model to the calling application for all supported formats. It also comes with a variety of useful commandline utilities for data translation and processing.

Filter by
Sorted by
Tagged with
-1
votes
0answers
16 views

How should I use a conda-forge environment? [on hold]

A month ago I raised a question here because I couldn't (and I still can't) read BigTIFF raster files with gdal/rasterio ("RasterioIOError: This is a BigTIFF file. BigTIFF is not supported by ...
1
vote
0answers
23 views

gdalwarp resampling method

I'm trying to mosaic some georeferenced images using gdalwarp. But if I change the resampling method the result is always the same, why? I need to build a mosaic where the value of each pixel is the ...
1
vote
0answers
32 views

Getting inconsistent raster output from gdal_calc.py raster calculation

I'm attempting to do what is generally a straightforward raster calculation when I do this in QGIS, but am trying to do this with gdal_calc.py in terminal. The output is close, but produces banding ...
0
votes
0answers
18 views

Converting from netCDF to GeoTiff using gdal_translate

gdal_translate netcdf_file.nc output.tif I'm trying to generate a GeoTiff using this command, and it works... kind of. The output tif image is just black and white, and I'd like actual colors on the ...
0
votes
0answers
26 views

GDAL or other Python library to reproduce ArcGIS shrink and expand [on hold]

I'm working on changing a tool I once wrote from ArcPy to GDAL, and I can't find an alternative to expand and shrink. Any idea on how to do this?
1
vote
0answers
31 views

Mathematical rule to convert between degrees and centimeters based upon projection

I have some Tanzania drone imagery data in a local geographic projection EPSG:32737 that uses the unit of meters. Then I have other vector data that is in EPSG:4326 which is denominated in degrees. In ...
1
vote
1answer
27 views

Converting Longitude range from (0,360) to (-180,180) in Python or by using gdal commands

I have a raster downloaded. Visualising it in QGIS. I want to correctly project it so that its extent varies with longitudes from -180 to 180 instead of 0 to 360. gdalinfo filename.nc outputs the ...
2
votes
0answers
16 views

How to set the extent with gdal_rasterize, the “-te” does not work

I use gdal_rasterize to clip mask by shpaefile. however, the parameter "-te" does not work. get subprocess to call GDAL util import subprocess # define paths to raster and vector inraster = r'I:\...
1
vote
0answers
24 views

How can I easily determine the precision of an OGR geometry?

I'm writing a python tool to update some river catchment boundaries and keep running into geometry errors, such as WARNING: TopologyException: Input geom 1 is invalid: Self-intersection at or near ...
1
vote
2answers
32 views

Cut raster by pixels in GDAL

i've some georeferenced images that have the size of 1280 X 960. I need to cut the outer pixels to have a size of 1220 X 900 (i need to cut 30 pixel for each borders). Can i do this using GDAL or a ...
0
votes
1answer
18 views

Using raster calculator with GDAL in Python to make sum?

I have 130 rasters in a folder and I would like to create a new raster containing the sum of the 130 raster cell values. How can I do this?
1
vote
1answer
20 views

Using raster calculator with GDAL in python?

i am using an hyperspectral image with 158 bands. I want to calculate raster. i am using the following python script import gdal # Import GDAL library bindings from osgeo.gdalnumeric import * from ...
0
votes
1answer
25 views

Converting GeoTIFF to tiles using gdal2tiles

I have a GeoTIFF of weather radar data that I cannot seem to get converted to a raster tileset using gdal2tiles. When the tileset is generated, there are TONS of empty folders in the output directory, ...
1
vote
1answer
27 views

import gdal, return “ImportError: DLL load failed:”

I came up against this problem during the installation of gdal, I tried several solutions already read on the site but none helped me. Here's what I did: 1) uninstall gdal 2) uninstall Anaconda 3) ...
0
votes
0answers
16 views

Unable to install gdal2tiles on PyCharm

I have installed gdal 2.4.1 while installing gdal2tiles. I am getting this error: ERROR: Could not find a version that satisfies the requirement GDAL==2.4.1 (from gdal2tiles) (from versions: 1....
1
vote
1answer
29 views

How to convert GeoTIFF to array of normalized (0 - 1 range) values using C# GDAL Nuget Package?

I currently have a Unity3D tool that allows users to import different heightmap files into the Unity3d Game Engine, in order to produce Unity Terrain objects. The tool currently has limited support ...
2
votes
1answer
34 views

Python GDAL writing image output all pixels as zeros

I have an array "array" with numbers range from -5 to 1 (with decimal) and I tried to write it as a geotiff. However, the output geotiff turns out to be all zeros. Can someone tell me why? Here the ...
0
votes
1answer
35 views

How can I remove clouds' borders on Sentinel-2 images?

I have to replace area with clouds from another image without clouds. So I have a problem when I remove clouds from my mask I have borders of clouds. I use Sentinel-2 SLC image. For begin I open my ...
0
votes
0answers
19 views

Seeking documentation on DEMProcessing from GDAL?

I am using python 3.X and I am transforming a DEM (from a raster GeoTIFF file) into a slop tif file. I am using GDAL and rasterio to do that. Specifically, I am using the method: gdal....
0
votes
1answer
16 views

Getting string attribute from a shapefile with GDAL Feature.GetFieldAsString(name) returns incomplete value

I read a shapefile (zipped) with GDAL library in C#. Shapefile contains .cpg file with "UTF-8" encoding specified. When I call Feature.GetFieldAsString(attributeName) some of the attribute values get ...
0
votes
0answers
26 views

Many-Many Relationship in GDAL Pixel Functions

I am using pixel functions (in Python) in VRT derived data sets. As far as I know it is only possible to use One-One or Many-One relationships within a pixel function. In other words, the in_ar ...
0
votes
0answers
10 views

GDAL C# Bindings ogr2ogr's clipsrc

I am trying to call ogr2ogr's clipsrc command from C#, but I can't find any reference other than implementing what the command does from scratch. I can imagine Using gdalwarp with c# bindings? is ...
0
votes
0answers
30 views

Python gdal_translate move raster

I would like to translate from TIFF to ASCII, import os os.system("gdal_translate -of AAIGrid -a_srs EPSG:25830 " + 'my.tif' + " " + 'my.asc') But when I do that the ASCII file is moved: ASCII ...
2
votes
1answer
37 views

Convert gnomonic projection to Mercator

I'm trying for some time to convert a weather radar map (gnomonical projection) to mercator (EPSG_3395) and then layout it onto third-party web map so far unsuccessfully. The original image: The ...
0
votes
0answers
12 views

Creating a vector tileset from a vector GeoPDF

I have a georeferenced PDF published by the USFS. It appears to have been created using Esri ArcMap, and all of the labels and linework appears to be in vector format. Is there any way to convert ...
0
votes
0answers
22 views

GDAL project lat lon coordinates to UTM in C

I have dug up some old code I wrote 6 years ago that was doing the conversion from Lat Lon coordinates to UTM. I have tried to run it today and the code returns NaN values. I suspect there has been ...
0
votes
0answers
58 views

Installing rasterio and Fiona together?

I work on Windows; I use Christoph Gohlke wheels; Python 3.7 After installing GDAL-3.0.1 and Fiona-1.8.6 an error occurs on import of fiona from fiona.ogrext import Iterator, ItemsIterator, ...
0
votes
0answers
9 views

Convert black color to transparent alpha gdaldem

So I have a tif and it has a black internal padding or stuff. ------- --***-- --***-- --***-- --***-- ------- So the * are the needed bit, the - however, I need to get rid of. After few web ...
0
votes
0answers
11 views

Converting PBF to Shapefile with name:xx tags as a column in the attributes

I have a PBF file containing only rivers information (extracted using osmosis when waterway=river). A conversion of this PBF to SHP works fine with ogr2ogr when I am selecting fields like "osm_id" ...
0
votes
0answers
16 views

Using gdalwarp, how to first transform and then clip instead of vice-versa?

I have a large number of GeoTiffs that I need to clip by a polygon stored in a shapefile and then save them as a new raster. I use a gdalwarp command which I call from a Python script. These GTiffs (...
2
votes
0answers
14 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
36 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
37 views

QGIS-3 does not recognize “-3.40282e+38” float raster values as NoData

I have DEMs with "-3.40282e+38" values that are supposed to be the NoData values. However, if the rasters are loaded into QGIS (3.4.11), the value can not get assigned with "add additional no data ...
0
votes
0answers
20 views

Can't Open NetCDF file with GDAL module for Sentinel 3 Data

I downloaded a Sentinel 3B SLSTR Sl _L_RBT file and I am trying to open the Band 8 Nadir Thermal Band (S8_BT_in.nc) in NETCdf format. import gdal ds = gdal.Open( 'NETCDF: "/home/aaron/...
0
votes
0answers
12 views

Mimik -crop_to_cutline from gdalwarp with rasterio.mask

I'm trying to clip a raster with some polygons, some of them lie party outside of the raster. In gdalwarp, if you set -crop_to_cutline, it will fill the exterior part with no data and make it be a ...
2
votes
1answer
57 views

How to clip raster inside of circle (python gdal)

I have a source raster and an ERSI shape file, want to crop the raster into the circle. raster = gdal.Open("raster.tif", gdal.GA_ReadOnly) #read raster projection=raster.GetProjectionRef() ...
1
vote
1answer
60 views

Read RAT (raster attribute table) using GDAL or other python libraries?

Referring to this post, is there any update on the reason why GDAL function band.GetDefaultRAT() always returns NoneType? I can't find much documentation. I've tried to create a RAT for testing (...
3
votes
0answers
28 views

Problem with QGIS GDAL Fill Nodata

I have been using the 'GDAL Fill Nodata' function in QGIS in order to rectify downloaded Landsat 7 images, having created a relevant mask. Whilst said function has been successful in resolving bands 1 ...
3
votes
1answer
109 views

How to change a numpy array's dimensions [closed]

I'm using GDAL Python API to read a raster into a NumPy array, it will return a array's shape like [bands, rows, cols], if we want to use OpencCV to deal with this array, it will cause some problem, ...
1
vote
1answer
30 views

Conversion of MLS/AURA RELATIVE HUMIDITY PRODUCT to correctly referenced GeoTIFF

I have downloaded the following product https://cmr.earthdata.nasa.gov/search/concepts/C1251101764-GES_DISC.html and it gives me a .he5file. Can anyone help me in correctly geo-referencing the file ...
1
vote
0answers
19 views

Split .tif image in Python using GDAL

I am trying to split .tif image that i have downloaded from satellite imaginary. The .tif image is 114MB and has lot of data and i want to split the image into further small images to work more on the ...
1
vote
1answer
24 views

How to compress ecw when gdal_translate from tiff to ecw?

I wish to translate geotiff 16gb to ecw, cause current size is so big. but when I run sudo gdal_translate ppp_2020.tif ppp_compr.ecw -co "COMPRESSION_RATE_TARGET =80" 0...70...80...90...100 - done. ...
0
votes
0answers
16 views

GDAL calc difference between two NDVI rasters

I get a series of NDVI rasters every 2 weeks and need to calculate changes. The rasters overlap, but are different in area. The resolution is also a little different in each raster, raster 1: -0....
0
votes
0answers
14 views

R gdal_grid interpolation results in null values for elevation

I am trying to grid point cloud data. I created a csv with coordinates x,y and elevation z-values. The first lines of the .csv file look like this: "X", "Y", "Z" 666578.24179169,5747856.3361029,-0....
-1
votes
0answers
19 views

Removing black areas from black/white rasters?

I have black and white topographical planes as tiff + tab format. I want to generate a TMS. But I got a problem - rasters have huge black areas in corners and this overlapping each other: Usually, I ...
0
votes
0answers
8 views

Image pyramid have wrong colors in Geoserver [duplicate]

Just want to start off with saying that I'm fairly new to geoserver and the fix to this may be very simple. So have managed to create an image pyramid out of a ~14 GB tif file. The files are fine ...
0
votes
0answers
18 views

Preventing Base Map is getting converted after loading the chart as a layer in MapInfo?

Whenever I am loading the chart into mapinfo using MapXtreme the basemap is getting converted. Because of which the chart is not coming in the right place. Can you please check my code what I am doing ...
0
votes
0answers
20 views

ogr2ogr sqlite dialect can't find functions

my question might be related to this Dissolve using ogr2ogr gives 'no such function: ST_union' What I am trying is st_unioning my landparcel polygons based on its group. The code is very ...
0
votes
0answers
13 views

GDAL Rasterize (Vector to Raster) not working with any extent

I am attempting to rasterize a road layer and neither the GRASS nor GDAL routines for this are working in QGIS 3.8.2. All of my data is in UTM. Here is my input (GDAL): { 'BURN' : 0, 'DATA_TYPE' : ...
1
vote
1answer
25 views

Python ImportError with libgdal, undefined symbol: opj_codec_set_threads

GDAL and its Python 3 bindings have been installed through apt package manager for weeks, but, suddenly: from osgeo import GDAL ------------------------------------------------------------------------...