country boundaries using map/continents

40 views
Skip to first unread message

M16

unread,
Dec 12, 2023, 8:49:01 AM12/12/23
to idl-pvwave
I need to get boundaries of countries in lat/lon coordinates. map_continents,/countries draws outlines of countries on a world map. I was wondering if there was any way to print or otherwise get the lat/lon coordinates.

Thanks,

Mark

Chris Torrence

unread,
Dec 12, 2023, 12:27:41 PM12/12/23
to idl-pvwave
Hi Mark,
Yes, definitely, as long as you're willing to do a bit of coding. The country boundaries are all shipped as shapefiles in the idlxx/resource/maps/shape folder. You can use the IDLffShapefile object to read the coordinates from the file. You can use the "attributes" data structure to get the country name (I think), so you can then find a particular country that you're interested in.

Some notes:
- The country shapefile is from 2008 - most country boundaries are accurate, however there have been a few changes since then (such as South Sudan). I'm currently working on updating the country shapefile. If you want, you could just download a newer version of the shapefile. A good one is the ESRI World Countries Generalized (do a google search). We can't ship that one with IDL because of licensing, but you can easily download it and use it with IDL's shapefile class.
- I'm working on an easier "list" interface to IDLffShapefile, where you'll be able to just open a shapefile and access the individual polygons using array syntax. That will hopefully ship in IDL 9.1, which maybe doesn't do you any good right now, but it's coming.

Cheers,
Chris
NV5 Geospatial

M16

unread,
Dec 13, 2023, 12:14:50 PM12/13/23
to idl-pvwave
Thanks Chris, this is great!

Mark

Reply all
Reply to author
Forward
0 new messages