Can I get the country information just from Latitude and Longitude of the user? I know it should be easy to get it from Geocoder APIs from Google. But is it possible to derive that information without using any services like Google's?
Could you please let me know?
The only way of doing this is by using a third party API or creating your own database, which is a lot more work that it's worth. Have you looked to see if there is a GeoIP database that you can download for your programming language of choice (Or a generic one?)
Edit: This looks like it might have the data you need
Related
I'm working on an app which utilizes Google Places API in order to find locations based on a users search. I've implemented the search with the help of the UIAutocomplete (Google Places), but unfortunately, it is not location based (until the user provides authorization). I was wondering if there is a way to get the users location through their IP address or otherwise using Swift. I don't need a precise location, the city would be enough.
I've searched for a while and there doesn't seem to be any other way of doing this, so if you know of an API which can return the city the user is currently in, that would be great.
Thanks for all the help,
Vlad
I don't think the system frameworks allow you to get the user's remote IP address anymore. A solution for you might be to use a website like http://mylocation.org/, which shows your IP address and location. Perhaps you can make a request to this website and parse out the HTML that comes back to get the location. Please note, this isn't the most accurate way of getting the user's location and you would be much better off using the CoreLocation framework.
Is there a library or service that returns the US federal congressional district given a US address?
You can do this on govtrack.us. I am not sure if there is a code framework for this, but you could probably write one from this information.
Full disclosure - I work for a company that also provides congressional district data - smartystreets.com
Keep in mind that this information changes often and I have been looking for the last 4.5 years and haven't yet pinpointed an actual, absolutely reliable source for this data. All of the companies I have looked at, including mine, say that their source is the US Postal Service but no one in the US Postal Service has been willing to tell me how frequently the data is updated within their system and what their source might be. So, just be aware.
I'm one of the creators of Geocodio and we had this problem ourselves. So we made it part of our geolocation tools!
You can use the Geocodio API or spreadsheet upload to look up Congressional districts, Representative/Senator contact information, etc. Docs: https://www.geocod.io/docs/#congressional-districts
You can use the Sunlight Foundation Congress API, which is free to use. Go to: http://tryit.sunlightfoundation.com/congress You can determine congressional district by zipcode (not completely reliable since zipcodes can traverse multiple districts) or by latitude/longitude. Just use Google geocoding to retrieve lat/lng from your address, and then you can look up the congressional district.
The whoismyrepresentative.com/api site can translate a zipcode into a congressional district. You can do a call with the url below, replacing 10038 with your zipcode.
http://whoismyrepresentative.com/getall_mems.php?zip=10038&output=json
Hope that helps!
**Also note that the sunlightfoundation site returns a 404 error and govtrack.us does not have an api for searching for congressional districts.
Are there any ways to get information about different places (cities, mountains, rivers , etc) via latitude/longtitude?
I'm planning to use it in my rails project.
Of course, it will be perfect to use information from wiki. Any example of searching over wiki via lat/lon?
May be any other technology/website/api?
You may also check the Geocoder gem to find address by latitude and longtitude. Then you can use wiki api to find articles, like this:
en.wikipedia.org/w/api.php?action=opensearch&search="place_name"&prop=info&format=xml
Or, maybe wikilocation will help you
Check out the Open Street Map API http://wiki.openstreetmap.org/wiki/API They tend to discourage read-only queries, but you can probably find someone else's API for that data.
Also check out http://www.gisgraphy.com/ They have a free webservice here http://www.gisgraphy.com/documentation/user-guide.htm#geolocwebservice that looks like it has what you are looking for.
There are a lot of geocode services out there (like http://geo-autocomplete.googlecode.com/svn/trunk/demo/ui.demo.html for example) where user can write a location (or part of it) and it will be resolved to real existing location.
There is also a lot of info provided with the search result (like country ISO code, coordinates, etc..), but none of the services seem to provide country and city code.
What I mean is a code used to phone to certain are. For example Country code for Germany will be 49 and for city of Dusseldorf will be 211.
Is there any service, where I can get this info from the user input. Or is there any way to combine the two. For example I get city name from google geocode service and the try it on some city codes database. If yes, can anyone please provide me with links.
You can use for instance Yahoo's GeoPlanet. For more elaboration on services to solve your problem you might want to check out this answer on gis.stackexchange.com, which seems to cover the kind of service you need.
General geocoding is not problem. I can put in a city or stae or what ever specific location and usually geocode correctly using Bing. What I cant do is geocode things like intersections or fuzzy locations. My example is "I25 and Colorado blvd". In the Bing Maps site, this has no problem finding exactly what I am looking for. When I use geocode or the bing maps search nothing is found. Anyone have any clues how I can do something like this?
You could start by adding the state and country name in the query.
Also, I assume you're using VEMap.Find, so you may want to try calling the Locations API directly (especially as Find is no longuer available in the most recent version of the Ajax API):
It might give a more explicit error message to help understand why it doesn't return a position.