Because of the Mars coordinate problem, we need to determine whether latitude and longitude is in China.
The basic idea is to divide the entire administrative area into small rectangles and then remove some rectangular areas. If a point is within the defined area and is not within the excluded area, the decision succeeds or fails. The middle blue area is the restricted area, and the red area is the exclusion area. This quick-to-determine approach is mined from the Nokia map .
Advantages: fast, relatively accurate;
Disadvantage: Large boundary error
SOURCE Download:
Https://github.com/zcsoft/ZCChinaLocation
How to use:
Add ZCChinaLocation.h and zcchinalocation.m to the project;
// 44.042156 longitude 132.759178
BOOL Ischina = [[zcchinalocation shared] Isinsidechina:( Cllocationcoordinate2d) {44.042156,132.759178}];
(IOS) Determine if GPS coordinates are in China