Description Usage Arguments Details References Examples
View source: R/3_get_country.R
Given a list of geographic coordinates in the continent, determines the country name for each coordinate point. First uses a SpatialPolygonsDataFrame with 10 m precision to calculate the country names. Then if there are still points without a name assigned, uses a SpatialPolygonsDataFrame with 50 m precision, thus trying to calculate the name for less accurate points.
1 | get_country(icoords)
|
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. |
Input:
The output of test_geocoord
- 'coords_ok' -, or
the output of get_lon180
- 'coords_lon180', i.e., a
data frame with three columns: id | lon | lat. To use the present
function it is necessary that the coordinates do not have any errors or
missing values. This requires previous running of test_geocoord
or get_lon180
that in addition to testing the coordinates,
creates the 'id' which is the row identifier for the coordinates in the
original list of coordinates. After running sequentially
get_country
, get_country_shoreline
and
get_sea
to assign the geographic names, the 'id' is necessary
to display the coordinates in the initial order at the end of the process
(which consists of a sucessive elimination of missing names), with or without
all the names assigned.
Output:
A text file with all the points for which a country name was determined. 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' has the header id | lon | lat | country |
sovereignt | iso3 | subregion | continent. The data frame
'miss_countries' has the header id | lon | lat and it is
the input of get_country_shoreline
to determine the missing
country names or the input of get_sea
, if the user wants to
verify if the still unamed points fall into to the sea and calculate the sea
name were they are located.
Made with Natural Earth. Free vector and raster map data @ naturalearthdata.com.
1 2 3 4 5 6 7 8 9 | ## Not run:
## First run
get_lon180(coords = ispd)
## Or
test_geocoord(coords = eraclim_uao_fp)
## Then run
get_country(icoords = coords_ok)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.