Armenia under water??

Home Forums Natural Earth Map Data Cultural Vectors Armenia under water??

Tagged: 

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #3801

    rth
    Participant

    I 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!

     

    #4442

    Nathaniel
    Keymaster

    @rth: what column (field) attribute are you using to color the countries?

    Can you attach a screen shot showing your problem?

    #4443

    rth
    Participant

    I 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 …)

    #4444

    Nathaniel
    Keymaster

    You should be using mapcolor_9 for this, it’s precalculated for you. There’s also a continent attribute to do the filting you describe. There is a separate ocean theme for coloring that just blue.

    What application are you in?

    #4445

    rth
    Participant

    Thanks 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.

    #4446

    Nathaniel
    Keymaster

    the mapcolor attributes guide on color coding countries.

    There are many other themes for download at: https://www.naturalearthdata.com/

Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.