Select to view content in your preferred language

Apply spatial filtering to Unity

210
0
11-17-2023 05:56 AM
Deivydas24
New Contributor II

Hello,

I'm using ArcGIS Maps SDK for Unity and I want to do one thing. I created a map using Map Creator UI and uploaded scene layer with 3D house models (like in example with New York). No I want to delete a certain part in my project using spatial filtering. Bu a problem I can't quite understand how to do that.
This is what I tried so far:

	void CreatePolygon()
	{
		ArcGISPolygonBuilder pb = new ArcGISPolygonBuilder(ArcGISSpatialReference.WGS84());
		ArcGISPoint point1 = new ArcGISPoint(21.130116, 55.663546, ArcGISSpatialReference.WGS84());
		ArcGISPoint point2 = new ArcGISPoint(21.148544, 55.664257, ArcGISSpatialReference.WGS84());
		ArcGISPoint point3 = new ArcGISPoint(21.180174, 55.645800, ArcGISSpatialReference.WGS84());
		ArcGISPoint point4 = new ArcGISPoint(21.131820, 55.639522, ArcGISSpatialReference.WGS84());

		pb.AddPoint(point1);
		pb.AddPoint(point2);
		pb.AddPoint(point3);
		pb.AddPoint(point4);
		ArcGISPolygon polygon = (ArcGISPolygon)pb.ToGeometry();

		ArcGISPolygonCollection collection = new ArcGISPolygonCollection();
		collection.Add(polygon);


		var map = this.gameObject.GetComponents<ArcGISMapComponent>();
		ArcGISSpatialFeatureFilter filter = new ArcGISSpatialFeatureFilter(polygon, ArcGISSpatialFeatureFilterSpatialRelationship.Disjoint);
	}

 

Maybe someone has a knowledge how to achieve a spatial filtering?

Thank you!

0 Kudos
0 Replies