Exemplo n.º 1
0
		public Point(double x, double y, SpatialReference spatialReference)
			: base(x, y)
		{
			if (spatialReference == null) { throw new ArgumentNullException("spatialReference"); }
			if (spatialReference.WKID <= 0) { throw new ArgumentException(ErrorMessages.msgPoint_Error_SpatialReferenceWKIDCannotBeZeroOrNegative, "spatialReference"); }

			this.SpatialReference = spatialReference;
		}
Exemplo n.º 2
0
		public Envelope(double xMin, double yMin, double xMax, double yMax, SpatialReference spatialReference)
		{
			if (spatialReference == null) { throw new ArgumentNullException("spatialReference"); }
			if (spatialReference.WKID <= 0) { throw new ArgumentException(ErrorMessages.msgPoint_Error_SpatialReferenceWKIDCannotBeZeroOrNegative, "spatialReference"); }

			this.XMin = xMin;
			this.YMin = yMin;
			this.XMax = xMax;
			this.YMax = yMax;
			this.SpatialReference = spatialReference;
		}
		public void ShouldReprojectProperly()
		{
			var outputSpatialReference = new SpatialReference(WKID_WEBMERCATOR);
			var pointsToReproject = new List<Point>
			{
				new Point(-104.53, 34.74, WKID_WGS84),
				new Point(-63.53, 10.23, WKID_WGS84),
				new Point(-117, 34, WKID_WGS84)
			};

			var geometryServices = new RestAPIGeometryServices<Point>(GEOMETRY_SERVICE_URL);
			var result = geometryServices.Reproject(pointsToReproject, new SpatialReference(WKID_WGS84), outputSpatialReference);

			result.Should().Not.Be.Null().And.Not.Be.Empty();
			result.Count.Should().Be(3);
			result[0].SpatialReference.Should().Be(outputSpatialReference);
			result[1].SpatialReference.Should().Be(outputSpatialReference);
			result[2].SpatialReference.Should().Be(outputSpatialReference);
		}