Can you write an example python arcgis feature
- User
Can you write an example python arcgis feature
- Assistant
Certainly! Here's an example of how to create a point feature using the ArcGIS Python API:
from arcgis.gis import GIS from arcgis.features import Feature, FeatureLayer, FeatureSet # Connect to your ArcGIS Online organization or portal gis = GIS("https://www.arcgis.com", "username", "password") # Create a point feature point = { "geometry": { "x": -118.2437, "y": 34.0522, "spatialReference": {"wkid": 4326} }, "attributes": { "name": "Los Angeles", "population": 3990456 } } # Create a feature object feature = Feature(point) # Create a feature set feature_set = FeatureSet([feature]) # Publish the feature set as a new feature layer feature_layer = FeatureLayer.publish_feature_set( feature_set, gis, "Point Feature", "This is a point feature example", tags="point, example", folder="My Folder" ) # Print the URL of the created feature layer print(feature_layer.url)
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.