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
Make your voice heard. Take the 2019 Developer Survey now

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.

0
votes
0answers
13 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\...
-1
votes
0answers
9 views

Numpy array to shapefile [on hold]

i want to convert a numpy array to a shapefile (GeoJSON or ESRI). My array represents an classification (damage=1, no damage=0). I want to do this for two arrays, and afterwards intersect the polygons....
1
vote
0answers
20 views

Convert an OGR File to a Raster

i tried out this recipe from the GDAL/OGR cookbook: from osgeo import gdal, ogr # Define pixel_size and NoData value of new raster pixel_size = 25 NoData_value = -9999 # Filename of input OGR file ...
1
vote
0answers
22 views

QGIS GDAL driver error

I'm unable to complete processing in the Processing Modeler due to the following GDAL Error: 2019-01-21T10:47:12 CRITICAL Could not create raster output E:\QGIS\QGIS_Projects\GDALTEST: GDAL ...
0
votes
1answer
12 views

GDAL: Using gdallocationinfo on a rotated SAR image to get pixel value at Coordinates

Some information: I must not re-sample the image, the pixels are rotated, and the image opens in Arcmap just fine. now, there are 15 GCPs on the raster (which make the pixels rotate) Progress: 1.When ...
2
votes
0answers
21 views

gdal_translate does not crop the GeoTIFF file [on hold]

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
0answers
14 views

Resize multiple .tif files at once [on hold]

Premise: I'm new to GIS data manipulation so please forgive me if I use incorrect terminology. I've searched over internet for a solution but having no scripting knowledge, I couldn't find anything ...
0
votes
0answers
14 views

ValueError: expected array of dim 2

I'm trying to crop a GeoTiff file with spesific coordinates. I tried to implement many methods (gdal_translate, gdal_warp). The best approach I had was with the following codes. But I'm having a ...
3
votes
1answer
42 views

Using ogr2ogr on Anaconda

I am building a Choropleth map in D3.JS. In order to do that, I have downloaded a map from Eurostat. From the GeoJSON file, I want to extract the country for the visualization, in my case Portugal. ...
1
vote
0answers
50 views

Rasterizing shapefile with rasterio and gdal gives all cells 0 values [on hold]

I am trying to rasterize my shapefile (20 polygons) with rasterio and fiona and turn the new raster into a mask for clipping. I need to rasterize my all polygons in my shapefile and turn on mask ...
0
votes
1answer
28 views

Polygonize and mask a GeoTiff with GDAL and OGR [on hold]

I am trying to polygonize a GeoTIFF: import numpy, sys from osgeo import gdal, ogr from osgeo.gdalconst import * gdal.UseExceptions() ds = gdal.Open('H:/Threshold/nsdvi_range.tif' srcband = ds....
0
votes
1answer
38 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 &...
-1
votes
0answers
22 views

How to Plot S57 vector chart on display [closed]

S57 chart format has geometry in text or mathematical form that we can read using GDAL library but I don't know how to convert it on visual form that we can see on display. I want Python or C++ ...
0
votes
0answers
8 views

GDAL 2.4.0 with GeoDjango: GDAL_ERROR 1 'Error in fread() reading object of size 28 at offset 100 from .shp file'

I am trying to open a shapefile with GeoDjango's DataSource. def func(): ds = DataSource('intersections/CENTRELINE_INTERSECTION_WGS84.shp') layer = ds[0] for f in layer: pass ...
1
vote
0answers
21 views

Python: No module named 'gdal_merge'

I try to merge two DEM data sets with python, using gdal_merge, but it doesn't work. I install like this: from osgeo import gdal But this doesn't work: import gdal_merge as gm I get the error ...
0
votes
1answer
25 views

Seeking code sample or pointer showing how to calculate Corner Coordinates of JPG file based on EXIF GPS data? [closed]

This is a follow up to this question: Using GDAL to extract Corner Coordinates based on a jpg file's GPS EXIF data? Per the answer I received to the above question, gdal_merge cannot merge JPG ...
0
votes
0answers
17 views

How to set correct geo information on pleiades images with RPC model?

Now I have pleiades raster (img.tif) and a RPC model (rpc.XML). In the rpc.XML, there are the following lines which can be used to reset geo information. <RFM_Validity> <...
0
votes
0answers
19 views

Compressing 16 bit 4 band RGBI (.img)

I have over 1000 georeferenced .img files I need to compress down for sharing. They are 16 bit 4 band RGBI, and use about 800mb of space each. I really like the result of compressing using ...
0
votes
1answer
39 views

Using GDAL to extract Corner Coordinates based on a jpg file's GPS EXIF data?

I have ~100 jpeg images taken by a Drone. I tried to use gdal_merge to merge them and create a big tile GeoTIFF image. gdal_merge spends lots of time, and in the end, it just put each jpeg image ...
0
votes
1answer
27 views

Projecting gtiff data using GDAL and Python?

I have a tile data and I would like to transform the data to a gtiff data with georeference information via gdal and python. The tile is the quadtree tile with quad key 1321222320321122. The left ...
0
votes
0answers
12 views

PBF/Mbtiles Verification more faster?

i have 1000 over shp, and it contains 25,000,000 over record. it's my country shpFiles. and i convert shp -> GeoJson -> Mbtiles/PBF. then, I want to make sure that all "features" have been converted. ...
2
votes
1answer
43 views

How to calculate mean for each band in raster using GDAL and Python 3

I have a raster with 6 bands and I need to calculate the mean for all bands in the raster without value 0 I have this script but it works for one band only: import os from osgeo import gdal import ...
0
votes
1answer
114 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
34 views

Using GDAL to strip nodata in border regions only?

I am trying to create a script that given a tiff file with islands of data (which can be disjoint) and black pixels of nodata, can generate polygons (or new tiffs) that only wrap around the islands of ...
0
votes
0answers
46 views

Getting source bounds when filtering LAS using PDAL? [on hold]

I'm using PDAL to filter out non ground points to create a DTM along witha DSM also made through PDAL to create a Canopy Height Model using this method. My workflow looks like this. #!/bin/sh # ...
3
votes
1answer
38 views

Colorize singleband GeoTIFF raster using Python/GDAL with discrete interpolation like in QGIS

I have singleband raster with min 0 and max 0.82 values. For raster I applied next color scheme in QGIS: I want colorize raster using GDAL command, but receive raster with another color: GDAL ...
1
vote
1answer
22 views

QGIS RGB2PCT is leaving holes in continuous regions

I have a raster which was generated from an ArcGisMapServer layer, and is thus an RGB layer. I want to convert the RGB layers into a single 8bit layer in order to recover the original classes. When ...
0
votes
1answer
18 views

Build GDAL with CMake

As stated here: https://trac.osgeo.org/gdal/wiki/CMake GDAL is not yet ready to be compiled with CMake: News 2012-04-28: Pilot project of CMake configuration for GDAL is being developed ...
1
vote
1answer
32 views

Convert a vector file to an RGB raster using gdal_rasterize without filling polygons

I am trying to convert a vector file that includes polygons to an RGB raster using gdal_rasterize without filling the polygons. Is there a way to do this? For example, I use the following command to ...
1
vote
0answers
17 views

Reading a RasterIO MemoryFile triggers a GTiff driver warning/error message

I have recently upgraded RasterIO from version 1.0.5 to 1.0.12. After this upgrade I now get CPLE_NotSupported in driver GTiff does not support open option MODE when reading a MemoryFile. My code to ...
0
votes
1answer
20 views

Compile error with GDAL on MacOSX

I've been trying to install the GDAL Python package on my MacOS Mojave 10.14.1. I ran the following: brew install gdal This works fine, though I do get this warning (https://github.com/Homebrew/...
0
votes
1answer
39 views

GeoTIFF rendered in OpenLayers using GeoServer: Tiles have different brightness and sharp edges between them

I have a script that download and process satellite images using pyhon/gdal and then upload them to GeoServer. The basic process is: gdalbuildvrt tmp.vrt file_1.tif file_2.tif ... file_n.tif ...
0
votes
1answer
44 views

GDAL EPSG:4326 Python

I am converting multiple CSV (Lon, Lat, value) to GeoTIFF. My output is in a different projection (EPSG:404000) using output = 'gdal_grid -a invdist:power=2.0 -zfield "value" -of GTiff -ot Float64 -...
0
votes
0answers
29 views

Geoserver+GDAL+OSGEO4W ECW support

I am trying to install the GDAL plugin for Geoserver on machines which have windows 7 and 10. both machines had a previously installed version of OSGeo4W. I followed all the instructions in the ...
0
votes
0answers
19 views

Transforming GRIB file into GeoTIFF that is correctly georeferenced using Python GDAL?

I am trying to transform a GRIB file into a GeoTIFF to be used in a ArcGIS, but am having trouble getting the image to display in the correct location. I have been able to create a GeoTIFF, using GDAL ...
0
votes
1answer
80 views

How can I convert shapefile to raster and mask using GDAL Python 3

I have a polygon and filelist of data I need to convert my polygon to raster and mask my filelist with this mask and campute the statistics in the area in polygon. I'm using GDAL Python. I can do it ...
0
votes
0answers
28 views

Turn a single MultiPolygon into many small Polygons?

I have a large GeoJSON file with a single very complex MultiPolygon, and I would like to turn it into an identical file with many small Polygons. How can I do this? I can use ogr2ogr or mapshaper or ...
1
vote
1answer
20 views

Should gdal2 installation include CLI commands gdal_calc.py and gdal_merge?

I have gdal2 (v2.4) installed on my mac using homebrew. When I try to run either gdal_calc.py or gdal_merge from the command line I get the error -bash: gdal_merge: command not found or -bash: ...
1
vote
1answer
49 views

How to create GeoTIFF from image and UTM Coordinates

I am a beginner in GeoTIFF and georeferencing. I have an image in .emf file format. I also have this UTM information: Easting,Northing,Zone,Hemisphere Example: 400000,4379520,24,N (I have also the ...
1
vote
1answer
36 views

NumPy array to Raster file (GeoTIFF)

I converted a raster file (one band grey scale) to an numpy array and set a range to it. I Did like that: import gdal import numpy ds = gdal.Open('H:/GDAL_docs/a.tif') myarray = numpy.array(ds....
0
votes
0answers
24 views

Merge two shapefiles into one new shapefile with OGR/GDAL library in C#?

I am currently coding a C#/WPF application that lets you choose two shapefiles and create a new merged one, with the content of both shapefiles. My problem is that I am quite new (1 month with gis) ...
1
vote
1answer
22 views

OSGEO4W Checking GDAL version with `gdalinfo --version` returns nothing

I am using OSGEO4W 32-bit on Windows 10. I am trying to check the version of GDAL. Following the instructions here, when I input gdalinfo --version in the OSGEO4W shell, I get just a blank line. ...
0
votes
0answers
27 views

ImageServer / GDAL Error

I am attempting to add an ImageServer layer to my project (QGIS 3.4.2 22034aa070 on Windows 1803) using the following command: qgis.utils.iface.addRasterLayer("https://gis.maine.gov/arcgis/rest/...
1
vote
2answers
50 views

Rasterio error: Input shapes do not overlap raster but reprojection not working

I'm trying to use rasterio (v1.0.13) and fiona to perform a raster clip on a geotiff using a geojson polygon. For reference, the clip works perfectly from the command line using GDAL: gdalwarp -...
0
votes
0answers
40 views

Error while creating large TIFF with gdal_merge

I need to merge two TIFFs into one, but the output is larger than 4 GB. So, it needs to be a BigTIFF. But the "BIGTIFF=YES" creation option seems to be ignored. Here's the error: $ gdal_merge.py -...
2
votes
1answer
24 views

Get data from a raster using two coordinate arrays with Python

I'm trying to find a function in Python, that given two arrays with geographic coordinates, returns a list or array of raster values in those positions. that is to say: import numpy as np """geog ...
1
vote
0answers
48 views

Create a blank raster from scratch using QGIS?

I'm wondering if there is any way to create a raster with no input data aside from an extent and cell size (and possibly a default value). I'm using QGIS as a way to try my analysis and eventually ...
0
votes
1answer
29 views

Ubuntu Linux | Unable to configure ECW extenion in Geoserver 2.14.1 (war file)

We are using Ubuntu Linux 16.04, Geo-server war file 2.14.1 & Tomcat 8.5 (64 bit) We have configured Geoserver in tomcat and trying to configure MrSID & ECW plugins Steps Completed :- 1....
0
votes
1answer
57 views

Converting self-intersecting polygons into distinct polygons

How to convert self-intersecting polygons into distinctive, well behaving polygons? My polygon inputs consist of self-intersecting polygons, which fails the st_isvalid test, ie: the below statement ...
0
votes
1answer
33 views

Raster from a set of Points keeping the resolution

I have a database with some points covering the earth surface and I want to build a raster (GeoTIFF using gdal_rasterize) which mantains the same spatial resolution of the input points (so without ...