Armenia under water??
Home › Forums › Natural Earth Map Data › Cultural Vectors › Armenia under water??
Tagged: Armenia
- This topic has 1 reply, 1 voice, and was last updated 11 years, 11 months ago by Nathaniel.
-
AuthorPosts
-
November 16, 2012 at 11:50 am #3801
rthParticipantI have created a map using python and the admin-0 10m database. Some European contries are coloured all other countries are white and ocean blue. This works well except for Armenia. What ever I do here it ends up beeing blue as the ocean. Any idea what happend to those poor people??
Just realised, that Albania is suffering the same fate!
November 16, 2012 at 5:36 pm #4442
NathanielKeymaster@rth: what column (field) attribute are you using to color the countries?
Can you attach a screen shot showing your problem?
November 19, 2012 at 4:18 pm #4443
rthParticipantI use name_long to find those countries I want to colour in a specific way, continent I use to colour all countries in Europe (which have not been coloured otherwise), Africa and Asia white, then all others are coloured blue (if you can tell me how to colour just the ocean in blue that would also be nice ).
I am solving this problem, that after all countries have been dealt with, I explicitly go to the Armenia and Albania data and plot them again.
(I would really like to attach a little picture, but have no idea how …)
November 19, 2012 at 6:48 pm #4444
NathanielKeymasterYou should be using
mapcolor_9
for this, it’s precalculated for you. There’s also acontinent
attribute to do the filting you describe. There is a separateocean
theme for coloring that just blue.What application are you in?
November 21, 2012 at 10:15 am #4445
rthParticipantThanks for the quick answer and sorry for my late reply.
The thing is running in python. Here is the code I use (I did not write that myself, I simply have not had enough time to fully understand the structure of the data file):
`for npoly in range(shp.info()[0]):
shpsegs = []
shpinfo = []
shp_object = shp.read_object(npoly)
verts = shp_object.vertices()
rings = len(verts)
for ring in range(rings):
if ring == 0:
shapedict = dbf.read_record(npoly)
name = shapedict[“name_long”]
continent = shapedict[“continent”]
lons, lats = zip(*verts[ring])
if max(lons) > 721. or min(lons) < -721. or max(lats) > 91. or min(lats) <-91:
raise ValueError,msg
x, y = m(lons, lats)
shpsegs.append(zip(x,y))
# add information about ring number to dictionary.
shapedict = ring+1
shapedict = npoly+1
shpinfo.append(shapedict)
print name, continent
lines = LineCollection(shpsegs,antialiaseds=(1,))`
It gives me the desired reults so I was happy
Concerning your comments:
What does
mapcolor_9
do for me?
As you see I use the continent attribute for all countries which should not be couloured in a specific way.
And where do I find this
ocean
theme you were talking about? That would be most interesting.November 21, 2012 at 5:33 pm #4446
NathanielKeymasterthe mapcolor attributes guide on color coding countries.
There are many other themes for download at: https://www.naturalearthdata.com/
-
AuthorPosts
You must be logged in to reply to this topic.