New answers tagged

0

One way to do this would be to add an attribute to your polygon layer, say "VALUE", and assign it numeric value of 1000 or more. Then convert the polygon layer to a raster. In arcpy using the spatial analyst module these rasters can be multiplied easily. elevRast = arcpy.Raster("path/elevrast") polyRast = arcpy.Raster("path/polygonraster") resultRast = ...


3

You are confusing terms and thus, confusing us. The expected input for kriging prediction in the gstat krige function is a systematic array of points and not polygons. It would also be nice if you provided a reproducible code example of what you have tried. You can use the extent of an sp object to create an array of points for the kriging prediction using ...


0

I found the answer somewhere on this forum. Go to control panel - programs (uninstall) and click on ArcMap, then Repair. After repair, everything will work. I think my CC Cleaner changed something in the registry.


3

You can try using the Topology Checker Plugin to identify all the polygons in your layer that overlap. Just add your polygon layer in the Topology Rule Settings window, in the rules add must not overlap. Validate to check the errors (effectively identifying all the overlapping polygons). Alternatively you could add your data to PostGIS and use spatial ...


0

In either instance if you are using the ESRI zonal stats tool or using Arcpy to call the Zonal stats function a resampling occurs if the zones and the raster are not at the same resolution. This is from the ESRI documentation. When the zone and value inputs are both rasters of the same resolution, they will be used directly. If the resolutions are ...


1

If you don't have the spatial analyst extension or want to use Numpy, you can convert your x and y point coordinates to the row and column that is close to that point. The Extract Values tools have many more options, and produce slightly different results than those in the code below. I'm not advocating one method over another. I also don't know if this ...


0

There are a few more steps steps you must take. Use the Flow Accumulation (Spatial Analyst > Hydrology tools) tool to create a flow accumulation grid. Create a stream network using the raster calculator tool (Spatial Analyst > Map Algebra). You should enter a funtion like: SetNull("[Flow Accumulation Grid]<[flow accumulation threshold],1) [brackets] ...


2

In addition to the tool pointed out by HDunn, you can use Extract Multi Values to Points if you have many raster data with the same point shapefile. Here is another snippet from ArcGIS help. import arcpy from arcpy.sa import * from arcpy import env env.workspace = "c:/sapyexamples/data" ExtractMultiValuesToPoints("observers.shp", [["elevation", "ELEV"], ...


1

If you're already using ArcPy, You might as well use the Extract Values to Points tool (assuming you have Spatial Analyst extension) Here's the code snippet from ESRI's site ExtractValuesToPoints("rec_sites.shp", "elevation", "C:/sapyexamples/output/outValPnts","INTERPOLATE", "VALUE_ONLY") Iterate over your raster ...


0

Found my error using a slope raster in percentage rise rather than degrees.


1

Try something like this: import arcpy Set the workspace to the folder where you have your data arcpy.env.workspace="Path:\to\your\data\" for raster in arcpy.ListRasters(): Create an object storing the st. dev. for the raster file: stdev_object=arcpy.GetRasterProperties_management(raster, "STD") Store the numeric value of st. dev. in the ...


1

I'll give it a go. Begin by loading your raster. rast = arcpy.sa.Raster(pathtorasterfile) Find the mean, standard deviations, minimum and maximum: meanValue = rast.mean std = rast.standardDeviation minR = rast.minimum - .1 #just a little buffer room maxR = rast.maximum + .1 #just a little buffer room Setup the bounds: target = meanValue + (2*std) ...


5

At the bottom of the help page for each tool, ESRI provides a list of the environments that can impact the tool's processing. For example, the Resample help page does not include Mask in its list. It does not include Cell Size in its list either, because the cell size option that is a direct and required input to the tool would overwrite it anyway. The ...


0

As with the Con tool, you can accomplish this using Reclassify, which is usually what I do (which doesn't make it the right way). rast = arcpy.Raster(ef) rast_fill = arcpy.sa.Fill(rast) rast_direc = arcpy.sa.FlowDirection(rast_fill) rast_accum = arcpy.sa.FlowAccumulation(rast_direc) minr = da_rast.minimum-1 maxr = da_rast.maximum+1 remapRangeValues = ...


0

Use lookup in reclassify toolbox to convert your zones raster to floating point raster. Export it ASCII afterwards


3

The results of zonal stat is one line per unique value in your raster, so this cannot be converted into a new raster without information about the position of each value. What you can do is joining your table with the original raster with zone values and then work on it. Make sure that you first "build raster attribute table" in order to do the join.


1

Tool cannot understand condition. Try whereClause= '"Value > %s"' %threshold BTW it is not clear what you are trying to achieve. I guess Con can do it easier. Please expand your question Flowacc= arcpy.Raster(path) Con(Flowacc>threshold, 1)


0

I work with multiple raster layers and always try different parameters to get the best results. You can try to run the tool under "Majority" method instead of "nearest. Also, use your environments to set this: "Processing extent" = your original raster "Snap Raster" = your original raster "Raster Analysis" = specify your Cell size


0

You may have to do them one-by-one. You need to establish an if-block. Here's an example in python format: = ifBlock(!Geomorphic_Compatibility!,!GeomorphCompat!) code block: def ifBlock(Geomorphic_Compatibility, GeomorphCompat): if Geomorphic_Compatibility is None: return GeomorphCompat else: return Geomorphic_Compatibility ...


0

A similar question was asked a few days ago here. You would reference the objectID in this case by the sounds of it. code sample from link: prev=None def diff(curr): global prev if prev is None: prev = curr res = curr - prev prev = curr return res


1

I have been facing problems with these HDF file format of MODIS. Right now i have written script in arcpy which does same thing as MRT tool does. If your problem still persists please download code from this link of mine. Its my github. An modify the code as you wish to. Presently it can handle 5GB of HDF in one run. I am working on another project where ...



Top 50 recent answers are included