Re: cgmap_gshhs.pro minarea issue [message #86621 is a reply to message #86594] |
Sat, 23 November 2013 20:03   |
pvelissariou
Messages: 4 Registered: November 2013
|
Junior Member |
|
|
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 think the following changes are required:
the line: river = ISHFT(f, -25) AND 255B
should be: river = ISHFT(f, -25) AND 1B
also, header.area is of type LONG and 10^magnitude is of type INT
therefore the calculated polygonarea is wrong, I have modified the
following lines as:
from:
IF version LE 8 THEN BEGIN
polygonArea = header.area * 0.1 ; km^2
ENDIF ELSE BEGIN
polygonArea = header.area / 10^magnitude ; km^2
ENDELSE
to:
IF version LT 9 THEN BEGIN
polygonArea = Double(header.area) * 0.1 ; km^2
ENDIF ELSE BEGIN
polygonArea = Double(header.area) / 10.0^magnitude ; km^2
ENDELSE
|
|
|