I have a web map that I am building into an Operations Dashboard. One of the layers is a KML feed. I know that the O.D. widgets don't support this, but wondering if anyone knows of a workaround to get KML feed/data to work with an Ops Dashboard widget?
Bob, KML's are extremely difficult to work with because of how the architecture of the the data is written which creates limitations for displaying in ArcGIS Online. A solution if you are familiar with Python that you could pursue is do a transformation of the data from KML -> GeoJSON -> Overwriting a Feature Service through Python. Give this documentation a look over overwriting_feature_layers | ArcGIS for Developers
The code below is one I have successfully implemented to update a Feature Service through a KML Feed.
# coding: utf-8
# Import libraries
import urllib.request, json
from arcgis.gis import GIS
from arcgis import features
# Connect to the GIS
gis = GIS("https://www.arcgis.com", "Your Username", "Your Password")
print("Logged in as " + str(gis.properties.user.username))
# ## Overwrite the feature layer
# Let us overwrite the feature layer using the new csv file we just created. To overwrite, we will use the `overwrite()` method.
#item id of the feature layer in AGOL Organization
CNF_incidents_featureLayer_item = gis.content.get('Feature Service ID')
from arcgis.features import FeatureLayerCollection
CNF_incidents_flayer_collection = FeatureLayerCollection.fromitem(CNF_incidents_featureLayer_item)
from arcgis.features import FeatureLayer
CNF_incidents_flayer = FeatureLayer.fromitem(CNF_incidents_featureLayer_item, layer_id=0)
#get the count of the features in the geojson
json_data = open(CNF_incidents_json_file)
data2 = json.load(json_data)
#if there are features then overwrite the layer with the new data. If no features then truncate the database.
dirPath = "C:/Python_Testing/KML2GeoJSON/KML"
fileList = os.listdir(dirPath)
for fileName in fileList:
Let me know if you have any questions.
You should be able to configure it through ArcGIS Server/Portal given the fact that it is already a rest service. All you would need to do is change the "Connect to GIS URL" to your Portal URL. Let me know if that helps.