[R-sig-Geo] Interactive maps (fwd)
Antonio Serrano
aasdelat at aim.com
Mon May 4 14:36:36 CEST 2015
Hi:
Thank you, Ranil, but these two solutions imply to generate again the map within R, but the map I have to use already exists, and has to be produced by a Fortran program.
So, I think Barry's solution is more apropriate for my problem.
Antonio Serrano
aasdelat at aim.com
ن
-----Original Message-----
From: Dhammapala, Ranil (ECY) (ECY) <rdha461 at ecy.wa.gov>
To: aasdelat <aasdelat at aim.com>; Bowman, Clint (ECY) (ECY) <cbow461 at ECY.WA.GOV>
Sent: Thu, Apr 30, 2015 9:36 pm
Subject: RE: [R-sig-Geo] Interactive maps (fwd)
Antonio,
One possible solution that I haven’t investigated, and one (more
cumbersome) that I've worked on:
Easy, untried one first:
Can you use the
two R functions "rMaps" (http://rmaps.github.io/) and "identify"
(http://stat.ethz.ch/R-manual/R-devel/library/graphics/html/identify.html) to
get what you want?
Tried & tested solution:
We did something similar using
a Google maps API and Javascript on a web page to allow users click on a map &
have the coordinates passed to R. You will need to install a web server called
"rApache" on a Linux system for this.
Have a look at the html code of the
web page http://bglookup.cee.wsu.edu and see how the Javascript passes off the
coordinates of the user-selected map point, to the R function. Once in R, you
access these arguments using POST$lat and POST$lon (based on variable names used
in this example).
The R library "hwriter" is very helpful in formatting R
program output for web
pages.
HTH
Ranil//
~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~
Ranil
Dhammapala, PhD
Acting Manager, Science and Engineering Section
Air Quality
Program, Washington Department of Ecology
P.O Box 47600, Olympia, WA
98504-7600
Tel: 360-407-6807 Fax: 360-407-7534
Email:
ranil.dhammapala at ecy.wa.gov
~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~
-----Original
Message-----
From: Clint Bowman [mailto:clint at ecy.wa.gov]
Sent: Wednesday,
April 29, 2015 8:03 AM
To: Dhammapala, Ranil (ECY)
Subject: [R-sig-Geo]
Interactive maps (fwd)
It sounds as if in the email below Antonio is trying
to do what is being done with the background design value map. He may benefit
from your experience.
Clint Bowman INTERNET: clint at ecy.wa.gov
Air Quality
Modeler INTERNET: clint at math.utah.edu
Department of Ecology VOICE: (360)
407-6815
PO Box 47600 FAX: (360) 407-7534
Olympia, WA 98504-7600
USPS: PO Box 47600, Olympia, WA 98504-7600
Parcels:
300 Desmond Drive, Lacey, WA 98503-1274
---------- Forwarded message
----------
Date: Wed, 29 Apr 2015 06:36:13
From: Antonio Serrano via R-sig-Geo
<r-sig-geo at r-project.org>
Reply-To: Antonio Serrano <aasdelat at aim.com>
To:
r-sig-geo at r-project.org
Subject: [R-sig-Geo] Interactive maps
Resent-Date:
Wed, 29 Apr 2015 06:36:59 -0700
Resent-From: <cbow461 at ecy.wa.gov>
Hello, all:
I'm new in this forum. I have been redirected here from the
r-help forum.
Well, I have the challenge to produce an interactive
map.
I have a map which has been produced by a Fortran program. I have
the sources of this Fortran program and can produce the map in many formats:
eps, ps, png, jpeg, svg, etc.
I have to load the map in R, which has to
display it on the screen.
Then, the user clicks on a point on the map,
and then, R has to retrieve the longitude and latitude where the user has just
clicked.
And then, R has to look for some information corresponding to
that location, process that information, and present it to the user in another
graphic.
And the point is: what format and metainformation has to have
the map to be correctly read by R and to retrieve longitude and latitude when
the user clicks, and not "figure" coordinates?.
I am thinking on
inoculating some metainformation into the map, from the fortran program, and
read and interpret it from R, but there is perhaps a more "correct" way to do
this.
Antonio Serrano
aasdelat at aim.com
ن
[[alternative HTML
version deleted]]
_______________________________________________
R-sig-Geo
mailing
list
R-sig-Geo at r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-geo
[[alternative HTML version deleted]]
More information about the R-sig-Geo
mailing list