コード例 #1
0
ファイル: LayersRequest.cs プロジェクト: nef001/ags-client
        public async Task <LayersResource> ExecuteAsync(AgsClient client, MapServiceResource parent)
        {
            string resourcePath = $"{parent.resourcePath}/{resource}";
            var    request      = createRequest(resourcePath);

            return(await client.ExecuteAsync <LayersResource>(request, Method.POST));
        }
コード例 #2
0
        public async Task <ServerInfoResource> ExecuteAsync(AgsClient client)
        {
            string      resourcePath = "rest/info";
            RestRequest request      = createRequest(resourcePath);

            return(await client.ExecuteAsync <ServerInfoResource>(request, Method.GET));
        }
コード例 #3
0
ファイル: UnionRequest.cs プロジェクト: nef001/ags-client
        public async Task <UnionResource <TG> > ExecuteAsync(AgsClient client, GeometryServiceResource parent)
        {
            string resourcePath = $"{parent.resourcePath}/{resource}";
            var    request      = createRequest(resourcePath);

            return(await client.ExecuteAsync <UnionResource <TG> >(request, Method.POST));
        }
コード例 #4
0
        public async Task <GenerateTokenResource> ExecuteAsync(AgsClient client)
        {
            string      resourcePath = "tokens/generateToken";
            RestRequest request      = createRequest(resourcePath);

            return(await client.ExecuteAsync <GenerateTokenResource>(request, Method.POST));
        }
コード例 #5
0
        public void LayerQueryTest()
        {
            string host           = "sampleserver1.arcgisonline.com";
            string instance       = "arcgis";
            string folder         = "Louisville";
            string mapServiceName = "LOJIC_LandRecords_Louisville";
            string layerName      = "LandUse";
            string whereClause    = "LANDUSE_CODE = 5";

            try
            {
                AgsClient agsClient     = new AgsClient(host, instance, null, false, null, null);
                var       folderCatalog = new CatalogRequest(folder).Execute(agsClient);
                Assert.IsNull(folderCatalog.error);
                var mapService = new MapServiceRequest(mapServiceName).Execute(agsClient, folderCatalog);
                Assert.IsNull(mapService.error);
                int layerId = mapService.LayerIdByName(layerName);
                var layer   = new LayerOrTableRequest(layerId).Execute(agsClient, mapService);
                Assert.IsNull(layer.error);
                var queryResult = new LayerQueryRequest <LandUse, Polygon, LandUseA>()
                {
                    outFields = "*",
                    where     = whereClause
                }.Execute(agsClient, layer);
                Assert.IsNull(queryResult.error);
            }
            catch (Exception ex)
            {
                Assert.Fail(ex.Message);
            }
        }
コード例 #6
0
        public async Task <LayerQueryResource <TF, TG, TA> > ExecuteAsync(AgsClient client, FeatureServiceLayerResource <TA> parent)
        {
            string resourcePath = $"{parent.resourcePath}/{resource}";
            var    request      = createRequest(resourcePath);

            return(await client.ExecuteAsync <LayerQueryResource <TF, TG, TA> >(request, Method.POST));
        }
コード例 #7
0
        public async Task <FeatureResource <TF, TG, TA> > ExecuteAsync(AgsClient client, LayerOrTableResource parent)
        {
            string resourcePath = $"{parent.resourcePath}/{_objectId}";
            var    request      = createRequest(resourcePath);

            return(await client.ExecuteAsync <FeatureResource <TF, TG, TA> >(request, Method.POST));
        }
コード例 #8
0
        public async Task <FeatureServiceResource> ExecuteAsync(AgsClient client, CatalogResource parent)
        {
            string resourcePath = $"{parent.resourcePath}/{_serviceName}/{resource}";
            var    request      = createRequest(resourcePath);

            return(await client.ExecuteAsync <FeatureServiceResource>(request, Method.POST));
        }
コード例 #9
0
ファイル: CatalogRequest.cs プロジェクト: nef001/ags-client
        public CatalogResource Execute(AgsClient client)
        {
            string resourcePath = "rest/services";

            if (!String.IsNullOrWhiteSpace(_folder))
            {
                resourcePath = $"{resourcePath}/{_folder}";
            }
            return((CatalogResource)Execute(client, resourcePath));
        }
コード例 #10
0
ファイル: CatalogRequest.cs プロジェクト: nef001/ags-client
        public async Task <CatalogResource> ExecuteAsync(AgsClient client)
        {
            string resourcePath = "rest/services";

            if (!String.IsNullOrWhiteSpace(_folder))
            {
                resourcePath = $"{resourcePath}/{_folder}";
            }
            RestRequest request = createRequest(resourcePath);

            return(await client.ExecuteAsync <CatalogResource>(request, Method.GET));
        }
コード例 #11
0
        public void SampleServerCatalogTest()
        {
            string host     = "sampleserver1.arcgisonline.com";
            string instance = "arcgis";

            try
            {
                AgsClient agsClient = new AgsClient(host, instance, null, false, null, null);
                var       resp      = new CatalogRequest(null).Execute(agsClient);
                Assert.IsNull(resp.error);
            }
            catch (Exception ex)
            {
                Assert.Fail(ex.Message);
            }
        }
コード例 #12
0
        public void GeocodeServiceRequestTest()
        {
            // http://sampleserver6.arcgisonline.com/arcgis/rest/services/Locators/SanDiego/GeocodeServer

            string host               = "sampleserver6.arcgisonline.com";
            string instance           = "arcgis";
            string folder             = "Locators";
            string geocodeServiceName = "SanDiego";


            try
            {
                AgsClient agsClient     = new AgsClient(host, instance, null, false, null, null);
                var       folderCatalog = new CatalogRequest(folder).Execute(agsClient);
                Assert.IsNull(folderCatalog.error);
                var geocodeService = new GeocodeServiceRequest(geocodeServiceName).Execute(agsClient, folderCatalog);
                Assert.IsNull(geocodeService.error);
            }
            catch (Exception ex)
            {
                Assert.Fail(ex.Message);
            }
        }
コード例 #13
0
        //this overload takes the absolute path - e.g rest/services/Locators/MyLocator/GeocodeServer
        public override BaseResponse Execute(AgsClient client, string resourcePath)
        {
            var request = createRequest(resourcePath);

            return(client.Execute <GeocodeServiceResource>(request, Method.GET));
        }
コード例 #14
0
ファイル: UnionRequest.cs プロジェクト: nef001/ags-client
        public UnionResource <TG> Execute(AgsClient client, GeometryServiceResource parent)
        {
            string resourcePath = $"{parent.resourcePath}/{resource}";

            return((UnionResource <TG>)Execute(client, resourcePath));
        }
コード例 #15
0
        public BufferResource <Polygon> Execute(AgsClient client, GeometryServiceResource parent)
        {
            string resourcePath = $"{parent.resourcePath}/{resource}";

            return((BufferResource <Polygon>)Execute(client, resourcePath));
        }
コード例 #16
0
        public override BaseResponse Execute(AgsClient client, string resourcePath)
        {
            var request = createRequest(resourcePath);

            return(client.Execute <FeatureResource <TF, TG, TA> >(request, Method.GET));
        }
コード例 #17
0
        public FeatureResource <TF, TG, TA> Execute(AgsClient client, FeatureServiceLayerResource <TA> parent)
        {
            string resourcePath = $"{parent.resourcePath}/{_objectId}";

            return((FeatureResource <TF, TG, TA>)Execute(client, resourcePath));
        }
コード例 #18
0
        public DifferenceResource <TG1> Execute(AgsClient client, GeometryServiceResource parent)
        {
            string resourcePath = $"{parent.resourcePath}/{resource}";

            return((DifferenceResource <TG1>)Execute(client, resourcePath));
        }
コード例 #19
0
        public LayerQueryResource <TF, TG, TA> Execute(AgsClient client, FeatureServiceLayerResource <TA> parent)
        {
            string resourcePath = $"{parent.resourcePath}/{resource}";

            return((LayerQueryResource <TF, TG, TA>)Execute(client, resourcePath));
        }
コード例 #20
0
        public EditFeaturesResource Execute(AgsClient client, FeatureServiceLayerResource <TA> parent)
        {
            string resourcePath = $"{parent.resourcePath}/{resource}";

            return((EditFeaturesResource)Execute(client, resourcePath));
        }
コード例 #21
0
        public GeometryServiceResource Execute(AgsClient client, CatalogResource parent) //parent is typically the Utilities folder
        {
            string resourcePath = $"{parent.resourcePath}/{_serviceName}/{resource}";

            return((GeometryServiceResource)Execute(client, resourcePath));
        }
コード例 #22
0
        public FeatureServiceResource Execute(AgsClient client, CatalogResource parent) //parent may be the root catalog or a folder catalog
        {
            string resourcePath = $"{parent.resourcePath}/{_serviceName}/{resource}";

            return((FeatureServiceResource)Execute(client, resourcePath));
        }
コード例 #23
0
ファイル: BaseRequest.cs プロジェクト: nef001/ags-client
 public abstract BaseResponse Execute(AgsClient client, string resourcePath);
コード例 #24
0
        public LayerQueryResource <TF, TG, TA> Execute(AgsClient client, LayerOrTableResource parent)
        {
            string resourcePath = $"{parent.resourcePath}/{resource}";

            return((LayerQueryResource <TF, TG, TA>)Execute(client, resourcePath));
        }
コード例 #25
0
        public override BaseResponse Execute(AgsClient client, string resourcePath)
        {
            var request = createRequest(resourcePath);

            return(client.Execute <LayerQueryResource <TF, TG, TA> >(request, Method.GET));//post not work. why?
        }
コード例 #26
0
        public RelationResource Execute(AgsClient client, GeometryServiceResource parent)
        {
            string resourcePath = $"{parent.resourcePath}/{resource}";

            return((RelationResource)Execute(client, resourcePath));
        }
コード例 #27
0
ファイル: LayersRequest.cs プロジェクト: nef001/ags-client
        public LayersResource Execute(AgsClient client, MapServiceResource parent) //parent may be the root catalog or a folder catalog
        {
            string resourcePath = $"{parent.resourcePath}/{resource}";

            return((LayersResource)Execute(client, resourcePath));
        }
コード例 #28
0
        public override BaseResponse Execute(AgsClient client, string resourcePath) //this overload takes the absolute path - typically rest/services/Utilities/Geometry/GeometryServer
        {
            var request = createRequest(resourcePath);

            return(client.Execute <GeometryServiceResource>(request, Method.GET));
        }
コード例 #29
0
ファイル: LayersRequest.cs プロジェクト: nef001/ags-client
        public override BaseResponse Execute(AgsClient client, string resourcePath)
        {
            var request = createRequest(resourcePath);

            return(client.Execute <LayersResource>(request, Method.POST));
        }
コード例 #30
0
        public override BaseResponse Execute(AgsClient client, string resourcePath) //this overload takes the absolute path - i.e. rest/services/<Folder>/<service>/MapServer
        {
            var request = createRequest(resourcePath);

            return(client.Execute <FeatureServiceResource>(request, Method.GET));
        }