Hi Simon
A combination of functions gDistance, gBuffer and gIntersects from package rgeos
should do the job. Also, have a look at www.naturalearthdata.com. They have
various shapefiles with coastlines and land polygons, though I don't know
how the resolution compares with the worldHires database.
Cheers,
Francois Rousseu
> Date: Thu, 14 Jul 2011 05:43:23 -0700
> From: s.j.goodman@leeds.ac.uk
> To: r-help@r-project.org
> Subject: [R] calculating distance inland from coastline
>
> Hi All,
>
> Does anybody know of any existing functions that will calculate distance
> inland from a coastline?
>
> It's possible to test if a lon,lat location is land or sea using
> map.where(), but I need to add a buffer to this of say 2km, to allow for
> points that are just on the coast, and below the resolution of the
> worldHires database.
>
> I'm working with a marine mammal satellite telemetry dataset and wish
to
> filter out spurious locations on land.
>
> On another issue, does anybody know of any free vector map datasets that
are
> more up to date and have a higher resolution than the worldHires database
> from the 'maps' package.
>
> Thanks, Simon
>
>
>
> --
> View this message in context:
http://r.789695.n4.nabble.com/calculating-distance-inland-from-coastline-tp3667464p3667464.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> R-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
[[alternative HTML version deleted]]