Geospatial library for the iPhone

后端 未结 2 920
情深已故
情深已故 2021-01-03 16:24

I\'m thinking about creating a location-aware iPhone app that could work offline by coming packaged with a list of points of interest (POIs). The app would read the user\'s

2条回答
  •  刺人心
    刺人心 (楼主)
    2021-01-03 17:05

    For distance between points, see CLLocation's getDistanceFrom: method.

    I'm not sure what you mean by geospatial boundaries, but if you mean you have a rectangle defining a location, you can convert it to a CGRect, offset the latitude and longitude of all of your points by 90 and 180 respectively to make sure you don't have negative numbers, convert your CLLocation objects to CGPoints, then use CGRectContainsPoint to figure out if your location is within that rectangle.

    All of the described functions are part of the standard iPhone SDK.

提交回复
热议问题