Geocode address within SOE 10.1

1961
1
11-01-2013 09:30 AM
KevinJohnson
Occasional Contributor
Hi could anyone tell me if its possible to geocode an address within a SOE.  It could be done before making direct connection to server.   Is there a way to access either an address locator in the geodatabase or access a locator service... from an SOE thats deployed on a map service?

Thanks  a lot.
Tags (2)
0 Kudos
1 Reply
KevinJohnson
Occasional Contributor
I ended up doing this and it works...

     
Private Function GeocodeSOAP(ByVal Inputadd As String) As String
            Dim geocodeservice As Parcels_GeocodeServer = New Parcels_GeocodeServer()
            geocodeservice.Url = "http://myarcgisserver/arcgisserver/services/Parcels/GeocodeServer"
            ' Define address inputs
           'had to qualify properyset because of ambiguous references
            Dim geocodePropSet As serverparcellocator.PropertySet = New serverparcellocator.PropertySet()
            Dim propArray(1) As PropertySetProperty
            Dim geocodeProp As PropertySetProperty = New PropertySetProperty()
            geocodeProp.Key = "Street"
            ' Intersection
            'geocodeProp.Value = "Magnolia & Central";
            ' Address
            geocodeProp.Value = InputAPN
            propArray(0) = geocodeProp
            Dim geocodeProp1 As PropertySetProperty = New PropertySetProperty()
            geocodeProp1.Key = "Zone"
            geocodeProp1.Value = ""
            propArray(1) = geocodeProp1
            geocodePropSet.PropertyArray = propArray
            'Geocode address
            Dim results As wateragsparcellocator.PropertySet = geocodeservice.GeocodeAddress(geocodePropSet, Nothing)
            Dim resultsArray() As PropertySetProperty = results.PropertyArray
            Dim geocodePoint As PointN = Nothing
            Dim result As PropertySetProperty
            For Each result In resultsArray
                Dim val As String = result.Key.ToString()
                If result.Key = "Shape" Then
                    geocodePoint = CType(result.Value, PointN)
                    Dim x As Double = geocodePoint.X
                    Dim y As Double = geocodePoint.Y
                End If
            Next
            Return CStr(geocodePoint.X) & " " & CStr(geocodePoint.Y)
        End Function

Choose soap over http request because It seems easier to deal with the results after finding this example....
0 Kudos