コード例 #1
0
        public static IRequestFeatureTypeRoot TranslateToRequestFeatureTypeRoot(IFeatureTypeInfo layerInfo)
        {
            var layerRoot = new RequestFeatureTypeRoot
            {
                FeatureType = new RequestFeatureType
                {
                    Name             = layerInfo.Name,
                    Srs              = layerInfo.Srs,
                    ProjectionPolicy = "FORCE_DECLARED",
                    Enabled          = "true",
                    Title            = layerInfo.Name,
                    Metadata         = new RequestMetadata()
                    {
                        Entry = new RequestEntry()
                        {
                            Key          = "JDBC_VIRTUAL_TABLE",
                            VirtualTable = new RequestVirtualTable()
                            {
                                Name      = layerInfo.Name,
                                Sql       = layerInfo.Sql,
                                EscapeSql = "true"
                            }
                        }
                    }
                }
            };



            return(layerRoot);
        }
コード例 #2
0
        public static IRequestFeatureTypeRoot TranslateToRequestFeatureTypeRoot(IFeatureTypeInfo layerInfo)
        {
            var layerRoot = new RequestFeatureTypeRoot
            {
                FeatureType = new RequestFeatureType
                {
                    Name = layerInfo.Name,
                    Srs = layerInfo.Srs,
                    ProjectionPolicy = "FORCE_DECLARED",
                    Enabled = "true",
                    Title = layerInfo.Name,
                    Metadata = new RequestMetadata()
                    {
                        Entry = new RequestEntry()
                        {
                            Key = "JDBC_VIRTUAL_TABLE",
                            VirtualTable = new RequestVirtualTable()
                            {
                                Name = layerInfo.Name,
                                Sql = layerInfo.Sql,
                                EscapeSql = "true"
                            }
                        }
                    }
                }
            };

            return layerRoot;
        }
コード例 #3
0
 public static IRequestLayerRoot TranslateToRequestLayerRoot(IFeatureTypeInfo layerInfo)
 {
     return(new RequestLayerRoot()
     {
         Layer = new RequestLayer()
         {
             DefaultStyle = new RequestDefaultStyle()
             {
                 Name = layerInfo.Geometry
             }
         }
     });
 }
コード例 #4
0
 public static IRequestLayerRoot TranslateToRequestLayerRoot(IFeatureTypeInfo layerInfo)
 {
     return  new RequestLayerRoot()
     {
         Layer = new RequestLayer()
         {
             DefaultStyle = new RequestDefaultStyle()
             {
                 Name =layerInfo.Geometry
             }
         }
     };
 }
コード例 #5
0
        public IGeoserverRestResponse PostLayer(IFeatureTypeInfo layer)
        {
            var uri     = $@"workspaces/{layer.Workspace}/datastores/{layer.Datastore}/featuretypes";
            var request = new ServiceRequest(uri);

            var featureTypeRoot = LayerInfoTranslator.TranslateToRequestFeatureTypeRoot(layer);

            request.Body = JsonConvert.SerializeObject(featureTypeRoot);

            var response = restService.Post(request);


            var output = new GeoserverRestResponse
            {
                Data = response.Data,
                Code = response.StatusCode
            };

            return(output);
        }
コード例 #6
0
        public IGeoserverRestResponse PutLayer(IFeatureTypeInfo layer)
        {
            var uri     = $@"layers/{layer.Name}";
            var request = new ServiceRequest(uri);

            var layerRoot = LayerInfoTranslator.TranslateToRequestLayerRoot(layer);

            request.Body = JsonConvert.SerializeObject(layerRoot);

            var response = restService.Put(request);


            var output = new GeoserverRestResponse
            {
                Data = response.Data,
                Code = response.StatusCode
            };

            return(output);
        }
コード例 #7
0
 public UploadFeatureTypeInfoToGeoserverRequest(IFeatureTypeInfo layerInfo)
 {
     this.Layer = layerInfo;
 }
コード例 #8
0
 private static bool IsNull(IFeatureTypeInfo neighbourCellsRelation)
 {
     return(neighbourCellsRelation == NULL);
 }
コード例 #9
0
 private static bool IsNull(IFeatureTypeInfo neighbourCellsRelation)
 {
     return neighbourCellsRelation == NULL;
 }
 public UploadFeatureTypeInfoToGeoserverRequest(IFeatureTypeInfo layerInfo)
 {
     this.Layer = layerInfo;
 }
コード例 #11
0
        public IGeoserverRestResponse PutLayer(IFeatureTypeInfo layer)
        {
            var uri = $@"layers/{layer.Name}";
            var request = new ServiceRequest(uri);

            var layerRoot = LayerInfoTranslator.TranslateToRequestLayerRoot(layer);

            request.Body = JsonConvert.SerializeObject(layerRoot);

            var response = restService.Put(request);

            var output = new GeoserverRestResponse
            {
                Data = response.Data,
                Code = response.StatusCode
            };

            return output;
        }
コード例 #12
0
        public IGeoserverRestResponse PostLayer(IFeatureTypeInfo layer)
        {
            var uri = $@"workspaces/{layer.Workspace}/datastores/{layer.Datastore}/featuretypes";
            var request = new ServiceRequest(uri);

            var featureTypeRoot = LayerInfoTranslator.TranslateToRequestFeatureTypeRoot(layer);

            request.Body = JsonConvert.SerializeObject(featureTypeRoot);

            var response = restService.Post(request);

            var output = new GeoserverRestResponse
            {
                Data = response.Data,
                Code = response.StatusCode
            };

            return output;
        }