comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: coordinates on land
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: coordinates on land [message #18216 is a reply to message #18177] Thu, 09 December 1999 00:00 Go to previous message
davidf is currently offline  davidf
Messages: 2866
Registered: September 1996
Senior Member
Klaus Scipal (kscipal@ipf.tuwien.ac.at) writes:

> I am looking for an IDL procedure that tells me if a point (given in
> longitude and latitude) is situated on land or on water.
> for example the point 10�N and 20�E is situated on land (in Africa) the
> point 10�N 40�W is situated on water (the Atlantic)

Here is something quick and dirty. Returns a 1 if the location
is on land and a 0 otherwise.

Cheers,

David

--
FUNCTION On_Land, longitude, latitude

; Longitude ranges from -180 to 180.
; Latitude ranges from -90 to +90.

On_Error, 1
IF N_Params() NE 2 THEN Message, 'Incorrect number of arguments'

; Fill window with map continents. Water = 0, Land = 1.

Window, XSize=360, YSize=180, /Free, /Pixmap
Map_Set, /Cylindrical, 0, 0, Position=[0,0,1,1], /NoBorder, Color=0L
Map_Continents, /Fill, Color=1L
image = TVRD()

; Convert location to device coordinates.

location = Convert_Coord(longitude, latitude, /Data, /To_Device)

; Delete window. Return location pixel value.

WDelete, !D.Window
RETURN, image[0 > location[0] < 359, 0 > location[1] < 179]
END
--

David Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438 E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
[Message index]
 
Read Message
Read Message
Previous Topic: Philips ACRA-NEMA reader
Next Topic: coordinates on land

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Sat Oct 11 00:33:43 PDT 2025

Total time taken to generate the page: 1.84463 seconds