[R-sig-Geo] Geographic distance from Coordinates
Danlin Yu
yud at mail.montclair.edu
Wed Apr 30 23:02:14 CEST 2008
Sebastian:
I assume you were thinking of calculating distances of points recorded
with longitude and latitude? If that's the case, then it's an arc
distance of a Great Circle. This article on wikipedia summarizes what
the formula are, and you can code the formula in R very reasonably:
http://en.wikipedia.org/wiki/Great-circle_distance.
If the coordinates are projected, then regular Euclidean distance would
apply.
Hope this helps.
Cheers,
Dr. Danlin Yu
J. Sebastian Tello wrote:
> Hi everybody,
> Could anyone please point into a reference where I could find how to make accurate calculations of distance between two points based on their geographic coordinates? I need to write some R code that includes this transformation, but i am not sure how to do it.
> Thanks in advance for any help!
>
> Sebastian
>
> J. Sebastián Tello
>
>
> Department of Biological Sciences
> 285 Life Sciences Building
> Louisiana State University
> Baton Rouge, LA, 70803
> (225) 578-4284 (office and lab.)
>
>
>
> ----- Original Message ----
> From: "r-sig-geo-request at stat.math.ethz.ch" <r-sig-geo-request at stat.math.ethz.ch>
> To: r-sig-geo at stat.math.ethz.ch
> Sent: Tuesday, April 29, 2008 5:00:02 AM
> Subject: R-sig-Geo Digest, Vol 56, Issue 26
>
> Send R-sig-Geo mailing list submissions to
> r-sig-geo at stat.math.ethz.ch
>
> To subscribe or unsubscribe via the World Wide Web, visit
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
> or, via email, send a message with subject or body 'help' to
> r-sig-geo-request at stat.math.ethz.ch
>
> You can reach the person managing the list at
> r-sig-geo-owner at stat.math.ethz.ch
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of R-sig-Geo digest..."
>
>
> Today's Topics:
>
> 1. Changing colour gradient in Spatstat surface plot
> (adrian at maths.uwa.edu.au)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Tue, 29 Apr 2008 16:27:59 +0800 (WST)
> From: adrian at maths.uwa.edu.au
> Subject: [R-sig-Geo] Changing colour gradient in Spatstat surface plot
> To: r-sig-geo at stat.math.ethz.ch
> Cc: r.turner at auckland.ac.nz, adrian at maths.uwa.edu.au
> Message-ID: <41679.130.95.98.17.1209457679.squirrel at 130.95.98.17>
> Content-Type: text/plain;charset=iso-8859-1
>
> Graham Smith <graham.smith at myotis.co.uk> writes:
>
>
>> I have produced a smoothed surface plot of
>> water depths (depths as marks) in spatstat, but the default colours
>> are oranges and reds. How do I change these to blues.
>>
>
>
>> Can I redifne the colours in terrain.colors() or topo.colors(), or do
>> I need to use rainbow(). Or is its something different all together.
>>
>
> Yes, you can do all of these things. It is not true that the colours are
> hard-wired.
>
>
>> I have tried the options I listed above , but can't get a syntax that
>> works, and haven't found the help any help at all (not for me anyway).
>>
>
> I presume that you are using smooth.ppp to smooth a marked point pattern,
> yielding a pixel image (object of class "im") which you now want to
> display in your chosen colours. So the relevant help file is
> help(plot.im)
> The help file explains that the argument 'col' determines the colours that
> will be used. See the examples in the help file, or example(plot.im).
>
> Here is an example of the whole process, starting from a marked point
> pattern and finishing with a colour image:
>
> library(spatstat)
> data(longleaf)
> Z <- smooth.ppp(longleaf)
> plot(Z)
> plot(Z, col=topo.colors(256))
>
> Adrian Baddeley
>
>
>
> ------------------------------
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at stat.math.ethz.ch
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>
>
> End of R-sig-Geo Digest, Vol 56, Issue 26
> *****************************************
>
>
>
> ____________________________________________________________________________________
>
> [[elided Yahoo spam]]
> =Ahu06i62sR8HDtDypao8Wcj9tAcJ
> [[alternative HTML version deleted]]
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at stat.math.ethz.ch
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>
--
___________________________________________
Danlin Yu, Ph.D.
Assistant Professor
Department of Earth & Environmental Studies
Montclair State University
Montclair, NJ, 07043
Tel: 973-655-4313
Fax: 973-655-4072
email: yud at mail.montclair.edu
webpage: csam.montclair.edu/~yu
More information about the R-sig-Geo
mailing list