Nearmap





Nearmap WMS 2.0

As of August 2022 Nearmap have updated their WMS server, they have referred to this update as "WMS 2.0" but this is not a change to the WMS version supported by Nearmap, it is still 1.1.1, and is just used to indicate a new implementation of their server.

This change will break existing Weave toc model configurations for the Nearmap WMS map engines, since the change involved the renaming of all of the layers in Nearmap. The Nearmap WMS map engine in Weave still works as it did before, but you will need to update any toc models you have that relate to the Nearmap map engine to reflect the new layer names.

Note you should ensure that the id attribute for each toc model entry remains the same after the update so as to not break any bookmarks.



Integration with Nearmap can be done in two ways, either as a WMS service or as a separate tab in the interface similar to StreetView and Google Earth.

In order to use either of these two methods, you will need to be a licensed user of the Nearmap service.

Nearmap Panel

Server config

To enable the integration with Nearmap and Weave you'll need to provide Weave with the username/password that the Nearmap service is registered with, this is to allow Weave to generate tickets for authentication.

1 2 3 4 5 6 7 8 9 10 11 <?xml version="1.0" encoding="UTF-8"?> <config xmlns="urn:com.cohga.server.config#1.0" xmlns:nearmap="urn:com.cohga.nearmap#1.0"> <nearmap:config> <url><![CDATA[https://app.nearmap.com/api/0/checkaccess?]]></url> <username>user@organisation.com</username> <password>ENCFASGAHFUASHGASFAS</password> </nearmap:config> </config>

Client panel

The Web interface used in the Nearmap site can be embedded into a separate tab in Weave.

1 2 3 <view id="weave.nearmap"> <location>center</location> </view>

Updated client config

Due to changes in the Nearmap API you must include an API key in the panel config, also note the change from weave.nearmap to weave.nearmap2.

You will need to get an API key from the Nearmap Administration page using your login and place it in the apiKey option below.

Note this requires version 2.6.6 of Weave or version 1.3.15 of the com.cohga.weave.nearmap bundle.

1 2 3 4 5 6 <view id="weave.nearmap2"> <location>center</location> <title>Nearmap</title> <tabTip>Provides up-to-date aerial images</tabTip> <apiKey>YOUR_API_KEY</apiKey> </view>

WMS Service

A simple way that Nearmap can be added is using the WMS service provided by Nearmap. This is a standard WMS service that works the same as any other described in WMS MapEngine.

Custom WMS Service

First, add a reference to the WMS Map Engine, note this is a custom Nearmap service, so you should replace "[placeid]" with the unique id from the Nearmap Web UI, and "[apikey]" with your Nearmap API key.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 <wms:mapengine id="nearmap.custom"> <url>https://api.nearmap.com/wms/v1/places/[placeid]/apikey/[apikey]</url> <format>image/jpeg</image> <!-- this may be needed if you use GDA94 and/or you maps do not align, GDA2020 is also a valid value but that is now the default --> <tokens> <token name="DATUM" value="GDA94"/> </tokens> <!-- Optionally you can refine which layers are imported, this is the format of the new "Nearmap WMS 2.0" layer names --> <layers> <layer>area/a9e71723-ccd2-43a7-9983-1e4b91180492/survey/66a9a120-fd8d-11ec-aed0-0ff28f9b30f6/2022-06-28</layer> <layer>area/a9e71723-ccd2-43a7-9983-1e4b91180492/survey/66a9a120-fd8d-11ec-aed0-0ff28f9b30f6/2022-05-21</layer> <layer>area/a9e71723-ccd2-43a7-9983-1e4b91180492/survey/66a9a120-fd8d-11ec-aed0-0ff28f9b30f6/2022-04-17</layer> <layer>area/a9e71723-ccd2-43a7-9983-1e4b91180492/survey/66a9a120-fd8d-11ec-aed0-0ff28f9b30f6/2022-02-12</layer> </layers> </wms:mapengine>

Add this service to the client that you want the WMS service to be visible in

1 2 3 4 5 6 7 8 <mapEngine id="nearmap.custom"> <options> <transitionEffect>force</transitionEffect> <ratio>1.0</ratio> <singleTile>true</singleTile> <alpha>false</alpha> </options> </mapEngine>

Generating the ToC entries for the service is a simple matter of executing the command at the OSGi console.

1 memd toc nearmap.custom

Running the above command will produce output similar to the following (it's tidied slightly to ensure the lines are not too long).

Sample Nearmap ToC
1 2 3 4 5 6 7 8 9 10 11 12 13 <toc:model id='toc.nearmap.custom'> <mapengine>nearmap.custom</mapengine> <entry id='l_nearmap_2022_06_28' layer='area/a9e71723-ccd2-43a7-9983-1e4b91180492/survey/66a9a120-fd8d-11ec-aed0-0ff28f9b30f6/2022-06-28' label='2022-06-28' checked='false'/> <entry id='l_nearmap_2022_05_21' layer='area/a9e71723-ccd2-43a7-9983-1e4b91180492/survey/b6a319f0-e527-11ec-92cb-5f369ada9adb/2022-05-21' label='2022-05-21' checked='false'/> <entry id='l_nearmap_2022_04_17' layer='area/a9e71723-ccd2-43a7-9983-1e4b91180492/survey/080e2fcc-ca85-11ec-a3f1-63cd31199c81/2022-04-17' label='2022-04-17' checked='false'/> <entry id='l_nearmap_2022_02_12' layer='area/a9e71723-ccd2-43a7-9983-1e4b91180492/survey/bcb9e86c-9f29-11ec-a2bb-0f7189b9585c/2022-02-12' label='2022-02-12' checked='false'/> <!-- more layers here --> <entry id='l_nearmap_2009_10_12' layer='area/a9e71723-ccd2-43a7-9983-1e4b91180492/survey/088cfd6c-b95e-11e7-acde-0b13416f1c3c/2009-10-12' label='2009-10-12' checked='false'/> <entry id='l_nearmap_all_combined' layer='area/a9e71723-ccd2-43a7-9983-1e4b91180492/all/all-combined' label='Combined' checked='false'/> <entry id='l_nearmap_satellite' layer='Satellite' label='Satellite' checked='false'/> </toc:model>

Simple WMS Service

First, add a reference to the WMS Map Engine you should replace "[apikey]" with your Nearmap API key.

1 2 3 4 5 6 7 8 9 <wms:mapengine id="nearmap.simple"> <url>https://api.nearmap.com/wms/v1/latest/apikey/[apikey]</url> <format>image/jpeg</image> <!-- this may be needed if you use GDA94 and/or you maps do not align, GDA2020 is also a valid value but that is now the default --> <tokens> <token name="DATUM" value="GDA94"/> </tokens> </wms:mapengine>

Add this service to the client that you want the WMS service to be visible in

1 2 3 4 5 6 7 8 <mapEngine id="nearmap.simple"> <options> <transitionEffect>force</transitionEffect> <ratio>1.0</ratio> <singleTile>true</singleTile> <alpha>false</alpha> </options> </mapEngine>

Generating the ToC entries for the service is a simple matter of executing the command at the OSGi console.

1 memd toc nearmap.simple

Running the above command will produce output similar to the following.

Sample Nearmap ToC
1 2 3 4 5 6 <toc:model id='toc.nearmap.simple'> <mapengine>nearmap.simple</mapengine> <entry id='l_nearmap.simple_nearmap' layer='Nearmap' label='Nearmap' checked='false'/> <entry id='l_nearmap.simple_nearmap/nearmap/australia' layer='Nearmap/Nearmap/Australia' label='Australia latest' checked='false'/> <entry id='l_nearmap.simple_satellite' layer='Satellite' label='Satellite' checked='false'/> </toc:model>