raster

clipping polygon against rectangle

梦想的初衷 提交于 2019-12-23 17:27:46
问题 today I have a (simple) rendering problem for you. My current project gets datas from a file to generate a SVG file. Drawing things as polygon is pretty easy thanks to the SVG format, but I have a single problem: some of my polygons are in AND out of the page (meaning that some parts of them are displayed while the rest is not shown due to the fact they are out of the display limit). In order to optimize the final SVG file I need to reduce my polygon to a simpler form. Consider the grey

Worldwind - Shapes are always displayed on top of images?

醉酒当歌 提交于 2019-12-23 15:47:31
问题 I have two layers added to the layerlist of WorldWindowGLJPanel. One of them is RenderableLayer which contain shapes and the other is BasicTiledImageLayer containing raster images. (One layer contains one object). The problem is when i change the order of layers with layermanager panel, only the order of objects that have the same type of layer changes and shapes are always displayed on top of images no matter which order they have. Is there a way to correct this? Screenshots: And my code is

Problem importing USDA Crop Data Layer (GTIFF) in R using raster() package

岁酱吖の 提交于 2019-12-23 15:37:19
问题 I've downloaded the USDA Crop Data Layer (data available here, note large file: http://www.nass.usda.gov/research/Cropland/SARS1a.htm) and want to import it into R for analysis. I've imported other large GTIFF files (e.g., LANDSAT data), but get the following error when I call the function: r <- raster(file) Error in .rasterObjectFromFile(x, band = band, objecttype = "RasterLayer", : Cannot create a RasterLayer object from this file. where "file" is any of the .tif files provided by USDA (I'm

Save multi layer RasterBrick to harddisk

不羁的心 提交于 2019-12-23 15:03:00
问题 I have a multilayer RasterBrick representing a topographic map that I want to save to the harddisk as grd or tif format, so that others can work with later. This is the RasterBrick: class : RasterBrick dimensions : 2400, 4200, 10080000, 3 (nrow, ncol, ncell, nlayers) resolution : 100, 100 (x, y) extent : 480000, 9e+05, 62000, 302000 (xmin, xmax, ymin, ymax) coord. ref. : NA data source : in memory names : layer.1, layer.2, layer.3 min values : 2.8725, 2.8725, 2.8725 max values : 254.5175, 254

Downloading SRTM data with raster package?

孤街醉人 提交于 2019-12-23 12:11:52
问题 I'm trying to get SRTM data with " raster " package in R, but as soon as I'm choosing SRTM in getData command, I would get the following error: library(raster) srtm <- getData('SRTM', lon=16, lat=48) trying URL 'ftp://xftp.jrc.it/pub/srtmV4/tiff/srtm_40_03.zip' trying URL 'http://hypersphere.telascience.org/elevation/cgiar_srtm_v4/tiff/zip/srtm_40_03.ZIP' downloaded 572 bytes Error in .SRTM(..., download = download, path = path) : file not found In addition: Warning messages: 1: In utils:

Merge multiple *.bil climate data into *.csv

只愿长相守 提交于 2019-12-23 05:13:16
问题 I have over 7,000 files *.bil files I'm trying to merge into one *.csv file and export it. I am able to read the *.bil files using raster and as.data.frame : setwd("/.../Prism Weather Data All/") filenames <- list.files(path = "/.../Prism Weather Data All/", pattern = ".bil") r = raster("PRISM_ppt_stable_4kmM2_189501_bil.bil") test <- as.data.frame(r, na.rm=TRUE) This sets the working directory and grabs all files with *.bil. But I only raster one file and set as.data.frame to verify it's

Intersection of bands in R raster package

非 Y 不嫁゛ 提交于 2019-12-23 03:33:13
问题 My input raster consists of multiple layers, each with an image area surrounded by no data values. These layers don't overlap completely, and I am trying to output a file which consists of only the intersection of all bands (the zone which has no NoData values on any layer). The following works for a few layers, but not for the 50+ that I have in my real files (at least 3000x3000 pixels): library(raster) fin = "D:\\temp\\all_modes.pix" fout = "D:\\temp\\test.pix" inbands = stack(fin, bands =

Intersection of bands in R raster package

核能气质少年 提交于 2019-12-23 03:33:05
问题 My input raster consists of multiple layers, each with an image area surrounded by no data values. These layers don't overlap completely, and I am trying to output a file which consists of only the intersection of all bands (the zone which has no NoData values on any layer). The following works for a few layers, but not for the 50+ that I have in my real files (at least 3000x3000 pixels): library(raster) fin = "D:\\temp\\all_modes.pix" fout = "D:\\temp\\test.pix" inbands = stack(fin, bands =

add result of image.plot layer on geographic map (bing map)

无人久伴 提交于 2019-12-23 03:19:24
问题 I have a 2D footprint result for an eddy-covariance system on a 1100*1100 square meter, with the domain of domain = c(-100,1000,-100, 1000) the cell size of the domain (each grid) is 2 meters with the origin (0,0) accordingly on this location: Lon = -97.191391 #longtitude Lat = 36.055935 #latitude An example data (9.01 Mb) is attached here. FFP.rds then I can plot a Bing map on my site as this: library(OpenStreetMap) library(rgdal) map <- openmap(c(36.05778,-97.19250), c(36.05444,-97.18861)

Simplest way to save array into raster file in Python

为君一笑 提交于 2019-12-23 02:34:31
问题 With one 2-d array in the shape of (100, 100), I want to save it into raster file in .tiff format. I can use gdal package to read tiff files which are already exist. But I still can't find a simple way to transform the 2-d array into tiff file . Using plt.imsave("xx.tif",array) or def array_to_raster(array): """Array > Raster Save a raster from a C order array. :param array: ndarray """ dst_filename = 'xxx.tiff' x_pixels = 100 # number of pixels in x y_pixels = 100 # number of pixels in y