how can I determine if a user is within a property line - swift

I would like to take a longitude and latitude of a user and determine if they are within a set boundary of property line on the map similar to the rectangles symbolizing buildings.I have looked into using CLGeocoder which returns an address but I would like to be able to determine if the user is within a park, or a property, a neighborhood or even a building which may have multiple addresses within it. What is the best way to go about doing this thank you.

Related

Retrive all districts based on city name from REST query

I've searched for solution for that problem on here-api documentation but I can't really find it out ! I'm starting doubt if this even possible.
Ok so basicly what i need to know for now:
1. Is this even possible on this platform ?
2. Using exactly which 'module' (eg. PLATFORM DATA EXTENSION,BATCH GEOCODER)
There is no straight solution to get all districts in a city since district concept varies from one place to another(country-specific). Still you can try one of the below options:
administrative-areas-buildings category in places api
city-town-village category in places api
retrieveAreas mode in geocoder api (apply bbox or increase the radius of prox parameter and see if it works for your location)
Search Text in geocoder can also be used if you are search for districts which match a regex
You can check if the above 1) and 2) are applicable to your location using https://places.demo.api.here.com/places/v1/categories/places?at=41.8369%2C-87.684&app_id=DemoAppId01082013GAL&app_code=AJKnXv84fjrb0KIHawS0Tg

What's wrong with this Last.fm geo.getEvents API query?

I'm attempting to use the geo.getEvents method in Last.fm's Web services, which you can read about here:
http://www.last.fm/api/show/geo.getEvents
I'm attempting to use it like this:
http://ws.audioscrobbler.com/2.0/?method=geo.getevents&lat=40.7903&long=73.9597&api_key=0382f639e72b14c9265d41993d28a110&format=json
Those are the Latitude and Longitude coordinates for New York City. However, I get back a responses saying there are not events there. Even if I add a distance parameter, it says the same thing. Also if I round those coordinates to integers.
Is there something wrong with my queries, or is the service just messed up?
Thanks.
New York is 73 deg. WEST, so you need to use a negative value for the longitude, and the URL should be:
http://ws.audioscrobbler.com/2.0/?method=geo.getevents&lat=40.7903&long=-73.9597&api_key=0382f639e72b14c9265d41993d28a110&format=json

Get Zipcodes List by giving my current point zipcode inside a radius

I need to find if the given zip code is within the required radius. For example, if the user has entered 20910, it should be able to determine if it's within 5 mile radius of 20814. Is there a way to do it? Google API or something? Please help.
I'm using C# as the programming language.
I think it's called the havershine formula...
Havershine Example - google it for more

Turning off reverse geocoding when opening "Maps" in iPhone through a URL with lat./long. parameter

I am trying to figure out how to use the Google Maps URL format for sharing locations as latitude/longitude in an app that I am developing for iPhone.
Example: http://maps.google.com/maps?q=40.77407,-73.96675
This is a point in Central Park, New York. When using this on an iPhone, "Maps" will open and reverse geocoding will be done, resulting in an address on the nearby 5th Ave.
But for sharing a meeting point in Central Park, this is quite useless!
Is it possible to specify any parameter in the query string that will turn off reverse geocoding, so that the exact lat/long position is shown in the "Maps" app on iPhone?
(Compare with the result one will get when entering this url on a desktop, where the exact location will always be pointed out by a green arrow.)
I found the answer myself: Adding "loc:" immediately after "q=" will turn off the reverse geocoding.
Example: http://maps.google.com/maps?q=loc:40.77407,-73.96675
Instead of a generic 'q', which according to specification is treated like a generic query
This parameter is treated as if it had been typed into the query box by the user on the maps.google.com page. q=* is not supported.
you could try ll or saddr.
ll The latitude and longitude points (in decimal format, comma separated, and in that order) for the map center point.
saddr The latitude and longitude points from which a business search should be performed.
The maps url scheme is specified here: http://developer.apple.com/library/ios/#featuredarticles/iPhoneURLScheme_Reference/Articles/MapLinks.html

latitude/longitude

Is there any way to find out the latitude/longitude of a place using IP address.
ip2location.com has a number of resources (some of which are free) for doing this, including scripts and demo databases - but I'm no iphone expert so I don't know if they're of any use in that particular environment.
I use quite a good free api for that in my PHP projects: http://api.hostip.info/?ip=IPADDRESSTOLOOKUP
returls XML... not sure if this is of use to you! :)
But the iphone is supposed to have an embedded gps chip, so I think you might use it to get this information.
Moreover, I think that with IPV6 you'll be able to use a given IP from multiple locations.
Assuming you're trying to find the position of someone/thing else, then generally no. There are a few exceptions, for when that IP address is registered to an individual business, which in turn list their full address in the whois record. You could then geocode that using a webservice (etc.) to get lat/long.
If you're trying to find out where you are, then you're probably better off using the built in GPS
The IP address doesn't uniquely identify a location.
I know I get a lot of unwanted ads telling me about good times to be had in my location.
The problem is the location is wrong.
I would say that this is a very easy way to do get the latitude and longitude. You can even get it of the user who is visiting your site.
$ip = $_SERVER['REMOTE_ADDR'];
$details = json_decode(file_get_contents("http://ipinfo.io/{$ip}/json"));
//$user_location is returning latitude , longitude
$user_location = $details->loc;
//you can split them like this som you get them in two different variables
$pieces = explode(",", $user_location);
$lat = $pieces[0];
$lon = $pieces[1];