Uploaded image for project: 'Observium'
  1. Observium
  2. OBS-2767

Parsing of sysLocation string with space not working

Details

    • Bug
    • Resolution: Fixed
    • Minor
    • None
    • Professional Edition
    • Poller
    • None

    Description

      Hi,

      Currently running: 18.9.9432 (10th September 2018)

       

      We are having an issue with parsing of the sysLocation string for devices. 

       

      We use "City, State" for our sysLocation string which worked in the past, however at some point this stopped working as newly added devices are not set to the correct location.

       

      Example of incorrect parsing:

      sysLocation string "Aurora, CO"

       

      Resulting geolocation API query:

      Geocoding ENABLED, try detect device coordinates:
      by PARSING sysLocation (API: GOOGLE) - FOUND
      GEO API REQUEST: https://maps.googleapis.com/maps/api/geocode/json?sensor=false&language=en&key=***&address=+CO
      GEO LOCATION: United States (Country), Kansas (State), Montgomery (County), Coffeyville (City)
      GEO COORDINATES: 37.0335516 (Latitude), -95.6376017 (Longitude)

       

      The problem is the address being parsed to "+CO" and not "Aurora%2C+CO" as it is with devices that were added in the past.

       

      We are not sure when this behavior changed.

      Attachments

        Activity

          [OBS-2767] Parsing of sysLocation string with space not working

          This seems to be being cut off at the comma, not at the space.

          It seems that we do this when google reports the address as "approximate", and then re-run the query with the first bit chopped off. We do this in case the first element is a business name and is confusing the API.

          I've modified this code to only do this if the address is > 20 characters.

           

           

          adama Adam Armstrong added a comment - This seems to be being cut off at the comma, not at the space. It seems that we do this when google reports the address as "approximate", and then re-run the query with the first bit chopped off. We do this in case the first element is a business name and is confusing the API. I've modified this code to only do this if the address is > 20 characters.    

          People

            adama Adam Armstrong
            csmith37356584 Chris Smith
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: