Tag Info

Hot answers tagged

10

Using GRASS and the r.reclass module, yes. However, you actually need to use the keyword "thru". Example: For a raster elevation grid, to be reclassified into values based on 100m-intervals: 500 thru 599.99 = 500 600 thru 699.99 = 600 700 thru 799.99 = 700 Etc.. And you save that into a notepad text document(with no spaces between lines). Then when ...


10

you can do this with arcpy, if you want. In this code, any input cell with a value 9999 will be set to NoData in the output raster, and the remaining cells will retain their original value. import arcpy from arcpy import env from arcpy.sa import * env.workspace = "C:/sapyexamples/data" outSetNull = SetNull("elevation", "elevation", "VALUE = 9999") ...


9

you can do more with Con than with Reclass, for example you can have continuous output value with Con. You can also use some map algebra within your statement, and you can have multiple inputs. However, if you need an output with a large number of classes, reclass is easier to use because you can use the built-in partitioning methods based on the histogram. ...


8

The first attached script successfully reclassified your AK NLCD data in about 15 minutes (i7, 12GB RAM machine). Since the original dataset is almost 7GB you may be encountering memory issues. If you cannot process the entire dataset in one chunk, try splitting it up with the second script prior to reclassification. My recommendation is to take a small ...


8

beside @R.K. answer, you can use r.null in grass too. r.null - Manages NULL-values of given raster map. EXAMPLES Set specific values of a classified map to NULL: r.null map=landcover.30m setnull=21,22 Set NULL-values of a map to a specific value: r.null map=fields null=99 i hope it helps you...


7

Would it be an option to use r.reclass to assign for example 1 to areas of interest and 0 to others. Then use r.to.vect with the -v flag.


7

yes, r.reclass is for reclassing thematic rasters, like the Corine Land Cover. It will work for your data, but the routine will cast the float numbers to integers before doing the reclass, so it might lead to unexpected results. What you are looking for is r.recode The rules are defined in many formats, one of those is the following: ...


7

I think the RasterCalc plugin should be able to solve your problem. Once you've installed it, you can use the following query (assuming that NULL values corresponds to -9999; you can check this value in Transparency tab of the Layer Properties): eq( [your_raster]@1, -9999, 0 ) eq means equal to. This tells RasterCalc that all pixels in your raster with ...


6

All of the detailed information about MOD12 data can be found in the Algorithm Theoretical Basis Document (ATBD). On page 23, it says that the forest classes require >60% coverage of the pixel.


6

You simply need to use following expression raster A insularis_1@1 > 0 The expression means , set all values greater than 0 as 1 and others as 0.


5

Because the Raster Calculator is a spatial analyst tool, you can utilize the Mask environment. From there, you can use a variety of commands to perform the reclassification: common ones include Con, Pick, Is Null and Set Null, based on your needs. To check if a specific spatial analyst tool honors the Mask environment, simply scroll down to the ...


5

This is a Job for the Field Calculator. See this Python example at Calculate Field examples Parser: Python Expression: Reclass(!WELL_YIELD!) Code Block: def Reclass(WellYield): if (WellYield >= 0 and WellYield <= 10): return 1 elif (WellYield > 10 and WellYield <= 20): return 2 elif (WellYield > 20 and WellYield <= 30): ...


5

In Python: def function(field): if field>4: return "0.5" else: return "A" And below: function(!choose from Fields!)


5

You can use the reclassify function in the raster package to reclassify the DEM. The general idea is to generate a reclass matrix which provides the instructions on how to reclassify the continuous DEM elevation values. require(rgdal) require(raster) # Read DEM and convert to raster layer object dem = raster("C:/temp/dem.tif") # Generate a reclass ...


4

You could use the Raster Calculator to do this, square the pixel values and then extract the roots. Something like this: sqrt ( myraster@1 * myraster@1 ) Regards, Nick.


4

You can actually enter multiple ranges of values as a single entry in the Reclassify tool if you use a semicolon between ranges. An example reclassify input from your screenshot would be: Old Values 333 - 334; 433 - 434 New Values 21. When you click away from your entry (either to run the tool or add another entry), you will see that the tool automatically ...


4

Reclass the lake layer to (0) lake, and (1) Everywhere else that covers the entire river layer (union). Multiply (times) this output by your rivers.


3

whuber made a comment regarding the usage of logical tools to express this reclassification. After a little digging, I found InList, as part of the Logical Math toolset of Spatial Analyst, filled my need. import arcpy # Check out the ArcGIS Spatial Analyst extension license arcpy.CheckOutExtension("Spatial") from arcpy.sa import InList # Pixel values of ...


3

Comprehensive raster functionality is apparently rather new to PostGIS, but the official reference should be helpful: http://postgis.net/docs/manual-2.0/RT_reference.html I think this is the desired function, with examples: http://postgis.net/docs/manual-2.0/RT_ST_Reclass.html And for constructing the reclassarg, the docs are a little hazier: ...


3

Your approach used to work fine in old versions of Arc but not now. You can around this by adding in another value (set to be identical to the old one). One value is usually sufficient unless you have floating point values, in which case I would add the highest and lowest original values (set to be the same as their original value). The values in between ...


3

The easier way is to use GRASS (also using the QGIS/GRASS plugin) and the r.reclass module. You will need to create a reclassification rule file, where you can use the keyword "through" or the wildcard "*" to reclassify multiple values in one rule.


3

Yes another way exists. Just use gdal_calc.py For example, below will convert the values below 3 to 0 and above 3 to 1. You can use equals as well. gdal_calc.py -A C:temp\raster.tif --outfile=result.tiff --calc="0*(A<3)" --calc="1*(A>3)"


3

As discovered in the comments, one row (value = 21) was selected before running Reclassify. The Reclassify tool only considered the selected row, therefore only reclassified those pixels where value = 21, to the new value, 2. Edit: it may be worth noting that there is no mention of whether Reclassify respects selections in the help page. I would be ...


3

If I understand your question you would like specific values assigned to each resulting raster buffer. This can be done by simply assigning values via a index bracket assignment. First, create a raster with a polygon to buffer. library(raster) p <- spPolygons(rbind(c(-180,-20), c(-140,55), c(10, 0), c(-140,-60), c(-180,-20))) r <- raster(ncol=100, ...


2

Doing that, you should have a new vector layer with an attribute containing the values. You then use v.colors to specify the desired color for a given value attribute. See the exemple at the bottom of the given page to understand how the rules mechanism works.


2

With the Advanced Interface option of the toolbox, I use the Reclassify Grid Values from the SAGA GIS, It a really intuitive tool with options of reclassification by single value, range and using a table. I prefer this over the r.reclass because you do not have to create additional files.


2

Seems the bugs you mention with GRASS are a known issue with the standalone version. Nothing to do with mapcalc... this was a packaging issue that has been solved on osgeo4w and now is just needed to wait for updated standalone installers. Réf : https://hub.qgis.org/issues/8529


2

If you provide more detail on how you reclassified and the specific raster calculation used to get the empty data raster (usually indicated by -3e20 to +3e20) that will be helpful in troubleshooting the problem. Assuming ArcGIS with Spatial Analyst, if reclassify and raster calculator are giving you empty output then try the following two tools to achieve ...


2

For your collection of avalanche simulations, Find the minimum and maximum values. Use the Cell Statistics tool to accomplish this. Build a Remap table using the min/max values from step 1. Format it as described in the help section of the Reclassify by Table tool. Use the Reclassify by Table tool to reclassify your simulation results to a common scale(as ...


2

I recently ran into this limitation when creating an esri addin toolbar. I was limited to the option that Chris R mentioned, creating and saving a template layer with my python code. It was fairly simple and works remarkably well. To not hard code the path to the symbology layer, I used os.path to get the path of the layer saved with the python code... ...



Only top voted, non community-wiki answers of a minimum length are eligible