IN THIS ARTICLE

3rd party Maps and Geocoding services

Incorrect email!

The article was successfully sent to the email

Geocoding services

1. Google policy changes


More on updated Google policies can be found at the link below:
https://cloud.google.com/maps-platform/user-guide/account-changes/

If you want to use the Google Geocoding APIs with TRBOnet, it’s required to obtain the Google Geocoding API to make it work with TRBOnet.

TRBOnet may use:

The Geocoding API for the Geocoding feature (https://developers.google.com/maps/documentation/geocoding/).

After creating the API key (with some or all of the aforementioned Google APIs turned on), it’s necessary to edit the TRBOnet Server config file manually. We would recommend installing a test system to make sure that everything works as expected and not to harm the live system. It is also highly recommended making Server config backup in advance (refer to this article)

First and foremost, we suggest making sure that a Google API key is able to fetch the data.

Append the key you got to the end of the string at the link below and open this link in a web browser. If it shows the status “OK” and gives results rather than denies request with the “REQUEST_DENIED” status, then it can be added to TRBOnet.

2. OSM Nominatim policy changes


TRBOnet starting with version 5.3.5.1902 complies with the updated usage policy.

More on updated Nominatim policies can be found at the link below:
https://operations.osmfoundation.org/policies/nominatim/

It had become required to "Provide a valid HTTP Referer or User-Agent identifying the application (stock User-Agents as set by http libraries will not do)", so TRBOnet updated the methods it uses to comply with the Nominatim Usage Policy.

3. Adding geocoding services to the TRBOnet Server configuration file

    1) Make backups of TRBOnet Server config files so that you could have at hand a backup you could restore the system configuration from.
    2) Stop the TRBOnet service and close the Server Configurator window.
    3) Open the TRBOnet Server config file:
    %ProgramData%\Neocom Software\TRBOnet.Enterprise\TRBOnet.Enterprise.Server.config
    4) In <GeocodingServers> add your API key for Geocoding Server named Google or Nominatim exactly as you might see on the attached screenshot for the urlGetStreetName and urlGetCoordinates methods.
    The methods have the key parameter. It is the place you want to add the API key you have obtained.

    For example, if you were given the key that is 12345abc, have a look at the two pieces of configuration below to learn where to put the key in:

    What you have by default:

      <GeocodingServers>
        <GeocodingServer enabled="True" name="Google" static="True" urlGetStreetName="https://maps.googleapis.com/maps/api/geocode/xml?latlng={lat},{lon}&amp;amp;sensor=true&quot; urlGetCoordinates="https://maps.googleapis.com/maps/api/geocode/xml?address={address}&amp;amp;sensor=true&quot; geoParser="1" useGetStreetName="True" useGetCoordinates="True" />
        <GeocodingServer enabled="True" name="Nominatim" static="True" urlGetStreetName="https://nominatim.openstreetmap.org/reverse?format=xml&amp;amp;lat={lat}&amp;amp;lon={lon}&a...; urlGetCoordinates="https://nominatim.openstreetmap.org/search?q={address}&amp;amp;format=xml&quot; geoParser="2" useGetStreetName="True" useGetCoordinates="True" />
      </GeocodingServers>

    What it should look like:

      <GeocodingServers>
        <GeocodingServer enabled="True" name="Google" static="True" urlGetStreetName="https://maps.googleapis.com/maps/api/geocode/xml?latlng={lat},{lon}&amp;amp;sensor=true&quot; urlGetCoordinates="https://maps.googleapis.com/maps/api/geocode/xml?address={address}&amp;amp;key=12345abc" geoParser="1" useGetStreetName="True" useGetCoordinates="True" />
        <GeocodingServer enabled="True" name="Nominatim" static="True" urlGetStreetName="https://nominatim.openstreetmap.org/reverse?format=xml&amp;amp;lat={lat}&amp;amp;lon={lon}&a...; urlGetCoordinates="https://nominatim.openstreetmap.org/search?q={address}&amp;amp;format=xml&quot; geoParser="2" useGetStreetName="True" useGetCoordinates="True" />
      </GeocodingServers>


    After you are sure that everything works as it should, implement the changes to the live system, making backups of TRBOnet Server and Console in advance.
    5) In Console select the "Load data from TRBOnet Server if Geocoding services are inaccessible from Local PC" checkbox. What the checkbox does is in case TRBOnet Console is unable to get to the geocoding services, the Console will use TRBOnet Server, which we added before to work with the API key you have obtained, to make geocoding requests.
Note!
We recommend making sure that the “Request a place name upon receiving GPS coordinates” parameter is unchecked. It prevents TRBOnet from geocoding all of the GPS data received by TRBOnet upon receiving, which allows for reducing the number of geocoding requests.

In case of the aforementioned parameters are unchecked, a geocoding request to 3rd party API services happens when:
  1. Hovering over a radio, an object on map that has a set of GPS coordinates;
  2. Using the “Find on Map” button in Location Tracking;
  3. Making reports which involve showing street names in them.
  4. Making other actions that show a place name.


Note!
The TRBOnet Server stores a once geocoded set of GPS coordinates until the TRBOnet Server service restarts.


4. Some advice on using geocoding services

1. To get an estimate for monthly costs of using the Google APIs, you could consult the Google Pricing Calculator (https://mapsplatformtransition.withgoogle.com/calculator).
Given that they provide users with 200$ free credit monthly, the number of requests that should not be exceeded is 40000 Google Geocoding API requests.
You can see the statistics of how many Google’s API requests were made in the Google Cloud Platform APIs & Services -> Dashboard.

Note!
We cannot confirm or refute the estimates that Google provides you with. We would advise you to get in contact with Google to learn more on that.

2. If you don’t intend to use the TRBOnet Report feature, try to use the Nominatim geocoding, which is free but is limited to 1 request per second (if the requests are coming faster than once in a second, they will not be queued up but the computer's making requests IP address will be banned instead).

3.You can use TRBOnet Map Server (get in touch with your manager to know more about it) as a local reverse-geocoding (a set of GNSS coordinates to a readable address or place name) server or any open-source solution, for example Nominatim (http://nominatim.org/release-docs/latest/admin/Installation/).

After it is up and running, simply add it to TRBOnet Server and Console:

Note!
We don’t provide any support for setting up, using, and maintaining your own non-TRBOnet geocoding servers as well as 3rd party API services.

5. URLs used by Geocoding Services


Google:
https://maps.googleapis.com/maps/api/geocode/xml?latlng={lat},{lon}
https://maps.googleapis.com/maps/api/geocode/xml?latlng={lat},{lon}

Nominatim:
https://nominatim.openstreetmap.org/reverse?format=xml&lat={lat}&lon={lon}
https://nominatim.openstreetmap.org/search?q={address}&format=xml


Map services

TRBOnet uses:​ Google Maps Static API for the Location Tracking feature (required only if the map type is set to Google map) (https://developers.google.com/maps/documentation/maps-static/).

The Maps Javascript API for TRBOnet Web Console (https://developers.google.com/maps/documentation/javascript/).

After getting both or one of these keys, add them as follows.


1. Google policy changes


More on updated Google policies can be found at the link below:
https://cloud.google.com/maps-platform/user-guide/account-changes/

If you want to use the Google Geocoding APIs with TRBOnet, it’s required to obtain the Google Geocoding API to make it work with TRBOnet.

TRBOnet is capable of using:

The Maps Static API for the Location Tracking feature (required only if the map type is set to Google map) (https://developers.google.com/maps/documentation/maps-static/);

The Maps Javascript API for TRBOnet Web Console (https://developers.google.com/maps/documentation/javascript/).

First and foremost, we suggest making sure that The Maps Static API key is able to fetch the data.

Append the key you got to the end of the string at the link below and open this link in a web browser. If it shows the status “OK” and gives results rather than denies request with the “REQUEST_DENIED” status, then it can be added to TRBOnet.

https://maps.googleapis.com/maps/api/staticmap?center=Brooklyn+Bridge,New+York,NY&zoom=13&size=600x300&maptype=roadmap &markers=color:blue%7Clabel:S%7C40.702147,-74.015794&markers=color:green%7Clabel:G%7C40.711614,-74.012318 &markers=color:red%7Clabel:C%7C40.718217,-73.998284 &key=

2. OSM Mapnik policy changes

TRBOnet starting with version 5.3.5.1902 complies with the updated usage policy.

More on updated OSM Tile Usage Policy can be found at the link below:
https://operations.osmfoundation.org/policies/tiles/


3. ​Add Google Maps to Dispatch Console


4. ​Add Google Maps to Web Console


1. Enable Maps JavaScript API

2. Find the Default.aspx file in the root folder of the deployed Web Console


3.Find the string and append your API key the way to can see on the screenshot (the correct syntax for the src attribute is as follows:
src='https://maps.google.com/maps/api/js?key=API_KEY_VALUE'. Don’t forget the the closing single quote);


4. Select any of Google maps in Web Console.

5. URLs used by Map Services

MAPNIK http://tile.openstreetmap.org/
THUNDERFOREST = http://tile.thunderforest.com/
BING = http://t0.tiles.virtualearth.net/tiles/
GOOGLE = https://maps.googleapis.com/maps/api/staticmap

Obsolete maps:
CYCLE
 http://a.tile.opencyclemap.org/cycle/
TRANSPORT http://a.tile2.opencyclemap.org/transport/
LANDSCAPE http://a.tile3.opencyclemap.org/landscape/

Helpful?
We're glad this article helped.

Thanks for letting us know. What went wrong?