Packagecom.esri.aws.services
Classpublic class GeocodeInfo

Contains information about a geocode request. Output from Address Finder and Place Finder.

View the examples.



Public Properties
 PropertyDefined by
  candidates : Array
The list of places that match the input criteria.
GeocodeInfo
  errorMessage : String
Contains an error code and description in the case of NOMATCH.
GeocodeInfo
  hasMore : Boolean
If true, there are more records available in the result, i.e., count in ResultSetRange is less than the total number of records.
GeocodeInfo
  matchType : String
The type of candidate match.
GeocodeInfo
  totalCount : int
The total number of results that meet the search criteria.
GeocodeInfo
Public Constants
 ConstantDefined by
  CANDIDATES : String = "CANDIDATES"
[static]
GeocodeInfo
  ERROR : String = "ERROR"
[static]
GeocodeInfo
  EXACT : String = "EXACT"
[static]
GeocodeInfo
  NOMATCH : String = "NOMATCH"
[static]
GeocodeInfo
  QUERY : String = "QUERY"
[static]
GeocodeInfo
Property detail
candidatesproperty
public var candidates:Array

The list of places that match the input criteria.

errorMessageproperty 
public var errorMessage:String

Contains an error code and description in the case of NOMATCH. Error codes are returned for United States addresses only. See Geocoding codes for more information. Not used in Place Finder.

hasMoreproperty 
public var hasMore:Boolean

If true, there are more records available in the result, i.e., count in ResultSetRange is less than the total number of records.

matchTypeproperty 
public var matchType:String

The type of candidate match. The possible values are "CANDIDATES", "ERROR", "EXACT", or "NOMATCH".

totalCountproperty 
public var totalCount:int

The total number of results that meet the search criteria.

Constant detail
CANDIDATESconstant
public static const CANDIDATES:String = "CANDIDATES"
ERRORconstant 
public static const ERROR:String = "ERROR"
EXACTconstant 
public static const EXACT:String = "EXACT"
NOMATCHconstant 
public static const NOMATCH:String = "NOMATCH"
QUERYconstant 
public static const QUERY:String = "QUERY"
Examples
Basic_PlaceFinder
<?xml version="1.0" encoding="utf-8"?>
<mx:Application
    xmlns:mx="http://www.adobe.com/2006/mxml"
    xmlns:awx="http://www.arcwebservices.com/2007/awx"
    pageTitle="Basic PlaceFinder Report"
    implements="mx.rpc.IResponder"
    creationComplete="onComplete()"
    >
    <mx:Script>
        <![CDATA[
            import com.esri.aws.osgi.framework.ServiceTracker;
            import com.esri.aws.services.GeocodeCandidate;
            import com.esri.aws.services.GeocodeInfo;
            import com.esri.aws.services.IPlaceFinder;
            import com.esri.aws.services.PlaceFinderOptions;
            import com.esri.aws.osgi.framework.IServiceReference;
            import flash.utils.getQualifiedClassName;
            import mx.collections.ArrayCollection;
            import mx.controls.Alert;
            import mx.rpc.IResponder;

            [Bindable]
            private var candidates:ArrayCollection;
            private var placeTracker:ServiceTracker;

            private function onComplete():void
            {
                placeTracker = new ServiceTracker(Framework.getInstance().systemContext, getQualifiedClassName(IPlaceFinder));
                placeTracker.open();
            }

            private function doSearch():void
            {
                var placeService:IPlaceFinder = placeTracker.getService() as IPlaceFinder;
                
                if(placeService)
                {
                    //build some simple options
                    var pfOptions:PlaceFinderOptions = new PlaceFinderOptions();
                    pfOptions.dataSource = "auto"; // ArcWeb:ESRI.Gazetteer.World

                    //call the PlaceFinder service using 'this' as the responder.
                    placeService.findPlace(locationText.text,pfOptions,this);
                    m_info.htmlText = "Sending request ...";
                }
            }
            
            public function result(data:Object):void
            {
                var m_geocodeInfo:GeocodeInfo = GeocodeInfo(data);
                m_info.htmlText = "<i>Showing " + m_geocodeInfo.candidates.length ;
                m_info.htmlText += " of " + m_geocodeInfo.totalCount + ".</i><br/>";
                candidates = new ArrayCollection(m_geocodeInfo.candidates);
                if (candidates.length > 0 )
                {
                    for(var i:int=0; i< candidates.length; i++)
                    {
                        var gc:GeocodeCandidate = candidates[i];
                        m_info.htmlText += "<b>" + gc.desc1 + "</b> at <b>"
                            + gc.latLon.y + "," + gc.latLon.x + "</b> [" + gc.type + "]<br>";
                    }
                }
                else
                {
                    m_info.htmlText += "<b>No matches.";
                }
            }
            public function fault(info:Object):void
            {
                Alert.show(info.toString());
            }
        ]]>
    </mx:Script>
    <awx:Framework id="m_framework" apiKey="[MY-API-KEY]" >
        <awx:PlaceFinderActivator/>
    </awx:Framework>
    <mx:Panel paddingTop="5" paddingLeft="5" paddingBottom="5" paddingRight="5"
        width="100%"
            title="Place Finder Search" layout="horizontal">
        <mx:TextInput width="95%" id="locationText" text="Paradise" enter="doSearch()"/>
        <mx:Button label="Find Place" click="doSearch()" id="m_button" />
    </mx:Panel>
    <mx:Text id="m_info" fontSize="14" top="80"/>
</mx:Application>
Basic_AddressFinder_findLocationByIP
<?xml version="1.0" encoding="utf-8"?>
<mx:Application
    xmlns:mx="http://www.adobe.com/2006/mxml"
    xmlns:awx="http://www.arcwebservices.com/2007/awx"
    pageTitle="Basic AddressFinder by IP Request"
    implements="mx.rpc.IResponder"
    creationComplete="onComplete()"
    >
    <mx:Script>
        <![CDATA[
            import com.esri.aws.osgi.framework.ServiceTracker;
            import com.esri.aws.services.GeocodeCandidate;
            import com.esri.aws.services.GeocodeInfo;
            import com.esri.aws.services.IAddressFinder;
            import com.esri.aws.services.AddressFinderOptions;
            import com.esri.aws.osgi.framework.IServiceReference;
            import flash.utils.getQualifiedClassName;
            import mx.collections.ArrayCollection;
            import mx.controls.Alert;
            import mx.rpc.IResponder;

            [Bindable]
            private var candidates:ArrayCollection;            
            private var findTracker:ServiceTracker;
            
            private function onComplete():void
            {
                findTracker = new ServiceTracker(Framework.getInstance().systemContext, getQualifiedClassName(IAddressFinder));
                findTracker.open();
            }

            private function doSearch():void
            {
                var findService:IAddressFinder = findTracker.getService() as IAddressFinder;
                
                if (findService)
                {
                    //build some simple options
                    var m_options:AddressFinderOptions = new AddressFinderOptions();
                    m_options.dataSource = "auto"; // ArcWeb:DE.IP.World

                    //call the AddressFinder service using 'this' as the responder.
                    findService.findLocationByIP(locationText.text,m_options,this);
                    m_info.htmlText = "Sending request ...";
                }
            }
            public function result(data:Object):void
            {
                var m_geocodeInfo:GeocodeInfo = GeocodeInfo(data);
                m_info.htmlText = "Request completed:<br/>";
                candidates = new ArrayCollection(m_geocodeInfo.candidates);
                if (candidates.length > 0 )
                {
                    for(var i:int=0; i< candidates.length; i++)
                    {
                        var gc:GeocodeCandidate = candidates[i];
                        m_info.htmlText += "<b>" + gc.desc1 + "</b> at <b>" 
                            + gc.latLon.y + "," + gc.latLon.x + "</b> [" + gc.matchType + "]<br>";
                    }
                } 
                else
                {
                    m_info.htmlText += "<b>No matches.";
                }
            }
            public function fault(info:Object):void
            {
                m_info.htmlText = "Request failed."; 
                Alert.show(info.toString());
            }
        ]]>
    </mx:Script>
    <awx:Framework id="m_framework" apiKey="[MY-API-KEY]">
        <awx:AddressFinderActivator/>
    </awx:Framework>
    <mx:Panel paddingTop="5" paddingLeft="5" paddingBottom="5" paddingRight="5"
            title="Find Location by IP" layout="horizontal">
        <mx:TextInput width="95%" id="locationText" text="203.199.93.39" enter="doSearch()"/>
        <mx:Button label="Find IP" click="doSearch()" id="m_button" />
    </mx:Panel>
    <mx:Text id="m_info" fontSize="14" top="100"/>
</mx:Application>