This project is read-only.

Get Lat and Lon from address

Jul 21, 2011 at 10: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)( _
        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")

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

                Dim addressFeature As AddressFeature = sgeo.GetAddress("San Francisco, CA")
            End Using
        Catch ex As Exception
        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?