geocoding

Get places in radius of a certain point using SQL geography

邮差的信 提交于 2019-12-21 04:49:29
问题 I have an SQL table column with the Geography type: create table dbo.Events ( Id int identity not null constraint PK_Events_Id primary key clustered (Id), Localization geography not null ); How can I get all events in a radius of 40 km? Is this possible? Thank You, Miguel 回答1: Assuming you have latitude and longitude of the point from which you want to search: DECLARE @Origin GEOGRAPHY, -- distance defined in meters @Distance INTEGER = 40000; -- center point SET @Origin = GEOGRAPHY:

Geocoder error java.io.IOException: Unable to parse response from server

谁说我不能喝 提交于 2019-12-21 04:13:37
问题 Code: Geocoder geocoder = new Geocoder(map.this,Locale.getDefault()); List<Address> list = geocoder.getFromLocation(geoLat, geoLng, 1); Exception: java.io.IOException: Unable to parse response from server What am I doing wrong? 回答1: This kind of error shows up when the GPS is not active. Since the emulator doesnt have a GPS hardware, similar exception can be thrown. Cant say for sure unless you post more detail about the problem. 来源: https://stackoverflow.com/questions/6754817/geocoder-error

Find County name for a Lat/Long

删除回忆录丶 提交于 2019-12-20 11:48:13
问题 I'm trying to find a webservice that will allow me to get a County name (not Country) for a specific Lat/Long. I would be performing the lookup within a server application (likely a Java application). It doesn't have a be a webservice if there is some library out there I suppose, but I would like up-to-date information. I have looked around quite a bit for an API that supports this, but so far I haven't been able to find one that works. I have tried the Yahoo APIs like so: http://where

Polygon geofencing with iOS

[亡魂溺海] 提交于 2019-12-20 11:08:58
问题 I am trying to find a way to create several polygon geofences with iOS. I need to draw multiple zones in a city to represent areas, streets, etc. From what I've read so far, iOS only allows circular zone from a geolocated device. Is it feasible with iOS? Is there a web app somewhere to draw polygons on a map and generate the coordinates in an array? 回答1: 1) iOS only allows to create circular geofences indeed however what you are trying to achieve is possible with some extra logic. I have

Best way to geocode UK postcode with Google Maps API?

自闭症网瘾萝莉.ら 提交于 2019-12-20 10:47:05
问题 What is the most effective and accurate way to geocode a UK postcode? Using the built in geocode object results in massively blurred results (lots of postcodes returning just a general area). Are there any free UK postcode geocoding services I can plug into via JavaScript? 回答1: Edit: To be clearer this uses the local search in google search api, not the google maps api to do the geocoding which is much more accurate. The best way is to use Google Search Api. If you get an api key and get it

how to model a postal address

独自空忆成欢 提交于 2019-12-20 10:24:18
问题 I need to model a postal address that can have multiline street address, the city, the state (province), and the postal code. the country is omitted. I need to preserve line breaks in the street addresses but still be able to search the addresses. I see two ways to do it: class Address(models.Model): street = models.ForeignKey('StreetAddress') city = models.TextField() province = models.TextField() code = models.TextField()<br> class StreetAddress(models.Model): line_number = models

Google maps API - add marker by address javascript

爱⌒轻易说出口 提交于 2019-12-20 10:01:27
问题 I have database of places with addresses and I want to add markers on google maps. It shows only the default marker, seems like the geocoder.geocode() does nothing. For an example I'm trying to add a marker on " New York City", with no success. <script> var geocoder; var map; var address = "new york city"; geocoder = new google.maps.Geocoder(); function initMap() { var uluru = { lat: -25.363, lng: 131.044 }; var map = new google.maps.Map(document.getElementById('map'), { zoom: 4, center:

Google Javascript API Geocoding Limits

大城市里の小女人 提交于 2019-12-20 08:02:28
问题 What are the limits for client side geocoding with Google Maps JavaScript API v3? My research: Google Maps PHP API has a limit of 2500 geocode requests per day (https://developers.google.com/maps/documentation/geocoding/#Limits) Google Maps Javascript API v3 has a limit of 25000 map loads per day (https://developers.google.com/maps/documentation/javascript/usage) Google suggests using javascript API for geoocoding to avoid the 2500 limit through the PHP API. It states "running client-side

Passing address to Google Maps on page load

半城伤御伤魂 提交于 2019-12-20 05:33:30
问题 Having some problems initialising a google map using geocoding. First issue is with any commas being used in the $gmap string, second issue is with getting a "gmap_initialize is not defined". I know everything outside of the function is correct, any ideas? <?php $gmap = "Prague, Czech Republic"; ?> <script type="text/javascript"> function gmap_initialize() { var geocoder = new google.maps.Geocoder(); geocoder.geocode( { 'address': <?php echo $gmap; ?>}, function(results, status) { if (status

Global location input autocomplete

杀马特。学长 韩版系。学妹 提交于 2019-12-20 02:34:26
问题 I was looking for a plugin to create a smart location form field which has a suggested autocomplete. I was unable to find anything suitable (Google Geocode is too unreliable on its own, and it isn't designed for this) so I built my own. I thought it was crazy that in 2011 an open-source global location input plugin like this didn't exist so set out to give it a go. The demo is here http://labs.unxposed.net/unxposed/geocode/ and is working on Chrome and Firefox 4. Download is here https:/