rasterize

How to rasterize OpenGL triangle on half-integer pixels centers

拜拜、爱过 提交于 2020-04-10 09:08:51
问题 OpenGL pixels/fragments are conceptually 1x1 squares centered on half-integer pixels. The OpenGL 4.5 specification states: A fragment is located by its lower left corner, which lies on integer grid coordinates. Rasterization operations also refer to a fragment’s center, which is offset by (1/2,1/2) from its lower left corner (and so lies on half-integer coordinates). Rasterizers typically assume that pixel centers lie on the integer grid. Since I am attempting to implement a correct OpenGL

use R to rasterize shapefile with holes?

自闭症网瘾萝莉.ら 提交于 2019-12-24 03:08:37
问题 I am attempting to use R to rasterize some downloaded shapefiles that include polygons with holes in them and R is failing to recognize the holes. The holes seem to be designated as hole=T, so I don't think the issue is the one solved in the question: rasterize ESRI shapefile with holes but FALSE hole slots What else could be going on? How do I troubleshoot this issue? I've been using the rasterize function without any changes to the default settings, and the data I've been working with are

Global Raster of geographic distances

情到浓时终转凉″ 提交于 2019-12-21 21:46:31
问题 Im wondering if someone has built a raster of the continents of the world where each cell equals the distance of that cell cell to the nearest shore. This map would highlight the land areas that are most isolated inland. I would imagine this would simply rasterize a shapefile of the global boundaries and then calculate the distances. 回答1: You can do this with raster::distance , which calculates the distance from each NA cell to the closest non- NA cell. You just need to create a raster that

PHP + PhantomJS Rasterize

扶醉桌前 提交于 2019-12-20 03:34:22
问题 I'm using PhantomJS 64 bit in my PHP application to dynamically capture an HTML page to be emailed to the user. phantomjs rasterize.js "http://..." /path_to_images/image.png This method works fine when I run the above on the command line but when the PHP script runs the command using exec it fails with no output and returns exit code 11. If I switch it to use the 32 bit phantomJS binary, the command succeeds but fails to load the google JSAPI on the page since with error Reference Error: can

gdal 2.1 Rasterize

非 Y 不嫁゛ 提交于 2019-12-19 21:04:43
问题 Is it possible to set the data type (Byte, Float32) when using gdal.Rasterize in gdal 2.1? Currently, I use gdal.Translate to convert to Byte, but this is inefficient. tif = my/target.tif shp = my/source.shp tiftemp = my/temp/solution.tif rasterizeOptions = gdal.RasterizeOptions(xRes=20, yRes=20, allTouched=True etc.) gdal.Rasterize(tiftemp, shp, options=rasterizeOptions) #translate to Byte data type (not supported by Rasterize?) gdal.Translate(tif, tiftemp, outputType=gdal.GDT_Byte,

extract raster pixel value as well as pixel xy coordinates using a SpatialLine object in R

孤街醉人 提交于 2019-12-13 12:42:02
问题 I have a Spatialline that I converted from a polygon shapefile (digitized manually based on features in "imagebrick" - this means that spatially the "polyline" and "imagebrick" are overlapped as I wanted) polyline <- as(shapefiles_data[1,],"SpatialLines") > polyline class : SpatialLines features : 1 extent : 357714.3, 357719, 4076030, 4076035 (xmin, xmax, ymin, ymax) coord. ref. : +proj=utm +zone=11 +datum=NAD27 +units=m +no_defs +ellps=clrk66 +nadgrids=@conus,@alaska,@ntv2_0.gsb,@ntv1_can

How to create cohesive Spatial Pixels from Spatial Points Dataset

回眸只為那壹抹淺笑 提交于 2019-12-12 02:35:28
问题 I have a Spatial Point DF spo (covering an irregular shaped area of interest). The data are not on a regular grid due to crs transformation. My goal is a raster with predefined resolution and extent of the area of interest ( more spatial point data are to be mapped on this master raster) . Problems start when I rasterize(spo, raster(ncol, nrow, extent, crs), spo$param) I need to adjust nrow and ncol in a way so that I wont get moire patterns of NAs within my area of interest. I can't use a

How to rasterize OpenGL triangle on half-integer pixels centers

 ̄綄美尐妖づ 提交于 2019-12-05 07:29:14
OpenGL pixels/fragments are conceptually 1x1 squares centered on half-integer pixels. The OpenGL 4.5 specification states: A fragment is located by its lower left corner, which lies on integer grid coordinates. Rasterization operations also refer to a fragment’s center, which is offset by (1/2,1/2) from its lower left corner (and so lies on half-integer coordinates). Rasterizers typically assume that pixel centers lie on the integer grid. Since I am attempting to implement a correct OpenGL triangle fill I want to know if the following procedures seems sound. Let's take the simple case of a

Global Raster of geographic distances

删除回忆录丶 提交于 2019-12-04 16:31:54
Im wondering if someone has built a raster of the continents of the world where each cell equals the distance of that cell cell to the nearest shore. This map would highlight the land areas that are most isolated inland. I would imagine this would simply rasterize a shapefile of the global boundaries and then calculate the distances. You can do this with raster::distance , which calculates the distance from each NA cell to the closest non- NA cell. You just need to create a raster that has NA for land pixels, and some other value for non-land pixels. Here's how: library(raster) library

Overlay shapefile and rasterlayer in R?

流过昼夜 提交于 2019-12-02 14:54:59
问题 I have a raster layer with climate data from the north of Mexico, part of Canada and the US mainland. I am trying to restrict the climate data to only the zone of the US mainland. To do this I thought it would be easy to import a US mainland map and overlay it with my raster data (of course this is turning out to be a lot more difficult than I thought). So far, using the rgdal library, I have managed to import a shapefile including the USA mainland map with states divisions. Now I want to