Get Lat and Lon from address

Jul 21, 2011 at 9:43 PM

I am trying to obtain the Lat and Lon for an address string. I modified your code

Added a new GetAddress() in Client.vb

        Public Function GetAddress(address As String) As SimpleGeo.AddressFeature
            Return Read(Of SimpleGeo.AddressFeature)( _
                Service.AddressEndpoint(address))
        End Function

and in the Description.vb I added

        Public Function AddressEndpoint(ByVal address As String) As MessageReceivingEndpoint
            Return Endpoint( _
                "places/address.json?address={0}", address)
        End Function

When I try

        Dim version As New System.Version("1.0")

        Try
            Using sgeo As New SimpleGeo.Service.Client(version, "key", "secret")

                Dim addressFeature As AddressFeature = sgeo.GetAddress("San Francisco, CA")
                MsgBox(addressFeature.Geometry.Lat.ToString())
            End Using
        Catch ex As Exception
            MsgBox(ex.Message)
        End Try

I am getting "Object Reference not set to instance of an object" error.  Would you be able to tell me where I am going wrong?