The default function in raster::rasterize is to see if a point is within a polygon and if yes, make a cell. This results in that some of the outer parts of the polygon is not covered by the new raster.  Is it possible to use rasterize (or fasterize or whatever) in a way, so that the entire polygon is covered?
49106
I want to mask out a raster based on the values of a polygon: i.e., set to NA all values of the raster that are not covered by the polygons. However, it seems that raster::mask() masks out cells (i.e. set them to NA) even if they are partially covered?  This is similar to the question: , but unlike crop(), mask() does not have the snap="out" option.   Check: here the right point of the triangle touches a cell, yet that cells is masked out.   library(raster) library(sp)  r &lt;- raster(xmn=1, xmx=5, ymn=1, ymx=5, nrows=4, ncols=4) r[] &lt;- 1:length(r)  Sr1 = Polygon(cbind(c(2,4,4,1,2),c(2,3,5,4,2))) Sr2 = Polygon(cbind(c(4.1,4,2),c(2,3,2)))  SpP = SpatialPolygons(list(Polygons(list(Sr1), "s1"), Polygons(list(Sr2), "s2")), 1:2)  plot(mask(r, SpP)) plot(SpP,  add=TRUE)
72378
I have float raster and now I want to convert it to vector. How is it possible with the Python GDAL library?  I have tried with gdal_polygonize.py of GDAL utilities on the command line and it worked excellently. But this utility is based on GDALPolygonize() of C++ library and I want to C++ method GDALFPolygonize() to be used instead, which manipulates float raster data as far as I know.
36786
I often run into this issue. I'm creating a file in Photoshop with masked layers etc. I want to make the final output available for some mock-ups in Illustrator, so I rasterize the layers and marquee select the entire area, copy and move to Illustrator.  Pasting the area in Illustrator flattens all transparencies, which is quite annoying. I'm left with my object and a flat white background.  Is there a reason for this?
32832
I have a raster and a vector point file. I need to generate another raster of same resolution showing how many points are inside the corresponding pixels of the original raster.  Something like that:   Is there a way of doing that in QGIS?   I just want the number of points, no attributes involved.
98176
I need to apply the  in a polygonal shape in a way that I do not need to choose manually each color to put in each region. I wish to knows if there is any extension, plug-in, script or data base that may be used with ArcGIS and ArcToolBox to do it mathematically or programatically, so I could use it for now on with every map I come to create.
98185
I'm trying to convert a shapefile into a raster within R. My approach is to read in the raster as follows:  library(rgdal) # Loads SP package by default demo &lt;- readOGR('F:/data/', 'shapefile') # Creates a SpatialPolygonsDataFrame class (sp)   This works fine, and I can plot it. However it is a large shapefile and I want to convert it into a raster. I've tried the following:  r &lt;- raster(ncol=180, nrow=180) Demo_ras = rasterize(r, demo, 'pop')  # pop is an integer here   Error message:  Error in function (classes, fdef, mtable)  :    unable to find an inherited method for function "rasterize", for signature "RasterLayer", "SpatialPolygonsDataFrame"   I'm slightly confused which is the correct order of the arguments. I've also tried this:  Demo_ras = rasterize(demo, r, 'pop')   Which results in the follow error:  Error in .polygonsToRaster(x, y, ...) :    polygon and raster have no overlapping areas   While it makes sense that a raster cannot be generated for an area that does not cover the SpatialPolygonsDataFrame, I'm not sure what information I need to specify so that the raster should contain the SpatialPolygonsDataFrame area.
20066
I have two raster files that are the same cell size but I cannot get them to align properly. (I want the black to line up with the pink)    When creating the black raster file (from using polyline to raster), I imported the pink raster in the Snap Raster section in the Environments setting. I thought that Snap Raster was supposed to make it line up?  Am I doing something wrong or is it a bug in Arc (I remember reading that this was a problem about two years ago), and if it is a bug is there a work around?  I have also read there is a Raster Shift, but I'm not sure what to enter in the X Coordinate and Y Coordinate. Since I only want the black raster to shift down, I know that the X Coor = 0 and the Y Coor should be negative something, but what are the units?  Thanks.
39814
I have a DEM that I would like to smooth or generalize to remove topographic extremes (chop off peaks and fill-in valleys). Ideally, I would also like to have control over the radius or level of "blurriness". In the end, I will need a set of rasters that range from slightly blurry to really blurry. (Theoretically, the blurriest would be a constant raster of the arithmetic mean of all values).  Are there any tools or methods I can use (based on Esri, GDAL, GRASS)?   Do I need to home bake my own  routine?   Could I use a low-pass filter (e.g. ArcGIS's ), and if so, would I need to run it a bunch of times to get the effect of a large radius?
35118
I want to reclassify landcover image manually with respect to online imagery. I am looking for a software/plugin/script to manually select raster pixels using polygon selection tool and could be able to enter new value.  I have Arcgis with spatial analyst license.
83700
Is it possible to create buffers for pixels of raster files? Actually I need to expand the pixels classified as 1 (in white in the figure) with a spatial range of 1 or 2 pixels, in order to perform some generalization.  I'm using QGIS, is this possible with gdal or something?
27250
I originally had an IMAGINE Land Cover raster file that I opened in ArcMap.   I used the Extract Feature from Raster to extract only the Developed class and saved it (still IMAGINE).   Then I used the Copy Raster to convert the IMAGINE to GeoTIFF, but when I try to view the GeoTiff in Google Earth or Photoshop, it doesn't display anything.   However, in ENVI, it displayed successfully.   What am I doing wrong?
16358
I received a raster that was resampled using the Save as dialog in QGIS. Now I need to describe the resampling process in a report. But I could not figure out the method used in the resampling. Is it Nearest Neighbor? Bicubic?  This question has been asked before () but the answer does not specify the method used.   I also tried looking at the QGis source code in GitHub, but unfortunately, I could not find where the magic takes place (I'm not a programmer)
94368
I'm converting series of raster to polygon using RastertoPolygon in arcpy.  #import the module import arcpy from arcpy.sa import * from arcpy import env arcpy.CheckOutExtension("Spatial") env.overwriteOutput = True  #set the workspace env.workspace = r"C:\thesis\for sampling\sampling_outputs\raster_per_biogeoregion"  #Get a list of rasters and convert to shapefile for raster in arcpy.ListRasters("*Luzon_*.tif", "TIF"):     print raster #check the presence of rasters     arcpy.RasterToPolygon_conversion(raster, raster.replace("tif", "shp"), "NO_SIMPLIFY") print "Finish converting all the rasters to polygon"   After several checks on the syntax, formatting, I've always been stuck with this error:    Traceback (most recent call last):  File "C:\Users\brentiebark\Dropbox\Python Scripts and          mxds\batch_convert_raster_to_polygon_simple.py", line 14, in &lt;module&gt; arcpy.RasterToPolygon_conversion(raster, raster.replace("tif", "shp"), "NO_SIMPLIFY")  File "C:\Program Files (x86)\ArcGIS\Desktop10.1\arcpy\arcpy\conversion.py", line 178, in RasterToPolygon raise e ExecuteError: ERROR 010328: Syntax error at or near symbol SPACE. ERROR 010267: Syntax error in parsing grid expression. Failed to execute (RasterToPolygon).   Are there things that I missed from this code?
110374
I need to convert files. I'm trying to use gdal_rasterize   gdal_rasterize -b 1 -burn 0 -l file file.shp work.tif   and the output is the following:     ERROR 10: Pointer 'hDS' is NULL in 'GDALGetProjectionRef'. Warning 1:   The input vector layer has a SRS, but the output raster dataset SRS is   unknown. Ensure output raster dataset has the same SRS, otherwise   results might be incorrect. Segmentation fault (core dumped)
110627
I have a large number of rasters with 3 bands (R,G,B). What I want to do is add all 3 bands of each raster together to end up with a single band image with the summed R,G,B values in each pixel but I'm not sure how to do this in ModelBuilder. Do I have to somehow split each raster first, then add each one?  How would I iterate through each band of every raster?  Edit:Basically this is what I have so far. Right now it will take 3 bands of 1 raster and add the bands then go on to create a polygon of a certain reclassed area. I want to do this on a large number of rasters but am unsure of how to make it work.
56742
From  it appears you would want a four-element position vector, as it is simpler to modify its position with matrix multiplication.  On its own this would imply the fourth element should simply be ignored when considering it as a representation of a 3D point (assuming no transformation), but I know this is not true, as when I supply a vector4 to the GPU, if the fourth element is not one, it is not rendered - why?  What is the significance of the fourth element, once it is in the rasterizer?   EDIT: On review this question was somewhat poorly worded; it would be more accurate for the second paragraph to say: "if the value of the fourth element is not within a certain range, it is not rendered 'correctly'/'as expected'".
64444
I am trying to use the tool  on a File Geodatabase raster, but I am getting some weird errors.  I've used this tool multiple times before with no issue, but not since I upgraded to 10.1, so I'm wondering if there is an issue with it.  The errors I got back so far have been:   This error happened when I specified a shapefile as the output: The specified geodataset is invalid for the conversion. The syntax help for the tool you are using should indicate the supported types of input data. For example, for the particular conversion, a rasterlayer may be an invalid type of geodataset.  Next I have an error about it needed at least one band in the raster, the raster does has one band. This occurred when I specified a File Geodatabase as the output. Finally I had the good ole Error: 999999 for no apparent reason.   The raster is a DEM derived from LiDAR that was not created by a different company. It's too large to be made available for testing, but here are its specs:  Raster_Information  ColumnsandRows  5119,8241 NumberofBands   1 CellSizeXY      1, 1 UncompressedSize    160.93 MB Format      FGDBR Source_Type     Generic Pixel_Type  floating point Pixel_Depth     32 Bit Colormap    absent