Questions tagged [rasterize]

107 questions
1
vote
1 answer

How define the cell size from a hexagonal grid?

I'm trying to create a hexagonal grid from a biome boundaries (cerrado, but it could be able to apply to any other political boundaries). In sf documentation I saw that it is possible to do it with the st_make_grid function, but does not clear how…
Karoline
  • 17
  • 2
1
vote
1 answer

Rasterizing a large image with Rasterio

I am rasterizing polygons in a large raster using the following code: import rasterio.features from shapely.geometry import Polygon p1 = Polygon([[0,0], [32000,0], [32000,32000], [0,0]]) out_shape = (32000, 32000) # The default transform is fine…
KarateKid
  • 3,138
  • 4
  • 20
  • 39
1
vote
1 answer

Why rasterizing a shapefile in python using make_geocube gives an empty geotiff file?

When I try to rasterize a shapefile (ice chart) for attribute CA, it does not work. It gives me a GeoTIFF file with a size of 1 KB. When I open it on QGIS, nothing shows up because it is empty. Here is the Warning:…
Ari
  • 11
  • 4
1
vote
0 answers

How to create and stack rasters from XYZ dataframe using irregular gid (equviarea)?

I have a equivearea grid of lat and lon data (grids are same area) and a dataframe with some environmental variables: expl.var <- structure(list(SST = c(24.4812454115405, 30.3755130902902, 30.2892917343848, 30.1874577574072, 30.0685523131313,…
yuliaUU
  • 1,581
  • 2
  • 12
  • 33
1
vote
1 answer

Why writeRaster(brick()) using RasterLayers with same number of cells result to RasterStack?

I'm using this function to calculate the length of linestring per cell by ID and store in a list, convert each element of the list into a RasterLayer and turn that list into a RasterBrick. Notice that inside the function I use "left_join()" so that…
1
vote
1 answer

terra::rasterize points containing multiple attributes

I have a SpatVector with 10 points and 2 attributes (i_1, i_2). I need to summarise my SpatVector over one grid cell covering those 10 points and thought terra::rasterize was the most appropriate function to do just that. The output of rasterize…
1
vote
0 answers

Rasterizing and summing all polygons in a shapefile

I am trying to take a shapefile with 5 polygons, rasterize each of them into a raster file, and then sum all of those rasters. I have been trying to accomplish this in python using rasterio and geocube, but have encountered some issues where my…
1
vote
0 answers

Flutter repaint and rasterize entire screen on changing TextField cursor

I have a very simple flutter app which render a TextField in the middle of screen. Here's widget tree: MaterialApp > Scaffold > Center > Padding> RepaintBoundary > TextField Here is the screen when the app just started, everything ok, repaint…
duy bui
  • 41
  • 1
  • 7
1
vote
0 answers

How to make the Geoserver SLD with vector layer(linestring geometry) if rasterize gray color lines to RGB color line using RasterSymbolizer Colormap?

I am a starter with the Geoserver. I created lineString vector layer with lineSymbolizer SLD style. And the vector layer is connected by postgis and that layer only have linestring geometry rowdata. other attributes values does not exist(only…
Moses Kim
  • 11
  • 2
1
vote
0 answers

How to rasterize point data in Python and calculate mean over specific value (equivalent to raster() and rasterize() in R)?

I have a large dataframe with coordinate values (lat/long) and a measurement value associated with each coordinate. If I plot the values directly, the points overlap. This is why I would like to create a grid or raster and calculate a mean of all…
soj
  • 11
  • 2
1
vote
0 answers

How to rasterize linestrings by summing length?

I would like to calculate the total length of the linestrings within each raster cell. I have a cumbersome workaround, but I think there is a more efficient way to do this directly with the rasterize function. The following MWE shows what I would…
Jordan
  • 455
  • 6
  • 21
1
vote
1 answer

Using fasterize in R to write a raster

I've been using the fasterize package lately to convert sf polygons to rasters: https://cran.rstudio.com/web/packages/fasterize/fasterize.pdf When I am dealing with large files, it would be better for me to write directly to disk instead of memory.…
TheRealJimShady
  • 777
  • 3
  • 9
  • 24
1
vote
1 answer

Sum pixel values of a raster for each wrld_simpl ISO3 countries

I wish to extract for each ISO3 (column name in the spatial polygon dataframe wrld_simpl), the sum of the pixel values of a raster r. I was thinking of using the function rasterize, followed by zonal, but when rasterising wrld_simpl, I lose the…
Cecile
  • 527
  • 5
  • 22
1
vote
1 answer

convert shapefile of multiple polygons to raster in R

I am in a big trouble in converting polygons to raster in R. What I wanted to do is: I have shapefile (i.e. polygons) of 574 species. That is in attribute table it has 574 rows (i.e., FID is between 0 to 573). A subset of data can be found here:…
Tiny_hopper
  • 380
  • 1
  • 4
  • 15
1
vote
1 answer

Rasterizing a list of shps inR

I've been trying to rasterize a list of shp imported in R. There is an error when I call the list because it is not recognize as dataframe but as a character. I've tryed to use as.dataframe(list[i]) without success. Error: Unable to find an…
crianopa
  • 67
  • 1
  • 7