data types and geoprocessing - R-ArcGIS/r-bridge-install GitHub Wiki
- Numeric
- Integer
- Complex
- Logical
- Character
- Numbers
- Text
- Dates
- BLOBs
- Object identifiers
- Global identifiers
- Fields of type raster
- Geometry
A cross walk between commonly used ArcGIS and R data types:
ArcGIS type | R type | example value |
---|---|---|
Address Locator | Character | Address Locators\\MGRS |
Any | Character | |
Boolean | Logical | |
Coordinate System | Character | full WKT text example1 |
Dataset | Character | "C:\\workspace\\projects\\New_Shapefile.shp" |
Date | Character | "5/6/2015 2:21:12 AM" |
Double | Numeric | 22.8791827391 |
Extent | Vector (xmin, ymin, xmax, ymax) | c(0, -591.561938958707, 1000, 992) |
Field | Character | |
Folder | Character | full path, directly usable with file.info, file.exists, etc |
Long | Long | 19827398L |
String | Character | |
Text File | Character | full path |
Workspace | Character | full path |
"PROJCS[\"WGS_1984_UTM_Zone_19N\",GEOGCS[\"GCS_WGS_1984\",DATUM[\"D_WGS_1984\",SPHEROID[\"WGS_1984\",6378137.0,298.257223563]],PRIMEM[\"Greenwich\",0.0],UNIT[\"Degree\",0.0174532925199433]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"False_Easting\",500000.0],PARAMETER[\"False_Northing\",0.0],PARAMETER[\"Central_Meridian\",-69.0],PARAMETER[\"Scale_Factor\",0.9996],PARAMETER[\"Latitude_Of_Origin\",0.0],UNIT[\"Meter\",1.0]]"
Potential future additions:
- coded value domains
- raster data
- Geoprocessing environment settings
- Writing messages in script tools
- Controlling the progress dialog box
Messages comparison:
R method | ArcPy method |
---|---|
arc.progress_pos() |
arcpy.SetProgressPosition() |
arc.progress_msg() |
arcpy.SetProgressorLabel() |
print() or cat()
|
arcpy.AddMessage() |
warning() |
arcpy.AddWarning() |
stop() |
arcpy.AddError() |
message() |
arcpy.AddWarning() |
From R:
‘message’ is used for generating ‘simple’ diagnostic messages which are neither warnings nor errors, but nevertheless represented as conditions. Unlike warnings and errors, a final newline is regarded as part of the message, and is optional. The default handler sends the message to the ‘stderr()’ connection.
In tool_exec(list(adr = NULL, bool = TRUE, coorsys = NULL, dataset = NULL,...
:
An R geoprocessing script is provided a list of values, with the names set to the parameter names, and any empty values set to NULL
.