Re: Digital Chart of World (WorldMap) [message #13692] |
Mon, 07 December 1998 00:00 |
Mark Hadfield
Messages: 783 Registered: May 1995
|
Senior Member |
|
|
Nando Iavarone wrote in message <36672204.665D0EDC@acsys.it>...
> Hi all,
> I need to access to the IDL database of DCW.
>
> Particularly I need a function returning a vector
> of lat/lon coordinates of a feature (e.g. rivers or coasts)
> in a region of interest,
In map_continents.pro, there is a function called MAP_GETINDEX which reads
the index data (position in file, number of points, lon/lat range for each
segment) in a map index file. The index files have names like
.../IDL52/resource/maps/high/*.ndx
.../IDL52/resource/maps/low/*.ndx
Attached is code for a function, MAP_GETDATA, which reads the lon/lat data
for a specified segment. The data files have names like
.../IDL52/resource/maps/high/*.dat
.../IDL52/resource/maps/low/*.dat
MAP_GETDATA calls FDECOMP from the IDL Astronomy Users Library
(http://idlastro.gsfc.nasa.gov/homepage.html)
To find all the segments for a specified ROI, you need to read in the index
data then search for lon/lat ranges that match the ROI. Unfortunately,
segments don't correspond very well to "features", ie a coastline or river
may be split into several segments.
--
Mark Hadfield, m.hadfield@niwa.cri.nz http://www.niwa.cri.nz/~hadfield/
National Institute for Water and Atmospheric Research
PO Box 14-901, Wellington, New Zealand
|
|
|
Re: Digital Chart of World (WorldMap) [message #13724 is a reply to message #13692] |
Thu, 03 December 1998 00:00  |
Martin Schultz
Messages: 515 Registered: August 1997
|
Senior Member |
|
|
Nando Iavarone wrote:
> Hi all,
> I need to access to the IDL database of DCW.
>
> Particularly I need a function returning a vector
> of lat/lon coordinates of a feature (e.g. rivers or coasts)
> in a region of interest,
> starting from the coordinates of ROI (e.g. 4 corners in lat/lon).
>
> Does someone know how to resolve this problem?
>
> Greetings,
> Nando
>
> --
> Nando Iavarone
> Advanced Computer System
> via Lazzaro Belli, 23
> 00040 Frascati - RM
> Tel: +39-6-944091 (switchboard)
> 9440943 (direct)
> E-mail:
> f.iavarone@acsys.it
> iavarone@ba.infn.it
I can only suggest a quick "lowres" resolution to your question: Draw
your map in a limited window
map_set...,limit=[..] and overlay your "feature" in a specific color.
Then you can perform a tvrd() and "query" the resulting byte array for
values of that specific color (e.g. rivers = where(image eq 3)). You
would still have to convert the pixel index to coordinates (so you
better choose a simple projection), and you cannot resolve individual
features (i.e. you will not get a vector of say the amazon river). So,
probbaly, this isn't of too much help.
One more thing: I discovered that there may be some inconsistencies in
the map database: when I tried something like the above to create maps
with indivdually color coded countries, I discovered, there were a few
places where country boundaries did not end at a coastline but left a
little gap instead (this screwed up my fill algorithm). Same thing may
be true for rivers, so if you get your vectors, and you want to
re-construct a river you may end up forming a lake if two rivers don't
meet exactly (this was with the low res data set).
Martin.
--
------------------------------------------------------------ -------
Dr. Martin Schultz
Department for Engineering&Applied Sciences, Harvard University
109 Pierce Hall, 29 Oxford St., Cambridge, MA-02138, USA
phone: (617)-496-8318
fax : (617)-495-4551
e-mail: mgs@io.harvard.edu
Internet-homepage: http://www-as.harvard.edu/people/staff/mgs/
------------------------------------------------------------ -------
|
|
|