12
3rd party Maps and Geocoding services 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. https://maps.googleapis.com/maps/api/geocode/xml?address=broadway&key= 2. OSM Nominatim policy changes TRBOnet starting with version 5.3.5.1902 Enterprise or 5.4.0.2199 Plus 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.

3rd party Maps and Geocoding services Geocoding servicesIn case of the aforementioned parameters are unchecked, a geocoding request to 3. rd. party API services happens when: 1. Hovering

  • Upload
    others

  • View
    8

  • Download
    0

Embed Size (px)

Citation preview

Page 1: 3rd party Maps and Geocoding services Geocoding servicesIn case of the aforementioned parameters are unchecked, a geocoding request to 3. rd. party API services happens when: 1. Hovering

3rd party Maps and Geocoding services

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 tomake 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 editthe TRBOnet Server config file manually. We would recommend installing a test system to make sure thateverything works as expected and not to harm the live system. It is also highly recommended making Server configbackup 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 showsthe status “OK” and gives results rather than denies request with the “REQUEST_DENIED” status, then it can beadded to TRBOnet.

https://maps.googleapis.com/maps/api/geocode/xml?address=broadway&key=

2. OSM Nominatim policy changes

TRBOnet starting with version 5.3.5.1902 Enterprise or 5.4.0.2199 Plus 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 theNominatim 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 restorethe system configuration from.

Page 2: 3rd party Maps and Geocoding services Geocoding servicesIn case of the aforementioned parameters are unchecked, a geocoding request to 3. rd. party API services happens when: 1. Hovering

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 asyou 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 configurationbelow 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, makingbackups of TRBOnet Server and Console in advance.

5) In Console select the "Load data from TRBOnet Server if Geocoding services are inaccessible from Local

Page 3: 3rd party Maps and Geocoding services Geocoding servicesIn case of the aforementioned parameters are unchecked, a geocoding request to 3. rd. party API services happens when: 1. Hovering

PC" checkbox. What the checkbox does is in case TRBOnet Console is unable to get to the geocodingservices, the Console will use TRBOnet Server, which we added before to work with the API key you haveobtained, to make geocoding requests.

Note!We recommend making sure that the “Request a place name upon receiving GPS coordinates” parameter isunchecked. It prevents TRBOnet from geocoding all of the GPS data received by TRBOnet upon receiving,which allows for reducing the number of geocoding requests.

Page 4: 3rd party Maps and Geocoding services Geocoding servicesIn case of the aforementioned parameters are unchecked, a geocoding request to 3. rd. party API services happens when: 1. Hovering

In case of the aforementioned parameters are unchecked, a geocoding request to 3rd party API services happenswhen:

Hovering over a radio, an object on map that has a set of GPS coordinates;1.Using the “Find on Map” button in Location Tracking;2.Making reports which involve showing street names in them.3.Making other actions that show a place name.4.

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

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 is40000 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.

Page 5: 3rd party Maps and Geocoding services Geocoding servicesIn case of the aforementioned parameters are unchecked, a geocoding request to 3. rd. party API services happens when: 1. Hovering

Note!We cannot confirm or refute the estimates that Google provides you with. We would advise you to get incontact 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 islimited to 1 request per second (if the requests are coming faster than once in a second, they will not be queued upbut 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, forexample Nominatim (http://nominatim.org/release-docs/latest/admin/Installation/).

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

Page 6: 3rd party Maps and Geocoding services Geocoding servicesIn case of the aforementioned parameters are unchecked, a geocoding request to 3. rd. party API services happens when: 1. Hovering
Page 7: 3rd party Maps and Geocoding services Geocoding servicesIn case of the aforementioned parameters are unchecked, a geocoding request to 3. rd. party API services happens when: 1. Hovering

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

5. URLs used by Geocoding Services

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

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

Map servicesTRBOnet uses:? Google Maps Static API for the Location Tracking feature (required only if the map type is set toGoogle 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 tomake 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

Page 8: 3rd party Maps and Geocoding services Geocoding servicesIn case of the aforementioned parameters are unchecked, a geocoding request to 3. rd. party API services happens when: 1. Hovering

the status “OK” and gives results rather than denies request with the “REQUEST_DENIED” status, then it can beadded 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 Enterprise or 5.4.0.2199 Plus 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

Page 9: 3rd party Maps and Geocoding services Geocoding servicesIn case of the aforementioned parameters are unchecked, a geocoding request to 3. rd. party API services happens when: 1. Hovering

4. ?Add Google Maps to Web Console

1. Enable Maps JavaScript API

Page 10: 3rd party Maps and Geocoding services Geocoding servicesIn case of the aforementioned parameters are unchecked, a geocoding request to 3. rd. party API services happens when: 1. Hovering

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

Page 11: 3rd party Maps and Geocoding services Geocoding servicesIn case of the aforementioned parameters are unchecked, a geocoding request to 3. rd. party API services happens when: 1. Hovering

3.Find the string and append your API key the way to can see on the screenshot (the correct syntax forthe 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.

Page 12: 3rd party Maps and Geocoding services Geocoding servicesIn case of the aforementioned parameters are unchecked, a geocoding request to 3. rd. party API services happens when: 1. Hovering

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/