Interpreting shape parts

Home Forums Natural Earth Map Data Physical Vectors Ocean Interpreting shape parts

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #4261

    Nathaniel
    Keymaster

    Can you post an example image?

    #4262

    marcelocantos
    Participant

    I’ve uploaded an image at http://oi40.tinypic.com/690pk6.jpg. It contains (zero-based) shape 41 from 10m_ocean, which represents parts of the Indian and South Atlantic Oceans around Southern Africa. Africa, which extends outside the zone, is black. However, Madagascar, which should also be black is filled in, since my code simply fills in all the shapes, assuming they all represent tracts of ocean. How do I infer that the parts for Madagascar and the surrounding islands represent tracts of land, not ocean?

    This only just occurred to me now: should I simply draw all the polygons together, with an even-odd rule, or something similar?

    #4263

    Nathaniel
    Keymaster

    Yes, even-odd is normal for SHP files. You’re seeing the ring bits draw. Now you just need to wind them.

    #4264

    marcelocantos
    Participant

    Thank you for confirming this, Nathaniel. I was amazed at how difficult it is to locate drawing libraries that apply the even-odd rule, but I eventually managed to get OpenGL’s tessellation routines to perform the necessary work, and the result was perfect!

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

You must be logged in to reply to this topic.