# 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:
## Not run: rpygeo.geoprocessor("Slope_sa",c("dem","slope"))
# Same:
## Not run: rpygeo.geoprocessor("Slope_sa('dem','slope')")
# Same, using the more convenient wrapper:
## Not run: rpygeo.Slope.sa("dem","slope")
# Three at a time or separately:
## Not run: date()
## Not run: rpygeo.geoprocessor("Slope_sa('dem','slope')",
# "Aspect_sa('dem','aspect')", "Hillshade_sa('dem','hshd')")## End(Not run)
## Not run: date() # ~20 sec on my computer
## Not run: rpygeo.Slope.sa("dem","slope")
## Not run: rpygeo.Aspect.sa("dem","aspect")
## Not run: rpygeo.Hillshade.sa("dem","hshd")
## Not run: date() # ~50 sec
## Not run: rpygeo.Delete.management("slope")
## Not run: rpygeo.Delete.management("aspect")
## Not run: rpygeo.Delete.management("hshd")
# 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))## End(Not run)
# Same:
## Not run: rpygeo.EucDistance.sa("rail.shp","raildist",maxdist=1000)
# 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