#-------------------------------------------------------------------------------
# Name: ClipLayer.py
# Description: Clip USA Rivers to the extent of state boundaries.
# Results can be found in your Portal
# Requirements: ArcGIS GeoAnalytics Server
# Import system modules
import arcpy
# Set local variables
clipFeatures = "https://sampleserver6.arcgisonline.com/arcgis/rest/services/USA_Rivers/FeatureServer/0"
studyArea = "https://sampleserver6.arcgisonline.com/arcgis/rest/services/Nebraska_Boundary/FeatureServer/0"
outFS = "NebraskaRivers"
dataStore = "RELATIONAL_DATA_STORE"
# Execute Clip Layer
arcpy.geoanalytics.ClipLayer(clipFeatures, studyArea, outFS, dataStore)