Geocoding

Is there any way to leverage the platform to translate a set of latitutde and longitude coordinates into an address? I have seen a lot of the sample applications and the asset simulator do this, but I can't figure out how my web application residing on the platform or my custom objects can automatically do this translation.  

I know that google offers its own API, but given the number of assets we will need to translate location data for, I would need to purchase a license through google, and if possible I would rather treat Axeda as the one stop shop for my asset tracking needs.

 

-Indu

Alternatives for Geocoding

Hello,

    Unfortunately the platform does not support geocoding on its own.  If you are interested in free and open alternatives to Google Maps, check out http://www.gisgraphy.com/ which was developed specifically for that purpose.  I have not tried it myself so please post any feedback you have if you end up using it with the Platform.

Thanks for the question!

Sara

Hi, I wrote this groovy

Hi,

 

I wrote this groovy Script that returns the Address based on a lat,lon parameter (named loation)

As you can see it uses the http://ws.geonames.org" REST webservices and returns the Address which can then be used in Expression Rules, etc

You are correct, the Axeda platform is the one stop shop and can really do anything....

 

import groovyx.net.http.RESTClient

String rmdHostname =  "http://ws.geonames.org";
def location = parameters.location.toString()
def locparts = location.split(',')
def lat = locparts[0]
def lon = locparts[1] 
rmd = new RESTClient(rmdHostname);
List osmTableIds = new ArrayList()

try {
      def resp = rmd.get( path: 'findNearestAddress', query:[lat:lat , lng:lon] )
       streetnum = resp.data.address.streetNumber.text()
       street = resp.data.address.street.text()
       town =   resp.data.address.placename.text()
      // county= resp.data.address.adminName2.text()
       state = resp.data.address.adminCode1.text()
       postalcode = resp.data.address.postalcode.text()
       logger.info(streetnum + " " + street + " " + town +  " " + state + " " + postalcode   )
       return streetnum + " " + street + " " + town +  " " + state + " " + postalcode   
} catch (groovyx.net.http.HttpResponseException e) {
    e.printStackTrace();
}
Martin Tobias

Thanks Martin, I have been

Thanks Martin, I have been looking into GeoNames as our  solution.  For the reverse geocoding function on the asset simiulator and maps displaying asset locations that are accessible to a user logged into the platform, does Axeda use similar open source software?

 

-Indu

Hi Indu The Asset Simulator

Hi Indu

The Asset Simulator users the Google (ClientGeocoder and GeocodingEvent classes) imported into Flash.

The Platform UI uses Google as well.

 

Thanks

Martin Tobias