geotiff

Error on geotiff coordinate transformation

a 夏天 提交于 2020-06-17 04:20:46
问题 Have error and crash in an application using GDAL for extracting latitude & longitude from GeoTiff image running it in openSUSE, while it works fine in Ubuntu for my colleagues. Errors are different for gdal-v3 and gdal-v2 versions, however seems problem is in OGRCreateCoordinateTransformation object creation: returns NULL in both cases. See details below: Code: QGeoCoordinate toGeoCoordinate(double* adGeotransform, OGRSpatialReference& srcRef, int x, int y) { double worldX = adGeotransform[0

How can I calculate the sd? Error in as.double(x): cannot coerce type 'S4' to vector of type 'double'

ぃ、小莉子 提交于 2020-06-16 06:39:13
问题 Do somebody know what is wrong with my code? I edited the post, because i didn´t give you the data. I want to calculate the sd. The calculation of the mean worked. Here is the link to the cropped data: https://drive.google.com/drive/folders/1ljT1fzaDlSmn_3j7zHshS5lrV1wBvVQD library(raster) r <- brick("filename") #mean mean <- mean(r) #sd standard_dev <- sd(r) standard_dev2 <- sd(r, na.rm =TRUE) standard_deviation <- calc(r, sd) 回答1: You want the compute the sd for each cell in a RasterBrick.

Find pixel coordinates from lat/long point in .geotiff using python and gdal

十年热恋 提交于 2020-01-25 08:59:26
问题 I have (lat,long) coordinate describing the position of a point in a .geotiff image. I wish to find the equivalent pixel coordinates of the lat,long ones inside the image. I succeded using gdaltransform from the command line with the following instruction : gdaltransform -i -t_srs epsg:4326 /path/imagename.tiff -17.4380493164062 14.6951949085676 But i would like to retrieve such type of equivalence from python code. I tried the following : from osgeo import osr source = osr.SpatialReference()

Octave: Box and whisker plot without spread from GeoTIFF

孤人 提交于 2020-01-05 05:53:30
问题 ---- Update with what I got so far and what's left to resolve can be found in point 3 below ---- Using Octave I want to create 30 horizontal box and whisker plots without spread (x-axis) from 30 different GeoTIFF's. This is a sketch of how I would like the plot to look like: Ideally the best solution for me would be an Octave code (workflow) that would allow me to place multiple GeoTIFFs in one directory and then with one click create a box and whisker plot for all GeotIFFs at once - just

Show GeoTiff image Openlayers 3

情到浓时终转凉″ 提交于 2020-01-04 05:01:48
问题 I need to display a raster image in GeoTiff format, it was georeferenced with QGIS. It looks like Openlayers 3.15 doesn't support this kind of format. Do you know anything about that? var agentUrl = 'http://localhost:9925/Wgis/assets/img/allertaMeteoGeo.tif'; var bounds = [ 713101.704, 4044061.027, 713101.704, 4044061.027]; var view2 = new ol.View({ center : [ -87.7302542509315, 43.744459064634 ], projection : "EPSG:3857", zoom : 12 }); var sorgente = new ol.source.ImageMapGuide({ projection

Show GeoTiff image Openlayers 3

回眸只為那壹抹淺笑 提交于 2020-01-04 05:01:04
问题 I need to display a raster image in GeoTiff format, it was georeferenced with QGIS. It looks like Openlayers 3.15 doesn't support this kind of format. Do you know anything about that? var agentUrl = 'http://localhost:9925/Wgis/assets/img/allertaMeteoGeo.tif'; var bounds = [ 713101.704, 4044061.027, 713101.704, 4044061.027]; var view2 = new ol.View({ center : [ -87.7302542509315, 43.744459064634 ], projection : "EPSG:3857", zoom : 12 }); var sorgente = new ol.source.ImageMapGuide({ projection

How to read GeoTIFF file from C#

蓝咒 提交于 2019-12-29 06:25:17
问题 I have acquired Digital Elevation Maps(Height Map of Earth) of some area. My aim was to create Realistic Terrains. Terrain Generation is no problem. I have practiced that using VC# & XNA framework. The problem is that those Height Map Files are in GeoTIFF format which i don't know how to read. Nor do i have previous experience with reading any image files so that i could experiment something using little tips-bits available on internet about reading GeoTIFF files. So far i have been

Why do I get different results in plotting a NetCDF layer with “image(x,y,z)” and “plot (raster)” using R-package Raster?

社会主义新天地 提交于 2019-12-24 15:46:36
问题 This might be something really simple to fix. I want to plot over a map a data layer from a NetCDF file using the function plot(raster). I don't know why I'm getting a raster skewed/offset (My guess is that the problem is in the transformation, resolution?) as shown in the following image. Incorrect map If I use the function image(x,y,z...) with the lat,lng, value matrices I get the correct display as is shown here: Correct map This is the code in R that I'm using: library(ncdf) library

How do I open geotiff images with gdal in python?

◇◆丶佛笑我妖孽 提交于 2019-12-22 01:37:25
问题 I am trying to run the following code: from osgeo import gdal import sys # this allows GDAL to throw Python Exceptions src_ds = gdal.Open( "fused.tif" ) src_ds.show() But I receive the following error: Traceback (most recent call last): File ".../gdalopen1.py", line 5, in module src_ds.show() AttributeError: 'Dataset' object has no attribute 'show' Why does this happen? 回答1: You have already opened the dataset, as Spacedman answered. GDAL is not a visualization library (at its core). You can

Convert NetCDF (.nc) to GEOTIFF

霸气de小男生 提交于 2019-12-20 01:05:52
问题 I have .nc file sizing around 300MB with a couple of datasets ( TEMP , DEWPOINT ) forecast data. I need to convert ( TEMP ) dataset to multiple GEOTIFF (one .tif for each time slice). Here is how the .nc file looks like. Looked into this answer but it seems to be for the whole dataset. I tried GDAL but not sure how to make it work for each time slice. Any thoughts? netcdf4 -python? 回答1: gdal has a gdal_translate option that will allow you to do this to translate the file from .nc to .tiff .