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); }
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; }
public static IRequestLayerRoot TranslateToRequestLayerRoot(IFeatureTypeInfo layerInfo) { return(new RequestLayerRoot() { Layer = new RequestLayer() { DefaultStyle = new RequestDefaultStyle() { Name = layerInfo.Geometry } } }); }
public static IRequestLayerRoot TranslateToRequestLayerRoot(IFeatureTypeInfo layerInfo) { return new RequestLayerRoot() { Layer = new RequestLayer() { DefaultStyle = new RequestDefaultStyle() { Name =layerInfo.Geometry } } }; }
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); }
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); }
public UploadFeatureTypeInfoToGeoserverRequest(IFeatureTypeInfo layerInfo) { this.Layer = layerInfo; }
private static bool IsNull(IFeatureTypeInfo neighbourCellsRelation) { return(neighbourCellsRelation == NULL); }
private static bool IsNull(IFeatureTypeInfo neighbourCellsRelation) { return neighbourCellsRelation == NULL; }
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; }
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; }