private void addGeoms(PolutionGeom polutionGeom, PolutionGeom polutionGeom2)
            {
                var g3 = GeometryEngine.Instance.Intersection(polutionGeom.geometry, polutionGeom2.geometry);

                addPolutionGeom(new PolutionGeom(GeometryEngine.Instance.Difference(polutionGeom.geometry, g3), polutionGeom.objects.ToArray()));
                addPolutionGeom(new PolutionGeom(GeometryEngine.Instance.Difference(polutionGeom2.geometry, g3), polutionGeom2.objects.ToArray()));
                addPolutionGeom(new PolutionGeom(g3, polutionGeom.objects.ToArray().Union(polutionGeom2.objects.ToArray()).ToArray()));
            }
            private void createDotsFeature(PolutionGeom polutionGeom)
            {
                var attributes = new Dictionary <string, object>();
                var cpm3       = polutionGeom.objects.Sum(v => v.cityPolutionM3);
                var vpm3       = polutionGeom.objects.Sum(v => v.vilagePolutionM3);
                var cpt        = polutionGeom.objects.Sum(v => v.cityPolutionT);
                var vpt        = polutionGeom.objects.Sum(v => v.vilagePolutionT);

                attributes.Add("SHAPE", polutionGeom.geometry);
                attributes.Add("CityPolutionM3", cpm3);
                attributes.Add("VilagePolutionM3", vpm3);
                attributes.Add("CityPolutionT", cpt);
                attributes.Add("VilagePolutionT", vpt);
                attributes.Add("AllPolutionM3", cpm3 + vpm3);
                attributes.Add("AllPolutionT", cpt + vpt);
                //attributes.Add("IDs", polutionGeom.objects);
                editOperation.Create(dotsNewLayer, attributes);
            }
            private void createFeature(PolutionGeom polutionGeom)
            {
                var attributes = new Dictionary <string, object>();
                var cpm3       = polutionGeom.objects.Sum(v => v.cityPolutionM3);
                var vpm3       = polutionGeom.objects.Sum(v => v.vilagePolutionM3);
                var cpt        = polutionGeom.objects.Sum(v => v.cityPolutionT);
                var vpt        = polutionGeom.objects.Sum(v => v.vilagePolutionT);

                attributes.Add("SHAPE", polutionGeom.geometry);
                attributes.Add("LineLength", GeometryEngine.Instance.Length(polutionGeom.geometry) / 1000);
                attributes.Add("CityPolutionM3", cpm3);
                attributes.Add("VilagePolutionM3", vpm3);
                attributes.Add("CityPolutionT", cpt);
                attributes.Add("VilagePolutionT", vpt);
                attributes.Add("AllPolutionM3", cpm3 + vpm3);
                attributes.Add("AllPolutionT", cpt + vpt);
                //attributes.Add("IDs", polutionGeom.objects);
                editOperation.Create(routesNewLayer, attributes);
            }
            private void addPolutionGeom(PolutionGeom polutionGeom)
            {
                if (polutionGeom.geometry == null || polutionGeom.geometry.IsEmpty)
                {
                    return;
                }
                var a = polutionGeoms.FirstOrDefault(pg => GeometryEngine.Instance.Intersects(pg.geometry, polutionGeom.geometry) &&
                                                     !GeometryEngine.Instance.Intersection(pg.geometry, polutionGeom.geometry).IsEmpty);

                if (a != null)
                {
                    polutionGeoms.Remove(a);
                    addGeoms(a, polutionGeom);
                }
                else
                {
                    polutionGeoms.Add(polutionGeom);
                }
            }
            private void createDotsGeoms(CancelableProgressorSource status)
            {
                List <PolutionGeom> dots = new List <PolutionGeom>();

                foreach (var b in polutionGeoms)
                {
                    if (status.Progressor.CancellationToken.IsCancellationRequested)
                    {
                        return;
                    }
                    Geometry     gd = GeometryEngine.Instance.QueryPoint(b.geometry as Polyline, SegmentExtension.NoExtension, 0, AsRatioOrLength.AsLength);
                    PolutionGeom d  = new PolutionGeom(gd, b.objects.ToArray());
                    PolutionGeom d2 = dots.Find(dot => GeometryEngine.Instance.Intersects(dot.geometry, gd));
                    if (d2 != null)
                    {
                        if (d.objects.Sum(v => v.cityPolutionM3) > d2.objects.Sum(v => v.cityPolutionM3))
                        {
                            dots.Remove(d2);
                            dots.Add(d);
                        }
                    }
                    else
                    {
                        dots.Add(d);
                    }
                }

                foreach (var b in dots)
                {
                    if (status.Progressor.CancellationToken.IsCancellationRequested)
                    {
                        return;
                    }
                    createDotsFeature(b);
                }
            }