Country code from latitude longitude (without using geocoding services)

How can I get the country code from longitude to longitude?

I know that there are many geocoding services, but they do not meet my requirement, because my application is blocked a few hours after it is broadcast (many geocoding requests).

Most geocoding services also offer commercial services, but they are not yet an option because the project is located in this starting block.

I learned a little and thought I found a way to do this: Get a form file (or another data file) that contains the borders of all countries (in polygons). Then just look at what polygon the lat / lng position is. Finally, read the metadata from a specific polygon.

Does anyone know where I can get a form file (or another format) that includes polygons (or just lines) that show the borders of all countries of the world?

Or maybe there is an easier way to solve this problem?

+5
source share
2 answers

Given the number of countries (polygons) in the world, you might want to subdivide many country polygons to perform a coarse filter first (for example, if the point is in the western and northern hemispheres, you just need to check North American, Central American and Caribbean countries. This can give you an improvement speed.

Also, keep in mind that many countries are made up of multiple polygons, just keep that in mind when you code.

, : http://geocommons.com/overlays/33578 http://geospatial.edublogs.org/2010/06/29/world-country-boundary-files/

+3

, ISO 3166-1 alpha-2 ( FIPS 10 = 4, 2012 ). 248 , , . ViennaMike, , , .

shapefile , , lat/lng (.. , ).

( ). (openstreetmap)

http://downloads.cloudmade.com/

, OpenGeoCode.Org

0

All Articles