2

I have a continent map of Africa with country boundaries. I have converted polygons to lines so that I can calculate the shortest distance of each point (city for instance) to the country border.

However, I want the v_distance function in Grass plug-in (QGIS) to take into account only distance to inland borders, not taking into account the see border.

Do you have an idea of how to perform this ?

4
  • An insane suggestion: compute the minimum distance to borders of other countries. Presumably, the border you seek is also a border of another country.
    – user1462
    Commented Nov 7, 2016 at 16:56
  • Thank for your response. But this approach suppose distinguishing between country cases right ( coastal and inland) ? And I am not sure the v_distance funcition is that much sophisticated. I am really new to Qgis so simple steps might quickly be cumbersome for me. How would you please do that ?
    – albatros
    Commented Nov 7, 2016 at 17:31
  • Thank you very much for your response: I think this method should work. But when I run the Symettrical Difference command, I run in the following error : "global name 'QgsWKBTypes' is not defined See log for more details". I am working on the 2.18.0 version. How can fix it ? Is there another command to do the same if there is a bug on that command. Best regards !
    – albatros
    Commented Nov 8, 2016 at 14:51
  • Please don't add "thank you" as an answer. Once you have sufficient reputation, you will be able to vote up questions and answers that you found helpful. - From Review Commented Nov 8, 2016 at 15:11

1 Answer 1

2

I got this map of the inner borders of Africa with the QGIS vector tools:

Africa Inner Borders

These are the steps I took, starting with a downloaded shapefile of African countries.

  1. Dissolve by all categories to produce an outline of the continent (Vector -> Geoprocessing -> Dissolve).
  2. Convert the outline and the countries shapefiles to line (Vector -> Geometry tools -> Polygon to line).
  3. Symmetrical difference of these polylines (Vector -> Geoprocessing -> Symettrical Difference).

From here you can either convert this string file to a raster and use the proximity function, or use the v_distance GRASS plugin.

4
  • I followed your method and managed to get the outline layer and the continent layer in polylines. But the outline do not overlap perfectly the continent lay so that Symmetrical difference of these polylines do not delete the sea borders but result in another layer with still external borders. How did you manage in details ? Would you provide more precision on that issue.
    – albatros
    Commented Nov 10, 2016 at 10:21
  • I don't know why that is, the layers perfectly overlapped with the data I was using. However, I think your issue could be solved by buffering the coast outline after step two to ensure that the layers overlap. You'll have to experiment to find the right buffer amount. Commented Nov 10, 2016 at 10:38
  • I think that one issue with the layer I am working on (worldmap.harvard.edu/data/geonode:Digital_Chart_of_the_World) is that some countries have both inner and coastal borders taken as the same entity. So that, when I try to consider intersection or overlapped entities ( by spatial request) some of the inner borders are also selected. Sometimes the selected entities are even landlocked countries, which is strange ? You perhaps have an idea on how to fix it ? Or you may perhaps suggest the layer you used.
    – albatros
    Commented Nov 10, 2016 at 11:49
  • I used this data: arcgis.com/home/item.html?id=16da193d9bcd4ae0b74febe39730658a. It does not contain the Sinai peninsula or Israel, so if this border is important for your project you will need to find these shapefiles too. Commented Nov 10, 2016 at 14:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.