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

Home » Public Forums » archive » cgmap_gshhs.pro minarea issue
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: cgmap_gshhs.pro minarea issue [message #86610 is a reply to message #86609] Fri, 22 November 2013 08:22 Go to previous messageGo to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Takis.Velissariou@deep-c.org writes:

>
> On Thursday, November 21, 2013 7:09:28 PM UTC-5, pvelis...@fsu.edu wrote:
>> Apparently, in the recent versions (>= 2.2) of gshhs database
>>
>> the units of the header.area changed from 1/10 km^2 to 1/10 m^2.
>>
>> For cgmap_gshhs to work properly the line:
>>
>> polygonArea = header.area * 0.1 (ok for gshhs < 2.2)
>>
>> should be changed to:
>>
>> polygonArea = header.area * 1.0e-7 (for gshhs >= 2.2)
>
> David,
>
> I saw the modified code in gmap_gshhs.pro and I think that:
> magnitude = ISHFT(f, -26) AND 1B
> should change to:
> magnitude = ISHFT(f, -26) AND 255B
>

Well, here is the header I am using to figure this out:

http://www.idlcoyote.com/misc/gshhs.h

I presume the magnitude is the 6th byte in the flag (not the 4th as the
documentation indicates). I see no evidence that we are to use a
negative magnitude power. My way of pulling out the flag value is
consistent with how I find the other byte values in the flag.

> also
> polygonArea = header.area * 0.1 * 10^magnitude
> should change to:
> polygonArea = header.area * 0.1 (for version lt 9)
> and
> polygonArea = header.area * 10^(-magnitude) (for version gt 9)

Since I set magnitude=0 if magnitude is not found in the file, and 10^0
is 1, I think my way of doing this is equivalent to yours.

Do you have a polygon you KNOW the area of that we can test?

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thue. ("Perhaps thou speakest truth.")
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: IDL 8.2, read pixel value along a surface
Next Topic: Exelis code library down - someone has G

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

Current Time: Wed Oct 08 17:37:20 PDT 2025

Total time taken to generate the page: 0.00447 seconds