문제

i have a JSON file that contains lon and lat coordinates. I want to parse this file and then create a new JSON file that contains only coordinates of a certain country.

Is it possible to do this? How to figure out what country the coordinates belong to?

도움이 되었습니까?

해결책

In broad strokes, it sounds like you want to do what's called reverse geocoding. This is the process of taking a known set of coordinates and getting an address from it. The address would include the country.

Depending on the size of your data set, Google offers one that might suit you. You could write a routine to iterate your data set, reverse geocode each set of coordinates, and get a structured address (including country), which you could cache for future use. With the countries, you could then filter the list down to the specific country you're looking for.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top