| Quintiq file version 2.0 | 
| #parent: #root | 
| Method DoGeocode | 
| { | 
|   #keys: '1[105690.0.466136613]' | 
|   Description: | 
|   [* | 
|     Entry point/method for a OSM Geocode operation call. | 
|     Construct the geocode request and prepare the http interface, the callbacks and make an asynchronous call | 
|   *] | 
|   TextBody: | 
|   [* | 
|     // boon kiat Nov-1-2013 (created) | 
|     utils := this.LibOSM_Utils(); | 
|     arguments := this.Arguments(); | 
|     argumentsroot := arguments.Root(); | 
|     utils.DebugDump( "geocode_args.txt", argumentsroot ); | 
|      | 
|     geocodingserver := this.LibOSM_GeocodingServer( relnew ); | 
|      | 
|     // Generate the actual request | 
|     ticks := OS::PrecisionCounter(); | 
|     url := geocodingserver.GenerateGeocodeURL(); | 
|     utils.DebugEndTrace( "GeocodingServer.GenerateGeocodeURL", ticks ); | 
|      | 
|     ticks := OS::PrecisionCounter(); | 
|      | 
|     // Generate the HTTPInterface instance that will be used to send the request to the OpenStreetMap Nominatim server | 
|     httpinterface := geocodingserver.CreateHTTPInterface(); | 
|     httpinterface.URL( url ); | 
|     onsuccesscallback := Reflection::FindMethodBySignature( typeof( LibOSM_GeocodingServer ).Name(), "ProcessGeocodeResponse", typeof( HTTPInterface ).Name() ); | 
|     assert( not isnull( onsuccesscallback ), "OSMGISLibrary.DoGeocode: failed to retrieve the method that will serve as the OnSuccess callback" ); | 
|     httpinterface.OnSuccessCallback( onsuccesscallback, geocodingserver ); | 
|     onfailurecallback := Reflection::FindMethodBySignature( typeof( LibOSM_Utils ).Name(), "HandleError", typeof( HTTPInterface ).Name() ); | 
|     assert( not isnull( onfailurecallback ), "OSMGISLibrary.DoGeocode: failed to retrieve the method that will serve as the OnFailure callback" ); | 
|     httpinterface.OnFailureCallback( onfailurecallback, utils ); | 
|      | 
|     // Send the request, asynchronously | 
|     httpinterface.ASyncCall(); | 
|      | 
|     utils.DebugEndTrace( "The HTTP call to GeocodingServer", ticks ); | 
|   *] | 
| } |