[GIS] Classifying point coordinates to countries or continents

coordinatesdatapointpythonr

I have about 50 000 points (latitude and longitude), and I would like to find out in which country each of the points is located. It does not need to be super precise, though.

(Or actually I only need to classify them to larger geographical areas (North America, South America, Europe, Africa, Middle East, Ex-USSR, Asia, Oceania), but I assume classifying the points to countries and then the countries to larger geographical area is the way to do it.)

How should I proceed?

I would prefer a programmable or a command line solution.

Best Answer

Using SAGA-GIS you can use the tool Add Polygon Attributes to Points

On the commandline (linux or windows):

$ saga_cmd shapes_points 10

library path:   C:\Program Files\SAGA-GIS\Modules
library name:   shapes_points
module name :   Add Polygon Attributes to Points
author      :   O.Conrad (c) 2009

Usage: 10 -INPUT <str> [-OUTPUT <str>] -POLYGONS <str> [-FIELD <str>]
  -INPUT:<str>          Points
        Shapes (input)
  -OUTPUT:<str>         Result
        Shapes (optional output)
  -POLYGONS:<str>       Polygons
        Shapes (input)
  -FIELD:<str>          Attribute
        Table field