GGdist | R Documentation |
Calculate a distance matrix for a set of points based on in-water distances, using a raster-based approach.
GGdist(
Water_map,
Points,
EndPoint = NULL,
Latitude_column,
Longitude_column,
PointID_column,
Points_crs = 4326,
Water_map_transitioned = NULL,
Calculation_crs = 32610,
Grid_size = 75
)
Water_map |
Object of class sf representing a map of all waterways in your region of interest |
Points |
A dataframe of points with latitude and longitude which you would like to calculate distance to a given reference point. |
EndPoint |
A dataframe containing a single point with latitude and longitude. Defaults to a point 92 m East of the Golden Gate (37.819539, -122.477). Latitude and longitude column names must be the same as the points data frame. This point must fall within the bounds of the |
Latitude_column |
The unquoted name of the column in the |
Longitude_column |
The unquoted name of the column in the |
PointID_column |
The unquoted name of the column in the |
Points_crs |
Coordinate reference system for your |
Water_map_transitioned |
A rasterized, transitioned, and geo-corrected version of the water map. This is optional to save time if you will be running this function frequently with the same base map. |
Calculation_crs |
Coordinate reference system used for the calculation. If a latitude/longitude system are used, errors may be returned since some calculations assume a planar surface. Defaults to |
Grid_size |
Grid size (in meters) used to rasterize the map. Defaults to 75. |
A tibble with 1 column for the PointID_column values and another with the distances from the EndPoint.
Maptransitioner
Pointmover
library(tibble)
Points <- tibble(Latitude = c(38.23333, 38.04813, 38.05920,
37.94900, 38.23615, 38.47387),
Longitude = c(-121.4889, -121.9149, -121.8684,
-121.5591, -121.6735, -121.5844),
ID = c("EMP NZP02", "FMWT 508", "FMWT 513",
"FMWT 915", "FMWT 723", "FMWT 796"))
## Not run:
distance<GGdist(Water_map = spacetools::Delta, Points = Points, Latitude_column = Latitude,
Longitude_column = Longitude, PointID_column = ID)
# Including a pre-transitioned map to save time.
# See Maptransitioner for creating this pre-transitioned map.
distance<-GGdist(Water_map = spacetools::Delta, Points = Points, Latitude_column = Latitude,
Longitude_column = Longitude, PointID_column = ID,
Water_map_transitioned = Delta_transitioned)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.