Topology issues, or, I'm doing it wrong

Home Forums Natural Earth Map Data Cultural Vectors Topology issues, or, I'm doing it wrong

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

    ed_hyer
    Participant

    This project is a great idea, one whose time has come. Very glad to not be dependent on ESRI for something so basic.

     

    I wish I could just show the plot, it would be immediately clear what’s going wrong. I have ingested the Admin0_countries.shp into IDL, and plotting up the polygons, I’d say about 60% of them look good, the rest have discontinuities. The vertices look good, but they don’t make clean polygons.

     

    I am trying to use these data for sorting observations among countries. It seems like I could do it if the country polygons just followed an orderly topology. Am I just using the wrong dataset?

     

    Thanks for any help,

     

    –Edward H.

     

    #4042

    Nathaniel
    Keymaster

    @Ed: Thanks for your comments on the project! The 10m admin do have some topology issues at present and hope to have that fixed in a later version. If you have access to Info license you can run “integrate” on it for a temporary fix. The overlap is not very much, however. But they only apply when zoomed into say 250k scale or 40 times the detail of the actual linework. So you might be getting accurate topology, but not at the right precision. Any feature that falls within a couple miles of the border would be affected, even if the topology were right. For your project I suggest you do a buffer on the border lines and find out what percentage of your thematic points are within the border area (and what are not) to determine if this is a real issue or not. If most of your features aren’t along the border, the admin-0 10m will work fine for you. If this remains a problem, you might use GADM from Berkeley which is to a higher precision (variable).

    #4043

    ed_hyer
    Participant

    Nathaniel: Thanks for the quick reply! OK, the problem I am describing is definitely not a precision issue, and hopefully it is user error. I am directly extracting the vertices from the shapefile, where they are stored as a (2,N) array. I break this into a list of longitude coordinates (0,*) and a list of latitude coordinates (1,*). These coordinates should describe a polygon, BUT– they appear to be somewhat out of order. So, when I try to draw Canada, for instance, it draws a segment along the eastern coast of Canada, and then jumps over and draws a segment along the western coast. The result is a fragmented polygon with multiple intersections. It is these intersections that are the problem– they break up the polygon, and make it impossible to cleanly calculate inside/outside. I suspect, but I am not sure, that this would be a problem in any software.

    I do still have some ESRI product, but I haven’t used it in a while, because most of my work is with automated analysis of large datasets, which I used to do with good ol’ AML, but now do mostly with IDL and command-line tools like GDAL.

    Am I explaining the problem well enough? I might have to find a space online to upload the graphic, it’s instantly clear from the picture.

    –Edward H.

    #4044

    Nathaniel
    Keymaster

    @Ed: Email me the picture at nathaniel@naturalearthdata.com.

    #4045

    Nathaniel
    Keymaster

    @Ed: I should also note that there is a special version of admin-0 called “scale ranks” that has an exploded single part version of the countries instead of the “multipart” shapefile that might work well for you. https://www.naturalearthdata.com/downloads/10m-cultural-vectors/10m-admin-0-details/

    #4046

    ed_hyer
    Participant

    @Nathaniel: The “scale ranks” is in fact what I wanted. It means that, for instance, I have to process all the points through 459 polygons in order to determine which points are and are not in Canada, but it works!

    This is a capability I have longed for in IDL for some time, and now it seems I can have it, thanks to this *excellent* free data set!

    Thanks again,

    –Edward H.

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

You must be logged in to reply to this topic.