It is now often necessary to provide some information about location based on the location provided by the user. Sometimes you can directly determine the latitude and longitude of the user, sometimes not necessarily determine the user's latitude and longitude information, the user is through the input of some road name, landmark building or store name location, but our database may not be stored in the user may enter the latitude of these location information, At this point you can use some map-
Geocoding API is a service interface provided by Baidu. It is mainly used to provide translation services from address resolution to latitude and longitude coordinates or from latitude and longitude coordinates to addresses, you can send a request to receive returned data in JSON or XML format.
Most of the code and solutions provided on the Internet are based on Google map. In fact, their solutions are similar. Here, I will send a link to show you how
1. geocoding Tools (Geocoding tools) Locator ProductionOpen Arccatalog and find the Toolbox Arctoolbox geocoding Tools---Create Address Locator with the following interface:2, locator has been completed, the next is to publish the Geocoding serviceRight-click the Locator tool and select Share as---Geocode Service with
Cat Share, must boutiqueOriginal articles, welcome reprint. Reprint Please specify: Sanayu's BlogAddress: http://blog.csdn.net/u013357243One: EffectInput latitude and longitude, can get the corresponding place nameSecond: IdeasAlmost identical to the field code.1. Get the latitude and longitude of user input2. Create a Cllocation object based on the latitude and longitude of the user input3. Get the relevant landmark information based on the Cllocation objectThree: Code#import "ViewController.h"
1. Geocoding: The conversion of a ' place name string ' to ' latitude and longitude ' [Geocoder geocodeaddressstring:-(void) geocoder{1. Creating the encoding/anti-encoding managerClgeocoder *geocoder = [[Clgeocoder alloc]init];2. Geocoding: Convert ' place name string ' to ' latitude and longitude '[Geocoder geocodeaddressstring:@ "Beijing" completionhandler:^ (Nsarray *placemarks, Nserror *error) {Placema
How to use Python to implement geocoding take the logistics industry as an example. This paper analyzes the logistics industry application methods of PostgreSQL and Greenplum in terms of geographical location information processing, optimal path algorithm, and machine learning. I mentioned the problem of converting addresses into Coordinates. the more professional term should be "geographic code", that is, knowing an address, such as No. 10, Shangdi 1
Analysis of geocoding and ding on Google Maps
In fact, for the geocoding of Google MapsAnd now you can use the Chinese Geographic Name to locate the map (it seems to be detailed at the county level ). In the end, Google map uses mapabc, and its geocodingAnd directions are mapabc.
Geocoding)
First, we request an address in ditu.google.com. For example, "Nanton
---restore content starts---Basic Android itself with the Geocoder this class can also be achieved for the latitude and longitude of the positive and negative Yi, but its own bugs exist a lot, especially in the stability of the resolution here, Google provides geocoding stability more good, although its usage is a little more complex, In fact, its general working principle is the HTTP protocol, Google has an open interface, we will be the latitude and
information literacy
1. Schematic diagram
2. Meridian: Through the London Greenwenger Observatory
Go east (to the right), it's longitude (E)
Go West (to the left), it's longitude (W)
Things by the 180 °, a total of 360 °
3. Equator: Zero dimensional dimension
Go North (top), northern latitude (N)
Go south (below), it's latitude (S)
South latitude each 90 °, a total of 180 °
Tip: The greater the Latitude (1°≈111km) across the longitude, the greater the range, the smaller the things y
=longitude , QS can become the following three kinds of forms:
Location=latitudelocation=longitude
Location[0]=latitudelocation[1]=longitude
Location[]=latitudelocation[]=longitude
are not in line with the Baidu Map API interface requirements.If you want to avoid the trouble of string connection, using the String-format library is also very convenient, but the URL will also knock very long, it is better to use the QueryString library beautiful.Or you can use the QueryString
: parse the JSON string
// Parse the root element to obtain an array jsonarray jsonobjs = new jsonobject (STR ). getjsonarray ("Results"); // retrieves the first JSON object in the array (in this example, the array actually contains only one element). jsonobject jsonobj = jsonobjs. getjsonobject (0); // parses the formatted_address value string address = jsonobj. getstring ("formatted_address"); // parse the geometry jsonobject geometry = jsonobj in the json object. getjsonobject ("Geometry"); /
German api:http://lbs.amap.com/api/webservice/guide/api/georegeo/Http://restapi.amap.com/v3/geocode/geo?key=7de8697669288fc848e12a08f58d995es=rsv3city= , Hangzhou Address= Modern Building, No. 87th Tiancheng Road, Hangzhou, ChinaThe key on the side is the key that is open to others, and it feels good to use it. Basically there is no big limit, using the top interface to get latitude and longitude is basically 100% successful, but this coordinate system is GCJ02 coordinates.The result information
CODE:#!/usr/bin/python #-*-Coding:utf-8-*-"Created on 2014-8-20@author:guaguastd@name:geocode_location_bing.py" From geopy Import Geocodersgeo_app_key = "G = geocoders. Bing (Geo_app_key) for City in ["Beijing", "Nashville", "NewYork"]: print
Step 1: Construct the URL required by the Geocoder APIURL formatHttps://maps.googleapis.com/maps/api/geocode/output? ParametersThe output option is json/xml, and the parameters option is address/language/sensor.URL exampleHttps://maps.googleapis.com/
Postal code
WebService type: RestURL: ws.geonames.org/postalcodesearch?Parameters: postalcode, placename, maxrows, CountryResult: returns a list of places for the placename/postalcode query as XML documentExample
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.