New answers tagged

0

For large raster files you can use r.mapcalculator in QGIS Processing Toolbox.


1

Sadly the Nibble tool requires an integer input. However, you could create an integer grid by multiplying you data by a factor equivalent to your acceptable scale. So, if you can accept, say five decimal places, create an integer grid from your raw input raster by multiplying by 100000. Perform the nibble and then divide by the same factor. Obviously ...


0

An average point spacing of 0.3 is approximately equal to a point density of 11 returns per unit of area. In theory, it should be sufficient to generate a DSM with pixel of area 1. As explained here, my understanding of a LiDAR DSM is: DSM as a raster. This represents the first echo the laser received for each laser pulse sent out, and represents the ...


1

Your raster and your polygon do not overlap. If they do: > r1 = raster(extent(c(107,110,38,40))) > polygon_mus <- extent(c(107, 111, 37, 40)) > cell <- extract(r1, polygon_mus) Then that works. If they don't: > r1 = raster(extent(c(112,114,38,40))) > cell <- extract(r1, polygon_mus) Error in (function (classes, fdef, mtable) : ...


0

I used rasterToPolygons from the raster package too in the past, but now I prefer gdal_polygonizeR by John Baumgartner. It bases on gdal_polygonize.py and is much faster. John Baumgartner published the code and gave an example for usage in his blog. If you are familiar with python you could use gdal_polygonize.py directly of course.


1

Gdal Installation Install Gdal command line tools and add it to path environment variable. e.g. in windows: path = %path%;C:\Program Files\GDAL Download and install gdal python bindings from here according to your python and OS. install it using: pip.exe install GDAL-2.0.2-cp27-none-win32.whl You may encounter issues while installing gdal. Please ...


0

There is a workflow to fill in NA values by the nearest non-NA value in R here. You can easily set a maximum distance (in map units/meters).


2

If all you need to do is move the origin of your raster slightly, i.e shift the pixels, you can use the Shift tool in ArcGIS Summary Moves (slides) the raster to a new geographic location, based on x and y shift values. This tool is helpful if your raster dataset needs to be shifted to align with another data file. Illustration


0

Try the following workflow: Buffer your coastline feature Intersect the buffered coastline with the fishnet polygons Run Zonal Statistics as Table with a "SUM" statistic Use Join Field to join the zonal statistics table with the intersected fishnet polygons (i.e. based on the OID or FID)


0

It seems the size data will be used to select the surrounding pixel and around the center pixel of your choice. Size = c(1,1) will give you the output not only of the center pixel(or the point) but also 8 neighboring pixels. So if you want to download the data only for the concerned point then give 'Size' value as c(0,0). See the Vignettes for more detail. ...


-1

Figured it out. Spatial Analyst Tools -> Neighborhood -> Focal Statistics


1

What you want is probably no raster in the classic way. (in a classic way you would have a band for each land use) Probably you want to use a polygon-raster, which is a feature class consisting of regular polygons (squares for example with 1 mile size). You can create it with the tool "Create Fishnet". After you have your polygon raster you use intersect on ...


0

If you're willing to use TileMill and MBTiles, you can do this pretty easily using CartoCSS to style the original Tiff, and output an MBTiles file. #dem { raster-opacity:1; raster-scaling:lanczos; raster-colorizer-default-mode: linear; raster-colorizer-default-color: transparent; raster-colorizer-stops: stop(0,#aaf) stop(100, #afa); } ...


3

You could try this: 1) Create a simple style in Layer properties, then save it to an export file using the save button. These are in the form: value, R, G, B, Alpha, label 2) Use r.category in the grass (6 or 7) toolbox of the processing module. This should provide a list of raster values. Copy these values. You can use r.quantile for continuous data. ...


3

Another nice work around I regularly use to insert my company's logo with a transparent background is to add an additional dataframe in layout view. Then bring the transparent background tif or png in as a layer, zoom to layer, go to the symbology tab in layer properties change Stretch to none and Display background value (R,G,B, / 0,0,0) as hollow. Ensure ...


6

You can create a customized style scheme, something like unique categories but you'll have to add all the categories manually ( Atleast I have to, but I'm using an older version of QGIS ). Right click the raster -> properties -> style. In there choose singleband pseudocolor as the Render type and click on the little red plus to add your own values and ...


0

I get an error meassage that MrSID.dll can not be found, but it is not needed for Geotiff output, and I get the expected raster result: Your project CRS is EPSG:4326, so the grid cell size should be in degrees. The default of 100 might be nonsense.


0

As a previous answer stated, I would make sure that both data sets are in the same projection. Another setting to look at would be under the "Environment settings" >> Raster Analysis. You can set your mask here to your clipping layer. You could also look at Processing Extent but that requires another raster as input. A final solution I would try would be ...


0

A possible reason might be that vi (which you pass on to whittaker.raster) does not exist. Please provide the error message in order to clarify this issue. Note that MODIS has been moved to GitHub a while ago. You can easily install the latest versions via (stable version) devtools::install_github("MatMatt/MODIS") (development version) ...


1

Try to dissolve the polygons and create only one polygon and use that as a clip polygon. But make sure the projection for both the raster and polygon shapefile is same. Different projections will not give you the desired result. Because if the projections of input polygon and raster are different, the clip based on feature extent will not be activated. If ...


1

The output of extract is a list of cell numbers and values stored in matrices, it needs tidying to a data frame. (Data frames are best since they can store different types of data, like integer cell numbers and numeric values - which is essentially what cellnumbers=TRUE is for). library(raster) r <- raster(volcano) ## simplify the values r <- (r %/% ...


1

The filter is only applied to a single band. If you want to apply the filter on every band, you should do it on each band separately, then build a stacked image from the filtered bands. The best way to do that is to create a python program that loops over each band (when they are separated images not in stack form) to filter the images, then create a stacked ...


1

I've tried this approach. It's a fast way to do this, compared to the usual way, but it has limitations. The usual way The traditional way to do this is a spatial join. You read off the county name attribute of the first polygon you find which the point overlaps. The quickest way is to import these polygons into Postgres with shp2pgsql and do something ...


0

This may be too obvious, but your screenshot indicates that the layer you are trying to display is beneath the basemap in the TOC. Try to move it above the basemap to display it. Further, do you need to use the AGO Basemap for your purposes? Does the raster initially display correctly, before adding the basemap? Do you get any Geographic Transformation ...


1

You could use the the original raster image and replicate it in a image processing tool like gimp (see instructions under this link) Afterwards you adjust the header information of the new raster image multiplying the extent by the amount of replicates. However, I am sure this would also by possible in ArcPy.


0

You could transform the sea level rise raster to a vector format. Than you can use an intersection analysis to select the lines that are affected.


0

Well, after a long search I could find the solution. Extract by Mask tool in spatial analyst toolbox can be the best solution to this question.


1

The intersect tool in ArcMap may be what you're looking for: http://help.arcgis.com/EN/ARCGISDESKTOP/10.0/HELP/index.html#//00080000000p000000 -Intersect will combine the overlapping section of both datasets and if that isn't exactly what you're looking for, clip might do the job: ...


0

I would probably start by reclassifying your raster on the various bands and seeing how best you could isolate that specific green. I find the identify tool and checking out multiband scatterplots or histograms to be most helpful here. Once you get those depressions on one band and classify the rest as "NoData" running a Vectorize raster function should be ...


0

Solution: I changed the order of the coordinates in the netcdf file, using the NCO operators (http://nco.sourceforge.net/nco.html#ncpdq-netCDF-Permute-Dimensions-Quickly) ncpdq -a lat,lon in.nc out.nc I am guessing that the R raster package expects the latitude variable to come before the longitude variable, although I haven't run across that in the ...


0

Ok I use this NDVI.slope[NDVI.slope>0.03] <- NA In stead of NDVI.slope_2<-trim((NDVI.slope), padding=0, values = c(0.02:0.03)) ................ and It work !!!!! ...................


1

You could use something like the following: import processing lddLrs = qgis.utils.iface.legendInterface().layers() path = "path/to/results//" for lyr in lddLrs: processing.runalg("saga:rastercalculator", lyr, None, "(a/a)*a", True, 7, path + lyr.name() + "_suffix.tif") EDIT : If you want to use the QgsRasterCalculator, you could try using the ...


2

You can access the attribute table if the pixel values are in integer type because opening attribute table of float type raster is not possible. If you have ArcGIS, you can open the attribute table after converting the float type raster into integer type, but unfortunately, this cannot be done in QGIS even if you converted your raster to integer type. Check ...


4

Multiply everything by orders of magnitude until you are working with integers rather than decimals. In other words, if your raster has values of 1-10, and you want to reclassify some of those values to 0.003, multiply your integer raster by 1000 so that its values range between 1000 and 10000. Then instead of reclassifying to 0.003, reclassify to 3. After ...


1

When using the Raster Calculator in ArcToolbox (version 10.3.1) the Con function is expressed as follows for a raster that is named "streams": Con(IsNull("streams"), 0, "streams") this returns zero if streams is null else it returns the value of streams. In this example all NoData pixels in the Streams are set to zero, otherwise they contain the pixel ...


5

Something like this would do the trick: Con(Con(**input_raster**,Mod(**input_raster**,128))==0,**input_raster**) Let's break this apart: The inner Con statement takes your input raster as a conditional raster and returns its modulus against test value (in this case 128). The Mod function returns zero where the number is divisible by your test value, If ...


1

Still not aware of any Arc tool that does this satisfactorily, but I posted a script here: Exporting 3GB ArcGIS Raster to KML without losing resolution?


2

In the search box in ArcMap type, "To KML"; there are two tools. Layer to KML: "This tool converts a feature or raster layer into a KML file containing a translation of Esri geometries and symbology. This file is compressed using ZIP compression, has a .kmz extension, and can be read by any KML client including ArcGIS Explorer, ArcGlobe, and Google Earth." ...


0

I resolved it using @mdsumner suggestions plus some tweaks: As suggested by mdsumner I used calc to get which values where of the values I needed, however this only gave me a 0 or 1 value, and I needed a 0 to 1 continuous landcover area type of thing, so then I used aggregate, and just selected how coarser my raster would be. It worked just as I needed with ...


1

I don't believe what you are asking can be done but an alternative solution is this: Convert your raster data to points Create a unique ID field and populate it with unique numbers Convert your point dataset back to a raster using the unique ID as the value field Convert this raster into a polygon vector dataset, as each cell in the raster has a unique ...


3

Ok, this is not really an answer to the my question, but if you are interested in the biomass map I found a link from where you can download the actual data: http://whrc.org/publications-data/datasets/pantropical-national-level-carbon-stock/


1

In QGIS, you could use the pktools plugin (Under Experimental Plugins) to calculate the proportion of classified pixels per polygon. In the following example, the classification output has three classes (1:3) and there are three polygons for which I would like to calculate the proportion of pixels per class in each polygon. Using the extract vector sample ...


1

You could try the following: Polygonize your raster (Raster > Conversion > Polygonize) Intersect your polygonized layer with your main polygon layer (Vector > Geoprocessing Tools > Intersect) Download/install the GroupStats plugin and use the result layer to calculate the sum of area for each classification: Example: Here's an ...


3

If you reproject a raster to a different projection, the cell sizes do not match to the original. For this reason, the new cell value will be calculated with respect to neighbouring cells as a weighted mean value. In your original files, both cell sizes matched exactly (0.000833333 degrees), and the cell values were identical. But after reprojection, cell ...


2

If you have ArcGIS with Spatial Analyst extension, you can use tabulate area to calculate the area of each class under each polygon. In QGIS, there is no direct way to do that, but you can try "Cross-classification and tabulation" under Processing Toolbox -> SAGA -> Grid - Analysis. It may do the same thing.


1

You should use something like: gdal_translate -of GTiff zoom13.mbtiles export.tiff The reason for the -of GTiff part is that the default output is TIFF, with external georeferencing, rather than GeoTIFF. See http://www.gdal.org/frmt_gtiff.html If you want to rebuild the overviews (similar to what you probably have in mbtiles), gdaladdo will probably help: ...


2

I´m not quite sure,if what bugmeont suggested is correct. I guess if both layers are equal the outcome of the new one should be a layer with zeros and not with no-data values. edit: also yourpicture shows 0 there, where there is no overlap and NaN where you have overlap, which also does not fit to the explanation.


3

UPDATE: The above-mentioned approach by Oscar Perpiñán found here seems to work, if I only take a subset of the matrix the way Oscar did. For that to work I needed to know the subset boundaries and the static files, both available online for a few regions (such as North Africa). m = m[700:1850, 1240:3450, drop = FALSE] lon = raster("NAFR_LON.img") lat ...


7

Your attempt is designed to fail. If you look at the image, you see the data arranged as a circle, with black triangles in the corners of the square, where the satellite view goes right into orbit. In your test data, you see only NODATA -32768 for those parts of the image. The extent is between +/-75 and +/- 78, but these values are only reached in the ...


8

Oh will you feel silly! ;-) The result is actually correct. The two rasters are identical where they overlap. Where they do not, the result is NaN because you cannot do math with a non-existent value.



Top 50 recent answers are included