Description Usage Arguments Details References Examples
View source: R/4_get_country_shoreline.R
Determines country names for a list of coordinate points which are supposed
to be located on land but without country names assigned by the function
get_country
because probably they are very close to the
shoreline and have lack of precision. Due to this fact when the user runs
get_sea
over that points they get ocean/sea names assigned. The
present function uses a SpatialPolygonsDataFrame with 50 m precision and a
buffer zone around the coordinate points. The buffer represents the tolerance
and is given by the user. If the tolerance is 500 m, for example, and the
point gets a country name, means that it belongs to that country with an
error until 500 m towards the sea.
1 | get_country_shoreline(icoords, tol)
|
icoords |
data frame with three columns: id | lon | lat where: 'id' is the row identifier for the coordinates in the original list of coordinates, 'lon' is the longitude in the range (-180, +180) and 'lat' is the latitude. Both coordinates are in decimal degrees. |
tol |
is the tolerance in meters. By default, tol = 500 meters. |
Input:
The output of get_country
- 'miss_countries' -,
i.e., a data frame with three columns: id | lon | lat.
Output:
A text file with the points for which a country name was determined, if they exist. That file has the following header: id | lon | lat | country | sovereignt | adm0_a3 | name_de | name_es | name_fr | name_pt.
A text file with the missing country names, if they exist.
A .RData file with the output data frame(s). The data frame
'countries_sh' has the header id | lon | lat | country |
sovereignt | iso3 | subregion | continent. The data frame
'miss_countries_sh' has the header id | lon | lat and it is
the input of get_sea
to determine the sea name were those
points are located.
Made with Natural Earth. Free vector and raster map data @ naturalearthdata.com.
1 2 3 4 5 6 7 8 9 10 11 | ## Not run:
##
## First run
get_lon180(coords = ispd)
## Or
test_geocoord(coords = eraclim_uao_fp)
## Then run sequentially
get_country(icoords = coords_ok)
get_country_shoreline(icoords = miss_countries, tol)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.