Questions tagged [rasterize]

107 questions
13
votes
0 answers

How to rasterize OpenGL triangle on half-integer pixels centers

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…
wcochran
  • 10,089
  • 6
  • 61
  • 69
7
votes
2 answers

Can i use SVG Salamander to rasterize SVGs into PNG files?

I have seen it cause SVG-Salamander is small enough to my projects. But I don't know if i can use it for that neither how to do it. I've use this code : public static void main(String[] args) throws IOException, SVGException { // TODO…
A.Quiroga
  • 5,704
  • 6
  • 37
  • 58
6
votes
0 answers

Any possible way to rasterize views in Android, just like in iOS?

In iOS I can do a call like self.layer.shouldRasterize = YES; Is there anything similar in Android in terms of rasterizing views and therefore not getting onDraw() being called consistently? I would like to prevent views from being drawn over and…
AndyRoid
  • 5,062
  • 8
  • 38
  • 73
5
votes
1 answer

What is the "secret" behind Graphics drawing to a window?

Graphics in itself is just some abstract Class. How does calling g.drawImage(Image img, tx, null) or something like that actually draw to the window? I looked a bit and I got that maybe something is going on in an instance of java.awt.Component? Is…
AMDG
  • 1,118
  • 1
  • 13
  • 29
4
votes
1 answer

algorithm to rasterize and fill a hypersphere?

I'm trying to rasterize and fill a hypersphere. In essence, I have a d-dimensional grid of fixed size and a sphere (center, radius) and want to find out which cells of the grid overlap with the sphere and store their coordinates. I am aware of the…
aeolist
  • 196
  • 9
4
votes
2 answers

gdal 2.1 Rasterize

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 =…
Johan
  • 406
  • 6
  • 20
4
votes
0 answers

How to keep the attributes when rasterizing, correspondence between field and numbers used in rasterize

I want to rasterize a polygon, if I define the field, it is not returning the attribute. For examle, the following polygon has 22 polygon and 13 unique BASIN_ID. If I rasterize based on BASIN_ID which are type factor/character, it will assign a…
newbie
  • 757
  • 1
  • 9
  • 19
4
votes
1 answer

Converting shapefile to raster

I'm having an issue rasterizing a shapefile to produce points on a 0.5*0.5 grid. The shapefile represents classifications of risk level (Low-0, Medium-100, High-1000, Very High-1500) of global coral reefs to integrated threats. I pulled the code…
RMFish
  • 43
  • 1
  • 1
  • 4
4
votes
1 answer

how to rasterize rotated rectangle (in 2d by setpixel)

I have got a four 2d vertices A B C D of rotated rectangle, I need to rasterize/draw it (efficiently) in pixelbufer with setpixel(x,y,color) how to do it? i was trying with some code like // convertilg a b c d do up down left right, //…
grunge fightr
  • 1,360
  • 2
  • 19
  • 38
3
votes
1 answer

R: Georeference single drone image from metadata file

In my example, I have a single dji image in *JPG: library(terra) single.image <-stack("https://github.com/Leprechault/trash/raw/main/DJI_0274.JPG") plotRGB(single.image, r = 3, g = 2, b = 1, stretch = "lin") # class : RasterStack # dimensions…
Leprechault
  • 1,531
  • 12
  • 28
3
votes
0 answers

Matlab: raster 3d objects but vector axes

I have a 3D isosurface in matlab that I need to attach to a LaTeX file and im saving it with -depsc. To my knowledge, I can either save it with -painters, which produces a pure vector file or -opengl which rasters the whole figure. My problem is the…
Menc
  • 51
  • 2
3
votes
1 answer

How to transfer specific colors to a raster in r

I wonder if it is possible to assign specific colors to the cells of a raster in r. I know that “rasterize” in the package "raster" allows transferring values to a raster given the coordinates of the given value. However, I wonder if is possible to…
Camilo
  • 201
  • 2
  • 6
3
votes
1 answer

Global Raster of geographic distances

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…
I Del Toro
  • 913
  • 4
  • 15
  • 36
3
votes
2 answers

How to improve speed while converting Big spatial polygon data frame to raster stack

I'm working on spatial polygon data frame (spdf) dataset. This dataset contains a time series of monthly climate data. What I'm trying to achieve is to convert the spdf to raster stack with 1000m resolution for further statistical analysis. I've…
Tade
  • 43
  • 5
3
votes
0 answers

Convert SpatialPolygonsDataFrame to raster in R

library(raster) library(rgdal) #download data download.file("http://www.protectedplanet.net/downloads/WDPA_July2015?type=shapefile","WDPA_July2015-shapefile.zip") #unzip files unzip("WDPA_July2015-shapefile.zip") #read in shapefile a <-…
flohump
  • 61
  • 1
  • 4
1
2 3 4 5 6 7 8