public void MultiPolygonGeoJsonToEsriPolygonList()
        {
            var multiPolyJson = TestResources.CoNcMultiPolygonGeoJson;
            var output        = GeometryClasses.AoiGeoJsonToEsriPolygons(multiPolyJson);

            Assert.IsTrue(output.Count == 2);
        }
        public void TestGeoJsonSingleToEsriJson()
        {
            var poly   = TestResources.NorthCarolinaPolygonGeoJson;
            var output = GeometryClasses.GeoJsonObjectToEsriJsonList(poly);

            Assert.IsTrue(output.Count == 1);
        }
        public void TestGeoJsonBaseObjectMultiPolygonToEsriJson()
        {
            var multiPolyJson = TestResources.CoNcMultiPolygonGeoJson;

            var output = GeometryClasses.GeoJsonObjectToEsriJsonList(multiPolyJson);

            Assert.IsTrue(output.Count == 2);
        }
        public void TestPolygonGeoJsonObjectToEsriJsonList()
        {
            var multiPolyJson      = TestResources.CoNcMultiPolygonGeoJson;
            var deserializedObject =
                this.deserial.Deserialize <MultiPolygonGeoJson>(
                    new RestResponse <MultiPolygonGeoJson> {
                Content = multiPolyJson
            });
            var         test = new GeometryClasses();
            PrivateType privateHelperObject = new PrivateType(typeof(GeometryClasses));
            var         output = (List <string>)privateHelperObject.InvokeStatic("MultiPolygonObjectToEsriJson", new object[] { deserializedObject });

//            var output = GeometryClasses.MultiPolygonObjectToEsriJson(deserializedObject);

            Assert.IsTrue(output.Count == 2);
        }
Exemplo n.º 5
0
        private void UpdateUiWithRecipes(List <Project2> results, Guid processingGuid)
        {
            this.selectedAois.Clear();
            foreach (var item in results)
            {
                this.selectedAois.AddRange(item.aois);
                var polygonsToBeDrawn = new List <IPolygon>();
                foreach (var aoi in item.aois)
                {
                    polygonsToBeDrawn.AddRange(GeometryClasses.AoiGeoJsonToEsriPolygons(aoi));
                }

                IEnvelope encompassingEnvelope;
                var       elementList = this.CreateElementAois(polygonsToBeDrawn, out encompassingEnvelope);

                if (this.AoiGuid != processingGuid)
                {
                    return;
                }

                var graphicsContainer = (IGraphicsContainer)ArcMap.Document.FocusMap;
                graphicsContainer.DeleteAllElements();

                foreach (var elm in elementList)
                {
                    graphicsContainer.AddElement(elm, 0);
                }

                ArcMap.Document.ActiveView.Extent = encompassingEnvelope;
                ArcMap.Document.ActiveView.Refresh();

                foreach (var recipe in item.recipeConfigs)
                {
                    var newRow = this.RecipeRepo.NewRow();
                    newRow["Recipe Name"] = recipe.recipeName;
                    newRow["Status"]      = "Working";
                    this.RecipeRepo.Rows.Add(newRow);
                }
                this.GetRecipeStatus(this.token, item.id);
            }

            this.recipeStatusDataGridView.Refresh();
            this.recipeStatusDataGridView.PerformLayout();
        }