Quintiq file version 2.0
|
#parent: #root
|
Method GenerateGeocodeURL () as String
|
{
|
#keys: '1[105690.0.468906519]'
|
Description: 'Generates the Geocoding request to send to Nominatim/MapQuest by constructing the request URL and modifying the appropriate fields'
|
TextBody:
|
[*
|
// Administrator Sep-13-2011 (created)
|
library := this.LibOSM_OSMGISLibrary();
|
//utils := library.LibOSM_Utils();
|
arguments := library.Arguments();
|
countryhandle := arguments.GetHandle( "country" );
|
statehandle := arguments.GetHandle( "state" );
|
cityhandle := arguments.GetHandle( "city" );
|
streethandle := arguments.GetHandle( "street" );
|
housenumberhandle := arguments.GetHandle( "housenumber" );
|
postcodehandle := arguments.GetHandle( "postcode" );
|
argumentsroot := arguments.Root();
|
|
street := argumentsroot.Child( housenumberhandle ).ValueToString() +
|
" " + argumentsroot.Child( streethandle ).ValueToString();
|
city := argumentsroot.Child( cityhandle ).ValueToString();
|
state := argumentsroot.Child( statehandle ).ValueToString();
|
postalcode := argumentsroot.Child( postcodehandle ).ValueToString();
|
country := argumentsroot.Child( countryhandle ).ValueToString();
|
|
urlsuffix := '';
|
|
if( this.Endpoint() = 'OSM-NOMINATIM' )
|
{
|
//TODO - To use structured URL or use one-line query URL?
|
urlsuffix := LibOSM_GeocodingServer::GenerateGeocodeURL_Nominatim( street, city, state, postalcode, country );
|
}
|
else
|
{
|
urlsuffix := LibOSM_GeocodingServer::GenerateGeocodeURL_MapQuest( street, city, state, postalcode, country );
|
}
|
//Encodes any characters that are reserved characters in URL
|
urlsuffix := StringUtil::EncodeURL( urlsuffix );
|
|
url := urlsuffix;
|
|
debuginfo( "GeocodingServer.GenerateGeocodeURL:", url );
|
|
return url;
|
*]
|
}
|