Select to view content in your preferred language

How to create a feature class?

66
3
yesterday
nadja_swiss_parks
Occasional Contributor II

This might appear really basic, but I only manage to create a query feature class from my dockpane using this code:

await QueuedTask.Run(() => LayerFactory.Instance.CreateLayer<FeatureLayer>(flyrCreatnParam, MapView.Active.Map));

  that's nice, but query feature class don't show the area and length of a feature. however we need that, which is why we want to create a feature class instead. the data lies on a postgis/postgresql database. how can I create a feature class using the ArcGIS Pro .NET SDK?

 

Tags (1)
0 Kudos
3 Replies
AbhijeetNandeshwar1
New Contributor III
0 Kudos
Aashis
by Esri Contributor
Esri Contributor

You can use FeatureClass featureClass = featureLayer.GetFeatureClass() to access the feature class from a feature layer. Please refer to the API for more info.

0 Kudos
nadja_swiss_parks
Occasional Contributor II

Thank you @Aashis  and @AbhijeetNandeshwar1 for your answers.

@Aashis I tried that, but no matter what I do, it won't add the data as FeatureClass to my Active Map, it always adds a Query Feature Class to my map or throws an error that that method is not implemented even if I'm using the code from https://github.com/Esri/arcgis-pro-sdk/wiki/ProSnippets-Geodatabase or the API. 

LayerFactory.Instance.CreateLayer<FeatureLayer>(flyrCreatnParam, MapView.Active.Map)

 how do I add the created feature class to my active map?

0 Kudos