IN THIS ARTICLE

3rd party Maps and Geocoding services

Incorrect email!

The article was successfully sent to the email

Geocoding services

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.
https://maps.googleapis.com/maps/api/geocode/xml?address=broadway&key=

OSM Nominatim policy changes require new User Agent publication in requests
TRBOnet starting with version 6.2.2.7485 Enterprise or Plus complies with the updated usage policy.
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.


Adding User Agent description to the TRBOnet Server configuration file to allow Nominatim geocoding feature (available for version 6.2.2.7485 and newer)
    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. Find the <UserAgent>Mozilla/5.0</UserAgent>
    What you have by default:
    <UserAgent>Mozilla/5.0</UserAgent>
    What it should look like:
    <UserAgent>Mozilla/5.0</UserAgent>
    OR
    Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 YaBrowser/24.4.0.0 Safari/537.36
    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!
Nominatim allows only one request for Geocode per second.
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.

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.

Some advice on using Geocoding services
1. To get an estimate for monthly costs of using the Google APIs, you could consult the Google Geocoding API Usage and Billing (https://developers.google.com/maps/documentation/geocoding/usage-and-billing).
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.


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.

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 with Google Maps and Static API usage
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=

OSM Mapnik policy changes
TRBOnet starting with version 5.7.0.5132 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/

Add Google Maps to Dispatch Console



Bing maps access policy terms
Bing API licensing information available via link below:
http://mapsforenterprise.binginternal.com/en-us/maps/licensing

By Default the following terms are applied:
  • Conduct fewer than 125,000 transactions per calendar year.
  • Conduct fewer than 50,000 transactions within any 24-hour period.
Obtained Bing API key can be added as per screenshot below:



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.



Helpful?
We're glad this article helped.

Thanks for letting us know. What went wrong?