コード例 #1
0
        public void IsoLine_Points_ExtractParamIsNull()
        {
            #region points,zValues定义
            Point2D[] points = new Point2D[37];
            double[] zValues = new double[37];
            points[0] = new Point2D() { X = 603598.5523083061, Y = 4479242.9705482665 };
            points[1] = new Point2D() { X = 604604.99079498206, Y = 4475916.8166897586 };
            points[2] = new Point2D() { X = 605069.2609360615, Y = 4473869.0317084016 };
            points[3] = new Point2D() { X = 597849.28197854816, Y = 4473651.4819765529 };
            points[4] = new Point2D() { X = 603468.453516089, Y = 4470350.5931883259 };
            points[5] = new Point2D() { X = 602541.93949575315, Y = 4469362.1116667259 };
            points[6] = new Point2D() { X = 596899.866483911, Y = 4468956.9705482665 };
            points[7] = new Point2D() { X = 611758.72419415938, Y = 4476101.0380845685 };
            points[8] = new Point2D() { X = 617993.01585132082, Y = 4476567.4355759053 };
            points[9] = new Point2D() { X = 613072.97264934448, Y = 4472425.6988057708 };
            points[10] = new Point2D() { X = 627141.18584939465, Y = 4457193.8117718957 };
            points[11] = new Point2D() { X = 625007.69450436556, Y = 4475141.6919775512 };
            points[12] = new Point2D() { X = 614985.55448035314, Y = 4470280.1570427939 };
            points[13] = new Point2D() { X = 623901.71600422217, Y = 4466666.2160042226 };
            points[14] = new Point2D() { X = 629656.95681366918, Y = 4463716.8953833878 };
            points[15] = new Point2D() { X = 630173.95911998034, Y = 4457012.0457131462 };
            points[16] = new Point2D() { X = 633914.753754354, Y = 4455004.6871154737 };
            points[17] = new Point2D() { X = 621395.54110947042, Y = 4453979.7040218329 };
            points[18] = new Point2D() { X = 611692.43432728737, Y = 4436168.7267506663 };
            points[19] = new Point2D() { X = 616883.140989274, Y = 4429417.4819765529 };
            points[20] = new Point2D() { X = 622919.669528409, Y = 4462913.665593328 };
            points[21] = new Point2D() { X = 601313.33628629846, Y = 4455293.7974051712 };
            points[22] = new Point2D() { X = 612859.7380792771, Y = 4469688.8599254563 };
            points[23] = new Point2D() { X = 619859.663734605, Y = 4437419.6528260121 };
            points[24] = new Point2D() { X = 619986.40953671513, Y = 4446273.7524305694 };
            points[25] = new Point2D() { X = 602602.790723978, Y = 4467207.2437627846 };
            points[26] = new Point2D() { X = 601017.54226018267, Y = 4466159.2634545071 };
            points[27] = new Point2D() { X = 624837.92738216463, Y = 4470922.0728896968 };
            points[28] = new Point2D() { X = 627808.4361812321, Y = 4462623.96090279 };
            points[29] = new Point2D() { X = 601553.40045858407, Y = 4460450.558360938 };
            points[30] = new Point2D() { X = 604564.45904654567, Y = 4462898.198077416 };
            points[31] = new Point2D() { X = 617863.82231001207, Y = 4457545.3749187626 };
            points[32] = new Point2D() { X = 614289.80053016217, Y = 4449796.8294377672 };
            points[33] = new Point2D() { X = 604825.97279867844, Y = 4462217.1334855324 };
            points[34] = new Point2D() { X = 629571.82174916321, Y = 4472069.90070569 };
            points[35] = new Point2D() { X = 612746.39144627, Y = 4443343.5426283237 };
            points[36] = new Point2D() { X = 626928.06164879026, Y = 4469283.120878025 };

            zValues[0] = 52.98;
            zValues[1] = 25.74;
            zValues[2] = 62.94;
            zValues[3] = 50.82;
            zValues[4] = 41.36;
            zValues[5] = 41.66;
            zValues[6] = 64.66;
            zValues[7] = 23.7;
            zValues[8] = 40.74;
            zValues[9] = 3.12;
            zValues[10] = 139.32;
            zValues[11] = 41.48;
            zValues[12] = 28.48;
            zValues[13] = 61.92;
            zValues[14] = 52.22;
            zValues[15] = 44.54;
            zValues[16] = 56.54;
            zValues[17] = 85.22;
            zValues[18] = 48.94;
            zValues[19] = 55.2;
            zValues[20] = 52.8;
            zValues[21] = 27.5;
            zValues[22] = 39.34;
            zValues[23] = 56.22;
            zValues[24] = 39.12;
            zValues[25] = 27.72;
            zValues[26] = 34.84;
            zValues[27] = 49.26;
            zValues[28] = 55.14;
            zValues[29] = 333.26;
            zValues[30] = 42.76;
            zValues[31] = 26.42;
            zValues[32] = 54.32;
            zValues[33] = 50.88;
            zValues[34] = 56.96;
            zValues[35] = 35.2;
            zValues[36] = 49.14;
            #endregion

            try
            {
                double resolution = 3000;
                //ExtractParameter parameter = new ExtractParameter() { DatumValue = 0, Interval = 5, Smoothness = 3 };
                DataReturnOption resultSetting = new DataReturnOption();
                resultSetting.DataReturnMode = DataReturnMode.DATASET_AND_RECORDSET;
                resultSetting.DeleteExistResultDataset = true;
                resultSetting.Dataset = "isoLine@Interpolation";
                resultSetting.ExpectCount = 0;
                string serviceUrl = string.Format("http://{0}:8090/iserver/services/spatialanalyst-sample/restjsr", ip);
                SpatialAnalyst spatialAnalyst = new SpatialAnalyst(serviceUrl);
                DatasetSpatialAnalystResult actualResult = spatialAnalyst.IsoLine(points, zValues, resolution, null, resultSetting);
                Assert.IsTrue(actualResult.Succeed);
            }
            catch (Exception e)
            {
                Assert.AreEqual("参数不能为空。\r\n参数名: parameter", e.Message);
            }
        }
コード例 #2
0
        public void IsoLine_PointsIsNull()
        {
            #region zValues定义
            double[] zValues = new double[37];
            zValues[0] = 52.98;
            zValues[1] = 25.74;
            zValues[2] = 62.94;
            zValues[3] = 50.82;
            zValues[4] = 41.36;
            zValues[5] = 41.66;
            zValues[6] = 64.66;
            zValues[7] = 23.7;
            zValues[8] = 40.74;
            zValues[9] = 3.12;
            zValues[10] = 139.32;
            zValues[11] = 41.48;
            zValues[12] = 28.48;
            zValues[13] = 61.92;
            zValues[14] = 52.22;
            zValues[15] = 44.54;
            zValues[16] = 56.54;
            zValues[17] = 85.22;
            zValues[18] = 48.94;
            zValues[19] = 55.2;
            zValues[20] = 52.8;
            zValues[21] = 27.5;
            zValues[22] = 39.34;
            zValues[23] = 56.22;
            zValues[24] = 39.12;
            zValues[25] = 27.72;
            zValues[26] = 34.84;
            zValues[27] = 49.26;
            zValues[28] = 55.14;
            zValues[29] = 333.26;
            zValues[30] = 42.76;
            zValues[31] = 26.42;
            zValues[32] = 54.32;
            zValues[33] = 50.88;
            zValues[34] = 56.96;
            zValues[35] = 35.2;
            zValues[36] = 49.14;
            #endregion

            try
            {
                double resolution = 3000;
                ExtractParameter parameter = new ExtractParameter() { DatumValue = 0, Interval = 5, Smoothness = 3 };
                DataReturnOption resultSetting = new DataReturnOption();
                resultSetting.DataReturnMode = DataReturnMode.DATASET_AND_RECORDSET;
                resultSetting.DeleteExistResultDataset = true;
                resultSetting.Dataset = "isoLine@Interpolation";
                resultSetting.ExpectCount = 0;
                string serviceUrl = string.Format("http://{0}:8090/iserver/services/spatialanalyst-sample/restjsr", ip);
                SpatialAnalyst spatialAnalyst = new SpatialAnalyst(serviceUrl);
                DatasetSpatialAnalystResult actualResult = spatialAnalyst.IsoLine(null, zValues, resolution, parameter, resultSetting);
                Assert.IsTrue(actualResult.Succeed);
            }
            catch (Exception e)
            {
                Assert.AreEqual("点数组为null。", e.Message);
            }
        }
コード例 #3
0
        public void IsoLine_GridDataset_ExtractParamIsNull()
        {
            try
            {
                string gridDataset = "JingjinTerrain@Jingjin";
                //ExtractParameter parameter = new ExtractParameter() { DatumValue = 0, Interval = 1000, Smoothness = 3 };
                DataReturnOption resultSetting = new DataReturnOption();
                resultSetting.DataReturnMode = DataReturnMode.DATASET_AND_RECORDSET;
                resultSetting.DeleteExistResultDataset = true;
                resultSetting.Dataset = "isoLine@Jingjin";
                resultSetting.ExpectCount = 0;

                string serviceUrl = string.Format("http://{0}:8090/iserver/services/spatialanalyst-sample/restjsr", ip);
                SpatialAnalyst spatialAnalyst = new SpatialAnalyst(serviceUrl);
                DatasetSpatialAnalystResult actualResult = spatialAnalyst.IsoLine(gridDataset, null, resultSetting);
                Assert.IsNull(actualResult);
            }
            catch (Exception e)
            {
                Assert.AreEqual("参数不能为空。\r\n参数名: parameter", e.Message);
            }
        }
コード例 #4
0
        public void IsoLine_gridDataset()
        {
            string gridDataset = "JingjinTerrain@Jingjin";
            ExtractParameter parameter = new ExtractParameter() { DatumValue = 0, Interval = 1000, Smoothness = 3 };
            DataReturnOption resultSetting = new DataReturnOption();
            resultSetting.DataReturnMode = DataReturnMode.DATASET_AND_RECORDSET;
            resultSetting.DeleteExistResultDataset = true;
            resultSetting.Dataset = "isoLine@Jingjin";
            resultSetting.ExpectCount = 0;

            string serviceUrl = string.Format("http://{0}:8090/iserver/services/spatialanalyst-sample/restjsr", ip);
            SpatialAnalyst spatialAnalyst = new SpatialAnalyst(serviceUrl);
            DatasetSpatialAnalystResult actualResult = spatialAnalyst.IsoLine(gridDataset, parameter, resultSetting);
            Assert.IsTrue(actualResult.Succeed);
            Assert.AreEqual(229, actualResult.Recordset.Features.Length);
            Assert.AreEqual(10, actualResult.Recordset.Fields.Length);
            Assert.AreEqual(resultSetting.Dataset, actualResult.Dataset);
        }
コード例 #5
0
        public void IsoLine_PointDataset_ExtractParamtIsNull()
        {
            try
            {
                string pointDataset = "SamplesP@Interpolation";
                QueryParameter filterQueryParameter = new QueryParameter() { AttributeFilter = "SmID>0" };
                string zValueField = "AVG_WTR";
                double resolution = 3000;
                //ExtractParameter parameter = new ExtractParameter() { DatumValue = 0, Interval = 500, Smoothness = 3 };
                DataReturnOption resultSetting = new DataReturnOption();
                resultSetting.DataReturnMode = DataReturnMode.DATASET_AND_RECORDSET;
                resultSetting.DeleteExistResultDataset = true;
                resultSetting.Dataset = "isoLine@Interpolation";
                resultSetting.ExpectCount = 0;

                string serviceUrl = string.Format("http://{0}:8090/iserver/services/spatialanalyst-sample/restjsr", ip);
                SpatialAnalyst spatialAnalyst = new SpatialAnalyst(serviceUrl);
                DatasetSpatialAnalystResult actualResult = spatialAnalyst.IsoLine(pointDataset, filterQueryParameter, zValueField, resolution, null, resultSetting);
                Assert.IsNull(actualResult);
            }
            catch (Exception e)
            {
                Assert.AreEqual("参数不能为空。\r\n参数名: parameter", e.Message);
            }
        }
コード例 #6
0
        public void IsoLine_PointDataset()
        {
            string pointDataset = "SamplesP@Interpolation";
            QueryParameter filterQueryParameter = new QueryParameter() { AttributeFilter = "SmID>0" };
            string zValueField = "AVG_WTR";
            double resolution = 3000;
            ExtractParameter parameter = new ExtractParameter() { DatumValue = 0, Interval = 500, Smoothness = 3 };
            DataReturnOption resultSetting = new DataReturnOption();
            resultSetting.DataReturnMode = DataReturnMode.DATASET_AND_RECORDSET;
            resultSetting.DeleteExistResultDataset = true;
            resultSetting.Dataset = "isoLine@Interpolation";
            resultSetting.ExpectCount = 0;

            string serviceUrl = string.Format("http://{0}:8090/iserver/services/spatialanalyst-sample/restjsr", ip);
            SpatialAnalyst spatialAnalyst = new SpatialAnalyst(serviceUrl);
            DatasetSpatialAnalystResult actualResult = spatialAnalyst.IsoLine(pointDataset, filterQueryParameter, zValueField, resolution, parameter, resultSetting);
            Assert.IsTrue(actualResult.Succeed);
            Assert.AreEqual(45, actualResult.Recordset.Features.Length);
            Assert.AreEqual(10, actualResult.Recordset.Fields.Length);
            Assert.AreEqual("DZVALUE", actualResult.Recordset.Features[6].FieldNames[9]);
            Assert.AreEqual("1000.0", actualResult.Recordset.Features[6].FieldValues[9]);
            Assert.AreEqual(resultSetting.Dataset, actualResult.Dataset);
        }