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

Home » Public Forums » archive » Re: IDL - Extracting data from within boundary defined by shapefile
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: IDL - Extracting data from within boundary defined by shapefile [message #73857 is a reply to message #73760] Tue, 30 November 2010 06:36 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
katie writes:

> When I run this, I get the error, "IDLANROI::CONTAINSPOINTS: Number of
> LON does not match number of LAT."
>
> The terms lon and lat are the longitudes and latitudes associated with
> the soil moisture for the entire globe. There are 64 lat's and 128
> lon's. So yes, they do not match, but I'm not sure what else I should
> be using in the ContainsPoints function.

You actually have 64*128 points that you want to check,
so you have to make that many lats and lons:

latpts = Rebin(Reform(lat, 1, 64), 128, 64)
lonpts = Rebin(lon, 128, 64)

>
> Another possible conflict I see here is that the longitudes within x
> are negative (for being West), but the longitudes of my soil moisture
> data are 0 to 360. Although, when I used MAP_SET to plot my soil
> moisture data, and plot the mrb shapefile (using David Fanning's
> DRAWSHAPES function) on top of it, it came out fine.
>
> Any suggestions for the lat/lon confusion here?

They should be consistent, although some mapping routines,
not all, will recognize the problem and do the conversion for
you. But here is an article that describes how to covert
longitude coordinates that are in 0 to 360 to -180 to 180.
It is not as straightforward as I might appear at first
glance. :-)

http://www.dfanning.com/map_tips/lonconvert.html

Cheers,

David


--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Thread-Pool for operators?
Next Topic: Re: Thread-Pool for operators?

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

Current Time: Fri Oct 10 10:07:25 PDT 2025

Total time taken to generate the page: 0.96326 seconds