Iphone - Doubts about geoprocessing

I heard about geoprocessing and I have some doubts. I hope you can answer some of them.

-New for iOS 5.1, but what is the difference between geo-setting and using regions? From what I read, almost the same thing, is the battery running low?

Why can't I find hardware documentation on a geo object?

-How do you define the regions? can i add them remotely via webservice?

Thanks.

+7
source share
2 answers

Geofencing does exist with iOS 4. You can find the documentation on it in the Apple Location Awareness Guide . It is also referred to as "region monitoring."

The regions are pretty easy to use. Create a CLRegion with a center point (lat, long), radius and unique identifier. Then call -startMonitoringForRegion . Of course, you will need to register CLLocationManagerDelegate to listen for callbacks, -didEnterRegion and -didExitRegion , but this is also very easy to do.

You cannot add them remotely. Only from the device. Over the past couple of years, I learned a few things about them. Therefore, I hope this will save you from any problems in the future.

  • Not all devices can control regions, so make sure you check for availability.
  • Area size min and max. If you register an area above or below these values, it will default to min / max. The minimum value is 100 m, the maximum value is 1/3 of the size of the globe. Pretty big.
  • The maximum number of regions can be controlled by 1 device. This β€œpool” of regions is shared by all applications, and old fences will be cleared to make room for new fences. So be prepared for this. The maximum number is close to 100. But sharing between apps with passwords, reminders and other apps ... can burn out quickly.
  • Make sure that you have only one instance of your location manager delegate, multiple instances will receive you several delegate calls, they are all listening.

Geofences is a great way to add functionality to locations without any active active GPS and location tracking. In my experience, geofences do not leave a noticeable battery drain when leaving all the time. Apple understood them very well. They do not carry the same accuracy as active GPS, but they are close enough. Good luck.

UPDATE Some information here is a bit outdated. The number of regions that you can control is now 20 and is limited for each application. In addition, the minimum size is not 100M, it may be smaller, but accuracy is not guaranteed at lower values.

+11
source

"Geofencing" has always been around since iOS 4 in the form of "Monitoring the region." It uses distance checking to see if you are in a circle. This is not true geodesy , since true geo-check checks if a point falls into a polygon (called a point in a polygon).

Like iOS 6, there is currently nothing like monitoring a region that uses a point in a polygon. To make a true geolocation, you will need to use a combination of region monitoring and GPS. There is no Apple documentation for geoprocessing because CoreLocation does not support it.

If you intend to use a point-in-poly approach, I would recommend radiation. There is an Objective-C class that implements it very well. It was called objc-BorderPatrol .

Regarding sending a fence from a web service, it might be possible to do something similar to the Twitter streaming API, but it might be too intense. It is better to use a significant location to update your fences. If you intend to send fences from a web service, I would recommend using MySQL or PostGRE SQL, since both have really good geospatial extensions.

A few caveats: -> -[CLRegion containsCoordinate:] never called by any CoreLocation object. All distance checking is internal. -> Significant location updates every 500 m or 5 minutes, whichever comes first. Significant location uses the IP address of the cell tower to determine the location. -> Geophones and regions may overlap, track this.

+3
source

All Articles