R: Convert From Longitude and Latitude to X and Y

mapLongitudeLatitudeXY {oce} | R Documentation

## Convert From Longitude and Latitude to X and Y

### Description

Find (x,y) values corresponding to (longitude, latitude) values, using the present projection.

### Usage

    mapLongitudeLatitudeXY(longitude, latitude)

### Arguments

`longitude` | vector of the longitudes of points, or an object from which both latitude and longitude can be inferred (e.g. a coastline file, or the return value from `mapLocator`), in which case the following two arguments are ignored.
`latitude` | vector of latitudes of points, needed only if they cannot be inferred from the first argument.

### Details

This is mainly a wrapper around `lonlat2map`.

### Value

A list containing `x` and `y`.

### Author(s)

Dan Kelley

### See Also

A map must first have been created with `mapPlot`.

Other functions related to maps: `lonlat2map`, `lonlat2utm`, `map2lonlat`, `mapArrows`, `mapAxis`, `mapContour`, `mapDirectionField`, `mapGrid`, `mapImage`, `mapLines`, `mapLocator`, `mapPlot`, `mapPoints`, `mapPolygon`, `mapScalebar`, `mapText`, `mapTissot`, `oceCRS`, `shiftLongitude`, `utm2lonlat`

### Examples

    ## Not run:
    library(oce)
    data(coastlineWorld)
    par(mfrow=c(2,1), mar=rep(2, 4))
    mapPlot(coastlineWorld, projection="+proj=moll") # sets a projection
    xy <- mapLongitudeLatitudeXY(coastlineWorld)
    plot(xy, type='l', asp=1)

    ## End(Not run)

[Package oce version 0.9-20 Index]