Select to view content in your preferred language

How can I get bounding box of features

1659
1
10-20-2022 10:35 PM
SIASIA1
Emerging Contributor

Hi, I created featureLayer with this code.

string featureClassPath = Path.Combine(Project.Current.DefaultGeodatabasePath, "SIA_" + Data.Data.layer_count.ToString());
var featureClassUri = new Uri(featureClassPath);
var parameters = Geoprocessing.MakeValueArray("./result.json", featureClassPath, "POINT");
var gpResult = Geoprocessing.ExecuteToolAsync("conversion.JSONToFeatures", parameters,
null, CancelableProgressor.None, GPExecuteToolFlags.None);
var layerParams = new FeatureLayerCreationParams(featureClassUri)
{
Name = job_id,
IsVisible = true,
};
var createdFC = LayerFactory.Instance.CreateLayer<FeatureLayer>(layerParams, MapView.Active.Map);

I want to get BBOX(bounding box) of features of FeatureLayer

After getting it, I also want to use bbox to create layer using WMTS.

I know how to get WMTS from url

var serverConnection = new CIMInternetServerConnection { URL = json["Mapbox"].ToString() };
var connection = new CIMWMTSServiceConnection { ServerConnection = serverConnection };
var layerParams = new RasterLayerCreationParams(connection)
{
Name = job_id,
IsVisible = true,
};

ArcGIS.Desktop.Framework.Threading.Tasks.QueuedTask.Run(() =>
{
var layer = LayerFactory.Instance.CreateLayer<FeatureLayer>(layerParams, MapView.Active.Map);
});

But I don't  know how to create layer only in range of BBOX

 

0 Kudos
1 Reply
TomGeo
by
Frequent Contributor

As far as I can see you do not select any features from the newly created feature class, thereby I would aim for the feature layers extend to create the bounding box from it. 

Setting the extend of your WMTS layer will mostly require to look into the CIM, although I was lately looking into something similar and couldn’t find a possibility in the api to set an extent for service layers. 

- We are living in the 21st century.
GIS moved on and nobody needs a format consisting out of at least three files! No, nobody needs shapefiles, not even for the sake of an exchange format. Folks, use GeoPackage to exchange data with other GIS!
0 Kudos