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 current location from CoreLocation
and produce a list of the POIs in order of proximity to the user s current location.
I need two basic geospatial functions to get this application off the ground. The first is a function that tests if a point (the user s current location) lies within certain geospatial boundaries. The second is a function that can give me the distance between two lat/lon points. I would use the second function to sort the list of POIs by proximity to the user s current location.
I understand that this problem area is well traveled and there are open-source options. The leading candidate (that I know of) is the GEOS C++ library. The way I imagine I would use this is by compiling GEOS as a static library (and linking as a project dependency, as you do to include the three20 library.)
My question is:
What is the best way to get the two necessary functions into my application.
If the best answer to question 1 is compiling GEOS as a static library and linking it to my project, could anyone who has done this before offer some pointers? I m a novice at compilation, static library building, etc. I would love to see some example code or tutorials on how to get GEOS compiled and included in a project with a trivial example usage.