public static void main(string[] args)
		{
			ExtendedCoordinateSequenceFactory seqFact = ExtendedCoordinateSequenceFactory.Instance();
			
			ExtendedCoordinate[] array1 = new ExtendedCoordinate[] { new ExtendedCoordinate(0, 0, 0, 91), 
                new ExtendedCoordinate(10, 0, 0, 92), new ExtendedCoordinate(10, 10, 0, 93), 
                new ExtendedCoordinate(0, 10, 0, 94), new ExtendedCoordinate(0, 0, 0, 91)};
			ICoordinateSequence seq1 = seqFact.Create(array1);
			
			ICoordinateSequence seq2 = seqFact.Create(new ExtendedCoordinate[] { new ExtendedCoordinate(5, 5, 0, 91), 
                new ExtendedCoordinate(15, 5, 0, 92), new ExtendedCoordinate(15, 15, 0, 93), 
                new ExtendedCoordinate(5, 15, 0, 94), new ExtendedCoordinate(5, 5, 0, 91)});
			
			GeometryFactory fact = new GeometryFactory(ExtendedCoordinateSequenceFactory.Instance());

            IGeometry g1 = fact.CreatePolygon(fact.CreateLinearRing(seq1), null);
            IGeometry g2 = fact.CreatePolygon(fact.CreateLinearRing(seq2), null);
			
			Console.WriteLine("WKT for g1: " + g1);
			Console.WriteLine("Internal rep for g1: " + ((IPolygon) g1).ExteriorRing.CoordinateSequence);
			
			Console.WriteLine("WKT for g2: " + g2);
            Console.WriteLine("Internal rep for g2: " + ((IPolygon)g2).ExteriorRing.CoordinateSequence);

            IGeometry gInt = g1.Intersection(g2);
			
			Console.WriteLine("WKT for gInt: " + gInt);
            Console.WriteLine("Internal rep for gInt: " + ((IPolygon)gInt).ExteriorRing.CoordinateSequence);
		}
		public static ExtendedCoordinate[] Copy(ICoordinate[] coordinates)
		{
			ExtendedCoordinate[] copy = new ExtendedCoordinate[coordinates.Length];
			for (int i = 0; i < coordinates.Length; i++)			
				copy[i] = new ExtendedCoordinate(coordinates[i]);			
			return copy;
		}
        public static void main(string[] args)
        {
            ExtendedCoordinateSequenceFactory seqFact = ExtendedCoordinateSequenceFactory.Instance();

            ExtendedCoordinate[] array1 = new ExtendedCoordinate[] { new ExtendedCoordinate(0, 0, 0, 91),
                                                                     new ExtendedCoordinate(10, 0, 0, 92), new ExtendedCoordinate(10, 10, 0, 93),
                                                                     new ExtendedCoordinate(0, 10, 0, 94), new ExtendedCoordinate(0, 0, 0, 91) };
            ICoordinateSequence seq1 = seqFact.Create(array1);

            ICoordinateSequence seq2 = seqFact.Create(new ExtendedCoordinate[] { new ExtendedCoordinate(5, 5, 0, 91),
                                                                                 new ExtendedCoordinate(15, 5, 0, 92), new ExtendedCoordinate(15, 15, 0, 93),
                                                                                 new ExtendedCoordinate(5, 15, 0, 94), new ExtendedCoordinate(5, 5, 0, 91) });

            GeometryFactory fact = new GeometryFactory(ExtendedCoordinateSequenceFactory.Instance());

            IGeometry g1 = fact.CreatePolygon(fact.CreateLinearRing(seq1), null);
            IGeometry g2 = fact.CreatePolygon(fact.CreateLinearRing(seq2), null);

            Console.WriteLine("WKT for g1: " + g1);
            Console.WriteLine("Internal rep for g1: " + ((IPolygon)g1).ExteriorRing.CoordinateSequence);

            Console.WriteLine("WKT for g2: " + g2);
            Console.WriteLine("Internal rep for g2: " + ((IPolygon)g2).ExteriorRing.CoordinateSequence);

            IGeometry gInt = g1.Intersection(g2);

            Console.WriteLine("WKT for gInt: " + gInt);
            Console.WriteLine("Internal rep for gInt: " + ((IPolygon)gInt).ExteriorRing.CoordinateSequence);
        }
Exemplo n.º 4
0
 public static ExtendedCoordinate[] Copy(ICoordinate[] coordinates)
 {
     ExtendedCoordinate[] copy = new ExtendedCoordinate[coordinates.Length];
     for (int i = 0; i < coordinates.Length; i++)
     {
         copy[i] = new ExtendedCoordinate(coordinates[i]);
     }
     return(copy);
 }
Exemplo n.º 5
0
        /// <summary>
        /// Creates a new object that is a copy of the current instance.
        /// </summary>
        /// <returns>
        /// A new object that is a copy of this instance.
        /// </returns>
        public object Clone()
        {
            ExtendedCoordinate[] cloneCoordinates = new ExtendedCoordinate[this.Count];
            for (int i = 0; i < coordinates.Length; i++)
            {
                cloneCoordinates[i] = (ExtendedCoordinate)coordinates[i].Clone();
            }

            return(new ExtendedCoordinateSequence(cloneCoordinates));
        }
        /// <summary>
        /// Creates a new object that is a copy of the current instance.
        /// </summary>
        /// <returns>
        /// A new object that is a copy of this instance.
        /// </returns>
		public object Clone()
		{
			ExtendedCoordinate[] cloneCoordinates = new ExtendedCoordinate[this.Count];
			for (int i = 0; i < coordinates.Length; i++)
			{
				cloneCoordinates[i] = (ExtendedCoordinate) coordinates[i].Clone();
			}
			
			return new ExtendedCoordinateSequence(cloneCoordinates);
		}
Exemplo n.º 7
0
 public ExtendedCoordinate(ExtendedCoordinate coord) : base(coord)
 {
     m = coord.m;
 }
Exemplo n.º 8
0
		public ExtendedCoordinate(ExtendedCoordinate coord) : base(coord)
		{
			m = coord.m;
		}
		/// <summary> Copy constructor -- simply aliases the input array, for better performance.
		/// </summary>
		public ExtendedCoordinateSequence(ExtendedCoordinate[] coordinates)
		{
			this.coordinates = coordinates;
		}