Learn R Programming

geo (version 1.4-3)

geopolygon: Fill an area.

Description

The program fills an area. The program is similar to the polygon function except the data is in lat, lon and the transform of the data specified in geoplot is used. Also there are some additional parameters. The graph has to be initialized by geoplot.

Usage

geopolygon(lat, lon = NULL, col = "white", border = FALSE, exterior = FALSE, nx = 1, outside = FALSE, plot = TRUE, save = FALSE, rat = 0.005, density = -1, Projection = NULL, angle = 45, allowed.size = 80000, option = 1)

Arguments

lat,lon
Latitude and longitude of data ( or x and y coordinates), negative for southern latitudes and western longitudes. May be supplied as two vectors or as a list lat (or x) including vectors lat\$lat and lat\$lon (x\$x and x\$y if projection = none).
col
Color number used. Default value is 0 (often white).
border
If TRUE borders around the polygon are drawn. Default value is FALSE.
exterior
If TRUE everything that is outside the polygon is painted , else everything inside. Default value is FALSE. If exterior = TRUE axes and grid often need refreshing by calling geoplot again with new = TRUE.
nx
See geolines for further details.
outside
If TRUE what is outside of the polygon is colored else what is inside. Default value is TRUE.
plot
if TRUE the polygon is plotted. Default is TRUE.
save
if TRUE the points plotted are returned. Default is FALSE.
rat
the ratio of the plot to what is plotted. Default is 0.005 meaning that the plot is 0.5% bigger than what is plotted.
density
see polygon.
Projection
the projection to be used. Default is the one defined by current plot.
angle
see polygon.
allowed.size
printers are limited to printing polygons of certain size, when the polygons size is actually too big for your printer you can enter the tedious task of splitting up the polygon. Default is 4000.
option
Some option. Default 1.

Value

The points plotted are returned if save = TRUE.

See Also

polygon, geoplot, geolines, geopoints, geotext, geosymbols, geocontour.fill, geogrid, geocontour.

Examples

Run this code
## Not run:      geopolygon(island)              # Paint iceland with
#                                      # color #0 (often white).
# 
#      geopolygon(island, col = 0, exterior = TRUE)
# 
#      geopolygon(geolocator(), col = 1)  # Paints a region defined
#                                      # by pointing on map black.
# 
#      # Of the maps available island (iceland) is about the only that
#      # is correctly defined as closed polygon so it is the only one that
#      # can be painted by geopolygon.
# 
#      geoplot(grid = FALSE, type = "n")
#      # Star by setting up the plot.
#      geopolygon(gbdypif.500, col = 4, exterior = FALSE, r = 0)
#      # Use geopolygon to draw the 500 m area.
#      geopolygon(gbdypif.100, col = 155, exterior = FALSE, r = 0)
#      # Draw 100 m are over the 500 m.
#      geolines(eyjar, col = 115)
#      # Add islands around Iceland.
#      gbplot(c(100, 500), depthlab = TRUE)
#      # Draw the depth lines, labels on lines.
#      geopolygon(island, col = 115, outside = TRUE, r = 0)
#      # Draw Iceland over.
#      geoplot(grid = FALSE, new = TRUE)
#      # Draw lines around Iceland, could also use geolines.
# ## End(Not run)

Run the code above in your browser using DataLab