suggest_crs | R Documentation |
This function takes an input spatial dataset as input and makes "suggestions" for suitable coordinate reference systems that could be used for CRS transformations in spatial analysis projects. The function works by analyzing the extent of the spatial dataset and comparing it to the area extents in the EPSG's coordinate reference system database. The "suggested" coordinate reference systems are determined by minimizing the Hausdorff distances between the CRS area extents and the input dataset, subject to user preferences (such as a geographic coordinate system ID or measurement units).
suggest_crs( input, type = "projected", limit = 10, gcs = NULL, units = NULL, drop_na = TRUE )
input |
A spatial dataset of class |
type |
The output CRS type; defaults to |
limit |
How many results to return; defaults to |
gcs |
(optional) The EPSG code for the corresponding geographic coordinate system of the results (e.g. |
units |
(optional) The measurement units of the coordinate systems in the returned results. Can be one of |
drop_na |
Whether or not to drop EPSG codes that do not appear in the PROJ database (and thus can't be used for CRS transformation). Defauts to |
A data frame with information about coordinate reference systems that could be suitably used for CRS transformation.
## Not run: library(tigris) library(crsuggest) # Get a dataset of Census tracts for Nassau County, NY nassau_tracts <- tracts("NY", "Nassau", cb = TRUE) # tigris datasets default to the NAD1983 GCS (EPSG code 4269) # What are some appropriate projected coordinate systems? suggest_crs(nassau_tracts) # Alternatively, we can require projections to have specific # geographic coordinate systems and/or units # For example, let's say we only want NAD83(HARN) (code 4152) # and we want the measurement units to be US feet suggest_crs(nassau_tracts, gcs = 4152, units = "us-ft") ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.