0

I'm quite advanced in using GIS, but I haven't found a solution to this problem yet. I have a few million dots showing a tweet location, several hundred thousand of which are outside the country's borders (see screenshot). I need to know which tweet was sent in which country, so a buffer is the ideal solution. Unfortunately, I don't know how to just draw a buffer along the outer borders of the world (and not around the entire countries), so that I can see afterwards in which country the tweet was sent. So a dissolve is not what I can use I think. Any tips or tools?

enter image description here

enter image description here

5
  • Welcome to Geographic Information Systems! Welcome to GIS SE! We're a little different from other sites; this isn't a discussion forum but a Q&A site. Your questions should as much as possible describe not just what you want to do, but precisely what you have tried and where you are stuck trying that. Please check out our short tour for more about how the site works
    – Ian Turton
    May 16, 2023 at 16:19
  • 4
    It looks like you just need some better borders
    – Ian Turton
    May 16, 2023 at 16:19
  • Where did you obtain your borders layer?
    – Binx
    May 16, 2023 at 19:43
  • 2
    How do you know some aren't from people tweeting from boats? May 16, 2023 at 22:55
  • I got my shapefile here: public.opendatasoft.com/explore/dataset/…
    – Jane
    May 17, 2023 at 12:58

2 Answers 2

1

You don't need a buffer, you can simply identify to nearest polygon to each point. On the point layer, use the expression overlay_nearest('polygon_layer',"fieldname")[0] and replace the names of the polygon_layer and fieldname with the values you have.


Remark: Be aware, however, that distances in a worldwide projection tend to be heavily distorted and - based on how far away the points are from the polygons - this will result in wrong country names for these points. You can't avoid this problem then by using different projections for each part of the world, like UTM zones.

0

I'm not sure I understood your question but maybe you can first extract the points that don't intersect any countries (which you call "out of world"). Then you can buffer around the countries and then add the 'country_name' attribute only on the extracted points.

2
  • 1
    Or maybe join the point to the closest country as buffer around country will overlap
    – J.R
    May 16, 2023 at 16:36
  • Yes, with the NNJoin plug-in for example
    – fab
    May 16, 2023 at 16:38

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.