The KML to Layer Tool is a prefabricated geoprocessing script which makes it possible to add KML- or KMZ-Data into a WebOffice project during a WebOffice session.

 

Funktionality

This tool offers an input field where the folder path to the KML/KMZ-File can be entered. The different geometry types (Point, Polyline, Polygon) will be extracted from the file and will be added to the map as individual layers.

 

icon_comment

The KML-Layers are only temporary available during the WebOffice session.

 

icon_cross-reference

This geoprocessing tool uses ESRI basic technology and can only be ensured as long as provided by ESRI. More information regarding the functionality of that tool can be found at ArcGIS Ressourcen: KML in Layer.

 

Step 1: Extract ZIP from DVD

Extract the File KMLtoLAYER.zip from WebOffice10.9R3-DVD\SampleProject\WebOffice directories Add-On\WebOfficeGeoprocessing to <ArcGIS Server location>\directories\WebOfficeGeoprocessing.

 

icon_comment

Please ensure that the ArcGIS Server Account has unlimited authorization for that folder.

Please ensure that this or a superior folder is registered with your ArcGIS server.

 

icon_warning

CAUTION!

If you store the folder KMLtoLAYER under a different path as the default "C:\arcgisserver\directories\WebOfficeGeoprocessing\KMLtoLAYER path, changes in the script at \KMLtoLAYER\Script\KMLtoLAYER.py in IDLE to the topmost variable needs to be done. Enter the correct path to your KMLtoLayer folder at the variable baseFOLDER and save the changes.

 

Adapting  of the variable baseFOLDER

Adapting  of the variable baseFOLDER

 

Step 2: Execute tool

Open ArcMap and navigate in the Catalog to the KMLtoLAYER folder. Expand the FGDB Tool.gdb and start the tool KMLtoLAYER.

Now navigate via the explorer to a KML/KMZ-File which you define as Input.

 

icon_comment

If there is no KML/KMZ-File available, you can use the test file which is located at \KMLtoLAYER\Testfiles\KML_Map.kmz

 

Select KML/KMZ-File

Select KML/KMZ-File

 

Execute the tool by clicking on OK and wait for it to run through. At the end there are three new layers (Points, Polylines and Polygons) available in the ArcMap Table of Content (TOC).

 

Geoprosessing result

Geoprosessing result

 

Step 3: Publishing of the KMLtoLAYER results

Now open the window Results and click right on the KMLtoLAYER script. Go to Share As and click on Geoprocessing Service.

 

Publishing the result

Publishing the result

 

Follow the steps of the assistant until you reach the Service Editor. There the following adjustments need to be made:

Geoprocessing: Operation allowed: activate Uploads

Parameters: Execution Mode: Asynchronous

oactivate View results with a map service

Item Description: Fill the text fields Summary and Tags at least with KMLtoLAYER

 

Service Editor adjustments

Service Editor adjustments

 

Service Editor adjustments

Service Editor adjustments

 

Service Editor adjustments

Service Editor adjustments

 

Now verify by clicking Analyze if all requirements to publish successful are met. If any warnings or errors are occurring, make sure to resolve them before publishing.

 

icon_comment

It is recommended to test the tool after publishing by running it with the Test-KMZ using the ArcGIS Geoprocessing Services.

 

Step 4: Configuration of the WebOffice Geoprocessing Tool

Now add your Geoprocessing Tool to your WebOffice 10.9 R3 project configuration. Therefore use the following settings:

Tool tip: Add KML

Tool description: Geoprocessing tool which temporarily adds KML/KMZ-Files to the map.

Tool icon: pub/images/customtool/ct_kml_upload.png

Access control ID: (optional field)

Visible in Toolbar? true

Always show task messages? false

External ID: KMLtoLAYER

Use tool? true

 

Configuring of Geoprocessing tool

Configuring of Geoprocessing tool

 

Next, configure on the sub level the ArcGIS Server Geoprocessing service.

Therefore enter the correct URL of the Geoprocessing service and the following two adjustments:

Geoprocessing Task id: KMLtoLAYER

Maximum wait time for results with asynchronous execution (in seconds): Increase the default value if you are going to have big KLM-Files to 180 for example

 

Configurin of Geoprocessing tool

Configurin of Geoprocessing tool

 

Now publish your WebOffice 10.9 R3 project and verify the functionality in the WebOffice core client.

 

Result of the Geoprocessing tool in the WebOffice core Client

Result of the Geoprocessing tool in the WebOffice core Client

 

icon_comment

If you want to adapt the output symbology, you can create Layer-Files (.lyr) for the three geometry types point, polyline and polygon and save them at \KMLtoLAYER\Symbology\ . The Layer-Files must contain the following naming: Points.lyr, Polylines.lyr and Polygons.lyr.