Select to view content in your preferred language

Create a Service from a KML

415
2
08-08-2013 12:01 AM
FugroSurvey_Ltd_
Emerging Contributor
Hi everyone,

I'm having problems figuring out how to make this. I've got a dynamic KML which is fed every 5 minutes with positions from our vessels offshore and is part of another internal application.
I would like to be able to also publish that on my website through ArcGIS Server but so far all I managed to do was to convert the KML into a Layer and then make a service using that. The problem is that this layer then becomes static and I need everything to be dynamic.
Any suggestions?
Tags (2)
0 Kudos
2 Replies
YungKaiChin
Regular Contributor
There may be a few ways to approach the problem.
You can look into ways to publish real-time data.

GeoEvent extension for Server (not released yet I think) may be an easier (and costly) way to do it.
0 Kudos
NeoGeo
by
Frequent Contributor
If you want to use it in the Flex viewer, you can just create a kml folder under wwwroot and put the kml there, then just add it to your config.xml in this format but point it at your kml: (note that using ESRI's server to parse it will not work unless the file is world readable)
<layer label="Forecast River Gauges" type="kml" visible="false" alpha="1.0"
                   url="http://water.weather.gov/ahps/worldfiles/ahps_national_fcst.kmz">
      </layer>

If you actually want to make a service out of it for Desktop use,I have seen it done several ways:
1) create a script which downloads it and runs the kml to layer tool and then schedule the script as a task in task manager to run on whatever interval you want (doesn't work unless you have a desktop license on the server)

2) create a tool and make it into a geoprocessing task (At 10.0 this uses tool layers but there are no tool layers in 10.1 so it is handled a bit differently in 10.1 and 10.2 and I have not done it yet).  This way is more difficult to program, but the licensing is covered because it is a geoprocessing task.

3) You can make a Python script and use the xml library of your choice to read the kml in, then you can use the shapefile library to write a shapefile, all without using any ArcObjects or Arc-anything so no licenses required.  You make it overwrite the file and schedule it as a task in Windows task manager.  You will need to use the define projection tool once ahead of time to create the projection info for the file (but it never changes after that) because the shapefile library for Python won't create that.
0 Kudos