Learn R Programming

RPyGeo (version 0.9-3)

ArcGIS Geoprocessing Tools: Wrappers for selected ArcGIS functions

Description

Wrappers for a small selection of ArcGIS geoprocessing functions based on the rpygeo.geoprocessor.

Usage

rpygeo.EucDistance.sa(in.data, out.raster, maxdist = NULL, cellsize = NULL, out.direction.raster = NULL, env = rpygeo.env, ...) rpygeo.Hillshade.sa(in.raster, out.raster, azimuth = 315, altitude = 45, model.shadows = c("NO_SHADOWS", "SHADOWS"), z.factor = 1, ...) rpygeo.Slope.sa(in.raster, out.raster, unit = c("DEGREE", "PERCENT_RISE"), z.factor = 1, ...) rpygeo.Aspect.sa(in.raster, out.raster, ...) rpygeo.Curvature.sa(in.raster, out.curvature.raster, z.factor = 1, out.profile.curve.raster = NULL, out.plan.curve.raster = NULL, ...) rpygeo.Delete.management(in.data, data.type = NULL, ...)

Arguments

in.raster, in.data, out.raster, out.curvature.raster, out.profile.curve.raster, out.plan.curve.raster
Names of ArcGIS raster or vector datasets or feature classes in a geodatabase (relative to the current workspace defined in a rpygeo.env environment). Shapefiles must include the extension ".shp".
env
A list defining an RPyGeo working environment as built by rpygeo.build.env.
maxdist, cellsize, out.direction.raster
see ArcGIS online help
azimuth, altitude, model.shadows, z.factor
see ArcGIS online help
unit, data.type
Arguments to be passed to the Python geoprocessing function. See ArcGIS help files for information on the usage of scripting commands and their arguments.
...
Additional arguments to be passed to rpygeo.geoprocessor.

Value

The function return NULL if no error occurred, otherwise a character vector containing the error message.

Details

These functions simply try to replicate the behaviour of the ArcGIS/Python geoprocessing functions of the same name. See rpygeo.geoprocessor for details on what happens behind the scenes.

ArcGIS 9.2 online help for the georpocessing tools can be accessed through the following URLs:

See Also

rpygeo.geoprocessor, rpygeo.build.env

Examples

Run this code
# Allow ArcGIS to overwrite existing datasets:
## Not run: rpygeo.env$overwriteoutput = 1
# # Calculate the slope of a DEM raster dataset
# # in the current ArcGIS workspace:
# rpygeo.geoprocessor("Slope_sa",c("dem","slope"))
# # Same:
# rpygeo.geoprocessor("Slope_sa('dem','slope')")
# # Same, using the more convenient wrapper:
# rpygeo.Slope.sa("dem","slope")## End(Not run)

# Three at a time or separately:
## Not run: date()
# rpygeo.geoprocessor("Slope_sa('dem','slope')",
#   "Aspect_sa('dem','aspect')", "Hillshade_sa('dem','hshd')")
# date() # ~20 sec on my computer
# rpygeo.Slope.sa("dem","slope")
# rpygeo.Aspect.sa("dem","aspect")
# rpygeo.Hillshade.sa("dem","hshd")
# date() # ~50 sec
# rpygeo.Delete.management("slope")
# rpygeo.Delete.management("aspect")
# rpygeo.Delete.management("hshd")## End(Not run)

# Calculate the Euclidian distance from railway lines
# up to a max. distance of 1000 map units:
## Not run: rpygeo.geoprocessor("EucDistance_sa",
#     args=list("rail.shp","raildist",1000))
# # Same:
# rpygeo.EucDistance.sa("rail.shp","raildist",maxdist=1000)## End(Not run)

# Use MapAlgebra to calculate a distance-decay function:
## Not run: rpygeo.geoprocessor("SingleOutputMapAlgebra_sa",
#     args=c("exp( raildist / -100 )","distdecay"))## End(Not run)

# Or why not in just one step if you like MapAlgebra:
## Not run: rpygeo.geoprocessor( "SingleOutputMapAlgebra_sa",
#     args=c("exp( EucDistance( rail.shp, \#, \#, 1000 ) / -100 )","distdecay") )## End(Not run)

Run the code above in your browser using DataLab