Exemplo n.º 1
0
        //public static IMathTransform MathTransform
        //{
        //    get { return Transform().MathTransform; }
        //}

        public static GeoResponse.CResult.CGeometry.CViewPort TransformViewport(GeoResponse.CResult.CGeometry.CViewPort viewport)
        {
            Coordinate mNorthEast = MapTransforms.TransformCoordinate(new Coordinate(viewport.NorthEast.Long, viewport.NorthEast.Lat));
            Coordinate mSouthWest = MapTransforms.TransformCoordinate(new Coordinate(viewport.SouthWest.Long, viewport.SouthWest.Lat));

            GeoResponse.CResult.CGeometry.CViewPort result = new GeoResponse.CResult.CGeometry.CViewPort();
            result.NorthEast.Long = mNorthEast.X;
            result.NorthEast.Lat  = mNorthEast.Y;
            result.SouthWest.Long = mSouthWest.X;
            result.SouthWest.Lat  = mSouthWest.Y;
            return(result);
        }
Exemplo n.º 2
0
        public FeatureDataRow AddFeatureDataRow(FeatureDataTable table)
        {
            GeoResponse.CResult.CGeometry.CViewPort vp = Location.ViewPort;
            FeatureDataRow r = table.NewRow();

            r["MapLocation"] = this;
            r["ViewPort"]    = new Envelope(vp.NorthEast.Long, vp.SouthWest.Long, vp.NorthEast.Lat, vp.SouthWest.Lat);
            r["Label"]       = Individual.Name + " at " + Location;
            r.Geometry       = Geometry;
            table.AddRow(r);
            return(r);
        }
Exemplo n.º 3
0
        private FeatureDataRow AddFeatureDataRow(DisplayFact dispfact, MapLocation loc, string colour)
        {
            GeoResponse.CResult.CGeometry.CViewPort vp = loc.Location.ViewPort;
            FeatureDataRow r = TearDropLocations.NewRow();

            r["DisplayFact"] = dispfact;
            r["MapLocation"] = loc;
            r["ViewPort"]    = new Envelope(vp.NorthEast.Long, vp.SouthWest.Long, vp.NorthEast.Lat, vp.SouthWest.Lat);
            r["Colour"]      = colour;
            r.Geometry       = loc.Geometry;
            TearDropLocations.AddRow(r);
            return(r);
        }
Exemplo n.º 4
0
        public MapLifeLine(Individual ind)
        {
            this.ind = ind;
            int index = 1;
            List <Coordinate> points = new List <Coordinate>();

            this.viewport = new Envelope();
            Coordinate previousPoint = null;

            foreach (IDisplayFact f in ind.AllGeocodedFacts)
            {
                Coordinate point = new Coordinate(f.Location.LongitudeM, f.Location.LatitudeM);
                if (index == 1)
                {
                    StartPoint = new NetTopologySuite.Geometries.Point(point);
                }
                if (index == ind.AllGeocodedFacts.Count)
                {
                    EndPoint = new NetTopologySuite.Geometries.Point(point);
                }
                index++;
                if (points.Count == 0 || (points.Count > 0 && !point.Equals2D(previousPoint)))
                {
                    points.Add(point); // don't add point if same as last one
                    previousPoint = point;
                }
                GeoResponse.CResult.CGeometry.CViewPort vp = f.Location.ViewPort;
                Envelope env = new Envelope(vp.NorthEast.Long, vp.SouthWest.Long, vp.NorthEast.Lat, vp.SouthWest.Lat);
                if (!viewport.Contains(env))
                {
                    viewport.ExpandToInclude(env);
                }
            }
            if (points.Count > 1)
            {
                this.Geometry = new NetTopologySuite.Geometries.LineString(points.ToArray());
            }
            else
            {
                this.Geometry = StartPoint;
            }
            Count = points.Count;
        }