APIs of NAC Real-Time Geo-Services Suite
for Web Applications - Version 5.1



NAC Read-Time Geo-Services Suite provides real-time NAC conversion, geocoding, reverse geocoding, mapping and routing services delivered as both
Here are the APIs for these services:
  1. API for Real-Time NAC Conversion Service
  2. API for Real-Time Geocoding Service
  3. API for Real-Time Reverse Geocoding Service
  4. API for Real-Time Mapping Service
  5. API for Real-Time Routing Service
  6. API for Calculating Great Circle Distance

API for Real-Time NAC Conversion Service

A Natural Area Code (NAC) is an efficient representation of an area or a location anywhere in the world so that both human brains and computers can easily handle the accurate location information. A two-character NAC roughly represents an area about 1000 km in easting and 750 km in northing (here easting means the distance from the west edge to the east edge of the area and northing means the distance from the south edge to the north edge of the area). A four-character NAC, an area of 30 km by 25 km. A six-character NAC, one square kilometer area. An eight-character NAC, 25 m by 30 m and a ten-character NAC is approximately one square meter anywhere in the world. Since eight-character or ten-character NACs are accurate to building size, they are also called Universal Addresses.

This is a simplified NAC licensing business model which allows you to use NACs and Universal Addresses on any of your applications provided that: NAC Converter is provided as both a method of the SOAP web service called NACConverter and a http get request of the REST web service as shown in the following:

http://mlbs.net/nacgeoservicesV5.1/NACConverter.aspx?UserID=userid&Query=query&Format=format
where

Here are sample responses of the SOAP web service for

	+ 43.69999,-79.39999
	+ 8C Q8
	+ 43.600001,-79.59999,43.799999,-79.2
Here are sample responses of the REST web service for

	+ http://mlbs.net/nacgeoservicesV5.1/NACConverter.aspx?UserID=12389765&Query=43.69999,-79.39999
	+ http://mlbs.net/nacgeoservicesV5.1/NACConverter.aspx?UserID=12389765&Query=8CRBH Q90HH&Format=XML
	+ http://mlbs.net/nacgeoservicesV5.1/NACConverter.aspx?UserID=12389765&Query=43.600001,-79.59999,43.799999,-79.2&Format=JSON

API for NAC Real-Time Geocoding/Reverse Geocoding Service

NAC real-time geocoding/reverse geocoding service is an integrated service for both geocoding and reverse geocoding with a geographic coverage of street level address geocoding and reverse-geocoding for 24 countries/regions: Australia, Austria, Belgium, Brazil, Canada, Denmark, Finland, France, Germany, Greece (major roads only), Italy, Luxemburg, Netherlands, New Zealand, Portugal (excluding Azores/Madeira), San Marino, Singapore, Spain, Sweden, Switzerland, Taiwan, United Kingdom, United States and Vatican City street name geocoding and reverse-geocoding of Japan, and partial geocoding and reverse-geocoding for most other countries/regions in the world.

The geocoding/reverse-geocoding service is delivered as both a method of the SOAP web service called Geocoding and http get request of the REST web service as shown in the following:

http://mlbs.net/nacgeoservicesV5.1/Geocoding.aspx?UserID=userid&Query=query&Street=street&City=city&State=state&ZIP=zip&Country=country&Culture=culture&Format=format
The input parameters are case-insensitive and explained in the following:

The responses of all the requests of either geocoding or reverse-geocoding in either the SOAP web service or REST web service all contain the following parameters: Here is an example of response from the SOAP web service:
	+ 45 Huntingdale Blvd., Toronto, ON M1W 2N8, Canada
Here are some sample requests and responses of the REST web service for geocoding addresses and places in different formats:
	+ http://mlbs.net/nacgeoservicesV5.1/Geocoding.aspx?UserID=1236549870&Query=45 Huntingdale Blvd., Toronto, ON M1W 2N8, Canada
	+ http://mlbs.net/nacgeoservicesV5.1/Geocoding.aspx?UserID=1236549870&Query=1 Church Ave., Toronto, ON,Canada&SuppressError=Yes
	+ http://mlbs.net/nacgeoservicesV5.1/Geocoding.aspx?UserID=1236549870&Query=1 Church Blvd., Toronto, ON,Canada&SuppressError=NO&Format=XML
	+ http://mlbs.net/nacgeoservicesV5.1/Geocoding.aspx?UserID=1236549870&street=3347 Oak Street&city=Victoria&state=BC&zip=V8X 1R2&country=Canada&SuppressError=Yes
	+ http://mlbs.net/nacgeoservicesV5.1/Geocoding.aspx?UserID=1236549870&state=BC&zip=V8X 1R2&country=Canada&SuppressError=Yes
	+ http://mlbs.net/nacgeoservicesV5.1/Geocoding.aspx?UserID=1236549870&city=Victoria&state=BC&country=Canada&SuppressError=Yes
	+ http://mlbs.net/nacgeoservicesV5.1/Geocoding.aspx?UserID=1236549870&state=BC&country=Canada&SuppressError=Yes&Format=XML
	+ http://mlbs.net/nacgeoservicesV5.1/Geocoding.aspx?UserID=1236549870&Query=Ontario place, toronto, ON, canada&SuppressError=Yes
Here are two examples of reverse-geocoding:
	+ http://mlbs.net/nacgeoservicesV5.1/Geocoding.aspx?UserID=1236549870&Query=43.6288802325726,-79.4135751575232
	+ http://mlbs.net/nacgeoservicesV5.1/Geocoding.aspx?UserID=1236549870&Query=8crb q90h

API for NAC Real-Time Mapping Service

The mapping service is also part of the NAC Real-Time Geo-Services Suite to provide three types of maps: Road, Aerial and AerialWithLabels with street level maps of 72 countries/regions: Andorra, Argentina, Australia, Austria, Bahamas, Bahrain, Belgium, Botswana, Brazil, Canada, Cayman Islands, Colombia, Czech Republic, Denmark, Finland, France, French Guiana, Germany, Gibraltar, Greece (athens only), Guadeloupe, Guernsey, Hong Kong, Hungary, India, Indonesia, Ireland, Isle of Man, Italy, Japan, Jersey, Jordan, Kuwait, Latvia, Lesotho, Liechtenstein, Luxembourg, Macao, Malasia, Martinique, Mexico, Monaco, Namibia, Netherlands, New Zealand, Norway, Oman, Qatar, Poland, Portugal, Puerto Rico, Reunion, Russia, San Marino, Saudi Arabia, Singapore, Slovakia, Slovenia, South Africa, Spain, Swaziland, Sweden, Switzerland, Taiwan, Thailand, Turkey, United Arab Emirates, United Kingdom, United States, Vatican City, Venezuela, Virgin Islands, and major road maps of most other countries in the world.

The Mapping service is delivered as both a method of the SOAP web service called Mapping and a http get request of the REST web service as shown:

http://mlbs.net/nacgeoservicesV5.1/Mapping.aspx?UserID=userid&MapArea=maparea&ImagerySet=imageryset&MapSize=mapsize&DrawObjects=drawobjects&Objects=objects&MapLayer=maplayer&Culture=culture&Fotmat=format
Here is the explanation of the parameters:

The response of the mapping request will contain the following parameters (Note, the map scale has been standardized and may not be the exact scale as specified on your request. We try to keep the map center unchanged and use the map with the largest available scale that covers your requested area. Therefore, the returned map usually has a bounding rectangle different from the one specified on your request):

Here are some examples of REST mapping requests:
	+ http://mlbs.net/nacgeoservicesV5.1/Mapping.aspx?UserID=12936102&MapArea=8c q8&ImagerySet=&MapSize=500,400&Objects=8C34G Q8GQK,11,11;8C64G Q8GQK,12,12;43.69835,-79.4780,13,13;43.69835,-79.4380,14,14;43.69835,-79.3980,15,15;43.69835,-79.3580,16,16;43.69835,-79.3180,17,17&format=xml
	+ http://mlbs.net/nacgeoservicesV5.1/mapping.aspx?userid=1236549870&MapArea=8c q8&ImagerySet=&MapSize=500,400&Objects=43.69835,-79.5980,18,18;43.69835,-79.5580,19,19;43.59835,-79.5180,20,20;43.59835,-79.4780,21,21;43.59835,-79.4380,22,22;43.59835,-79.3980,23,23;43.59835,-79.3580,24,24;43.59835,-79.3180,25,25;43.59835,-79.2780,26,26;43.59835,-79.2380,27,27;43.54835,-79.5980,28,28;43.59835,-79.5580,29,29;43.54835,-79.5180,30,30;43.54835,-79.4780,31,31;43.54835,-79.4380,32,32;43.54835,-79.3980,33,33;43.54835,-79.3580,34,34;43.54835,-79.3180,35,35;43.54835,-79.2780,36,36&Format=xml
	+ http://mlbs.net/nacgeoservicesV5.1/mapping.aspx?userid=1236549870&MapArea=43.50143,-79.74332,43.89856,-79.05667&ImagerySet=&MapSize=500,400&Culture=fr-CA&Objects=43.59835,-79.5180,20,20;43.59835,-79.4780,21,21;43.59835,-79.4380,22,22;43.59835,-79.3980,23,23;43.59835,-79.3580,24,24;43.59835,-79.3180,25,25;43.59835,-79.2780,26,26;43.59835,-79.2380,27,27;43.54835,-79.5980,28,28;43.59835,-79.5580,29,29;43.54835,-79.5180,30,30;43.54835,-79.4780,31,31;43.54835,-79.4380,32,32;43.54835,-79.3980,33,33;43.54835,-79.3580,34,34;43.54835,-79.3180,35,35;43.54835,-79.2780,36,36&Format=xml
	+ http://mlbs.net/nacgeoservicesV5.1/mapping.aspx?userid=1236549870&MapArea=43.750143,-79.54332:30,20&ImagerySet=&MapSize=500,400&Culture=fr-CA&Objects=43.59835,-79.5180,20,20;43.59835,-79.4780,21,21;43.59835,-79.4380,22,22;43.59835,-79.3980,23,23;43.59835,-79.3580,24,24;43.59835,-79.3180,25,25;43.59835,-79.2780,26,26;43.59835,-79.2380,27,27;43.54835,-79.5980,28,28;43.59835,-79.5580,29,29;43.54835,-79.5180,30,30;43.54835,-79.4780,31,31;43.54835,-79.4380,32,32;43.54835,-79.3980,33,33;43.54835,-79.3580,34,34;43.54835,-79.3180,35,35;43.54835,-79.2780,36,36&Format=xml
	+ http://mlbs.net/nacgeoservicesV5.1/mapping.aspx?userid=1236549870&MapArea=8c q8:20,30&ImagerySet=AerialWithLabels&MapSize=500,400&Culture=fr-CA&Objects=43.59835,-79.5180,20,20;43.59835,-79.4780,21,21;43.59835,-79.4380,22,22;43.59835,-79.3980,23,23;43.59835,-79.3580,24,24;43.59835,-79.3180,25,25;43.59835,-79.2780,26,26;43.59835,-79.2380,27,27;43.54835,-79.5980,28,28;43.59835,-79.5580,29,29;43.54835,-79.5180,30,30;43.54835,-79.4780,31,31;43.54835,-79.4380,32,32;43.54835,-79.3980,33,33;43.54835,-79.3580,34,34;43.54835,-79.3180,35,35;43.54835,-79.2780,36,36
Here are some responses of the SOAP web service for
	+ MapArea=8K PG&ImagerySet=Road&MapSize=500,400&Culture=es-ES&MapLayer=TrafficFlow
	+ MapArea=8K PG:8,12&ImagerySet=Road&MapSize=500,400&Culture=es-ES&MapLayer=TrafficFlow&Objects=38.88,-77.01,36,PK
	+ MapArea=h5q r48&ImagerySet=AerialWithLabels&MapSize=500,400&Culture=en-GB&MapLayer=TrafficFlow

API for Real-Time Routing Service

The Routing service provides driving, walking and transit directions and route maps for a full coverage of 22 countries and areas: Andorra, Austria, Belgium, Canada, Denmark, Finland, France, Germany, Greece, Italy, Luxembourg, Mexico, Monaco, Netherlands, Portugal, San Marino, Spain, Sweden, Switzerland, United Kingdom, United States, and Vatican City, and partial coverage of most other countries in the world.

The Routing service is delivered as both a method of the SOAP web service called Routing and a http get request of the REST web service as shown in the following:

http://mlbs.net/nacgeoservicesV5.1/Routing.aspx?UserID=userid&Waypoints=waypoints&TravelMode=travelmode&Optimize=optimize&Avoid=avoid&DateTime=datetime&TimeType=timetype&Culture=culture&DistanceUnit=distanceunit&RoutePathOutput=routepathoutput&ShowMap=showmap&ImagerySet=imageryset&MapSize=mapsize&MapLayer=maplayer&Format=format
The input parameters are:

The response parameters other than the parameters from the request are explained in the following: Here are some examples for the SOAP web service:
	+ Waypoints=8CHX Q868;40.71435,-74.00597;8KDB PGFD (all others are default)
	+ Waypoints=8CNJ Q8ZG&ShowMap=YES&MapSize=600,400&RoutePathOutput=Points (all others are default)
Here are examples of requests and responses of the REST web service:
	+ http://mlbs.net/nacgeoservicesV5.1/Routing.aspx?UserID=123865478&Waypoints=38.8922,-77.03;38.9009,-77.02272;38.9129,-77.021885&TravelMode=Walking&ShowMap=YES&MapSize=600,400&RoutePathOutput=Points
	+ http://mlbs.net/nacgeoservicesV5.1/Routing.aspx?UserID=123865478&Waypoints=38.8922,-77.03;38.9009,-77.02272&TravelMode=Transit&TimeType=Departure&DateTime=03/12/2011&ShowMap=YES&MapSize=600,400&Format=XML

API for Calculating Great Circle Distance

This API is to calculate the straight distance (i.e. the great circle distance) on the earth surface betwee two locations.

This API is deliverd only in the text format. The response will be simply the distance in kilometers or an error message if there is an error has happened. The request of this API is shown in the following:

http://mlbs.net/nacgeoservicesV5.1/GreatCircle.aspx?UserID=userid&Start=start&End=end
where

Here are some sample rquests and responses of the web service for

	+ http://mlbs.net/nacgeoservicesV5.1/GreatCircle.aspx?UserID=12389765&Start=36.12,-86.67&end=33.94,-118.4
	+ http://mlbs.net/nacgeoservicesV5.1/GreatCircle.aspx?UserID=12389765&Start=7R9QG P0KZZ&end=33.94,-118.4
	+ http://mlbs.net/nacgeoservicesV5.1/GreatCircle.aspx?UserID=12389765&Start=7R9QG P0KZZ&end=53ZZZ NMNZZZ

Copyright (c) NAC Geographic Products Inc.