On Thursday, March 2, 2017 at 12:05:37 PM UTC+1, Helder wrote:
> On Thursday, March 2, 2017 at 11:01:43 AM UTC+1, c.beta...@fz-juelich.de wrote:
>> Dear Helder,
>>
>> OK. Still, there remain two problems: I can choose the color for water and land areas. I did not find any option or keyword to access a certain country. The second problem is, this is not an array that I could modify or fold with anything.
>>
>> Thank you,
>> Clara
>
> Hi,
> has I said, countries or imagery of the earth surface and stuff is not my stuff.
> But I have some good news: here you can find info about how to get coordinates of territories out of shapefile:
> http://www.idlcoyote.com/code_tips/extractpoly.php
> By the way, when you draw the maps of Europe, IDL gets the shapefile (where the borders are defined) from this file:
> IDL path\resource\maps\shape\cntry08.shp
>
> Now the bad news. The pro cgExtractShape is not for free:
> http://www.idlcoyote.com/idldoc/forsale/index.html
>
> You should ask David for a price, might be not that bad... But I sincerely have no idea.
>
> I bought some time ago activecontour.pro and I'm very happy with it.
>
> Cheers,
> Helder
Hi,
if you really *dare* to do the dirty work yourself, here is something to get you started.
Look at the shapefile format here: https://www.esri.com/library/whitepapers/pdfs/shapefile.pdf
Now you can start unveiling what's inside. Here is the header. The rest is left as an exercise for the reader :-)
fn = 'fix_your_path\resource\maps\shape\cntry08.shp'
get_lun, fileUnit
openr, fileUnit, fn
fh = bytarr(100)
readu, fileUnit, fh
free_lun, fileUnit
print, 'File code = ', strtrim(swap_endian(fix(fh[0:3],0,type=13)),2)
print, 'File length = ', strtrim(swap_endian(fix(fh[24:27],0,type=13)),2)
print, 'Version = ', strtrim(fix(fh[28:31],0,type=13),2)
print, 'Shape type = ', strtrim(fix(fh[32:35],0,type=13),2)
print, 'File code = ', strtrim(swap_endian(fix(fh[0:3],0,type=13)),2)
print, 'File length = ', strtrim(swap_endian(fix(fh[24:27],0,type=13)),2)
print, 'Version = ', strtrim(fix(fh[28:31],0,type=13),2)
print, 'Shape type = ', strtrim(fix(fh[32:35],0,type=13),2)
print, 'bounding box xMin = ', strtrim(fix(fh[36:43],0,type=5),2)
print, 'bounding box yMin = ', strtrim(fix(fh[44:51],0,type=5),2)
print, 'bounding box xMax = ', strtrim(fix(fh[52:59],0,type=5),2)
print, 'bounding box yMax = ', strtrim(fix(fh[60:67],0,type=5),2)
print, 'bounding box zMin = ', strtrim(fix(fh[68:75],0,type=5),2)
print, 'bounding box zMax = ', strtrim(fix(fh[76:83],0,type=5),2)
print, 'bounding box mMin = ', strtrim(fix(fh[84:91],0,type=5),2)
print, 'bounding box mMax = ', strtrim(fix(fh[92:99],0,type=5),2)
This is what I got:
File code = 9994
File length = 1906850
Version = 1000
Shape type = 5
bounding box xMin = -180.00000
bounding box yMin = -90.000000
bounding box xMax = 180.00000
bounding box yMax = 83.623600
bounding box zMin = 0.00000000
bounding box zMax = 0.00000000
bounding box mMin = 0.00000000
bounding box mMax = 0.00000000
cheers,
Helder
|