Package de.narimo.georepo.server.api
Class LayerController
- java.lang.Object
-
- de.narimo.georepo.server.api.LayerController
-
@Provider @Path("/workspaces/{workspace}/layers") public class LayerController extends Objectgeorepo.com layer API- Author:
- Ulrich Mann
-
-
Constructor Summary
Constructors Constructor Description LayerController()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static javax.ws.rs.core.ResponsecreateLayer(javax.servlet.ServletContext ctx, String workspace, String sridAsString, String delimiter, String fileName, String readableLayerName, String fileType, String optColumnHeaders, String optColumnTypes)Prerequisites for csv import: - only point data supported yet - column lon for longitude coordinates - column lat for latitude coordinates - filename must only contain alphanumerics, dashes and underscores - filename must end .csv (postgres insert function restriction) - only allowed csvdelimiter is semicolon (;) - currently only utf8 charset allowed, i.e., no umlauts, ß, etc.static javax.ws.rs.core.ResponsegetWorkspaceLayers(javax.ws.rs.core.SecurityContext sec, javax.servlet.ServletContext ctx, String workspace)static voidimportFile0(javax.servlet.ServletContext ctx, String workspace, String fileName, String layerName, String optColumnTypes)static javax.ws.rs.core.ResponseremoveLayer(String workspace, String layername)static javax.ws.rs.core.ResponseupdateLayerContent(javax.servlet.ServletContext ctx, String workspace, String layerName, String sridAsString, String delimiter, String fileName, String fileType, String optColumnTypes)
-
-
-
Method Detail
-
getWorkspaceLayers
@GET @Path("/") @Produces("application/json") public static javax.ws.rs.core.Response getWorkspaceLayers(@Context javax.ws.rs.core.SecurityContext sec, @Context javax.servlet.ServletContext ctx, @PathParam("workspace") String workspace)
-
createLayer
@POST @Path("") public static javax.ws.rs.core.Response createLayer(@Context javax.servlet.ServletContext ctx, @PathParam("workspace") String workspace, @QueryParam("srid") String sridAsString, @QueryParam("delimiter") String delimiter, @QueryParam("filename") String fileName, @QueryParam("layername") String readableLayerName, @QueryParam("filetype") String fileType, @QueryParam("columntypes") String optColumnHeaders, @QueryParam("columntypes") String optColumnTypes) throws ExceptionPrerequisites for csv import: - only point data supported yet - column lon for longitude coordinates - column lat for latitude coordinates - filename must only contain alphanumerics, dashes and underscores - filename must end .csv (postgres insert function restriction) - only allowed csvdelimiter is semicolon (;) - currently only utf8 charset allowed, i.e., no umlauts, ß, etc. in csv content - numeric values in csv are inserted as text to database TODO: check: do NOT allow feature type names containing whitespaces! This will mess up queries that are not correctly url encoded or even then. NB: Conventions for new layers, datasources and workspaces: - datasource starts with prefix gd_ and concatenates workspace name - layer name (not layer title!) must not contain whitespaces and end with _gd_ plus the newly created layerId- Parameters:
sec-ctxt-workspace-sridAsString-delimiter-fileName-readableLayerName-fileType-optColumnTypes-- Returns:
- Throws:
Exception
-
updateLayerContent
@PUT @Path("/{layername}") public static javax.ws.rs.core.Response updateLayerContent(@Context javax.servlet.ServletContext ctx, @PathParam("workspace") String workspace, @PathParam("layername") String layerName, @QueryParam("srid") String sridAsString, @QueryParam("delimiter") String delimiter, @QueryParam("filename") String fileName, @QueryParam("filetype") String fileType, @QueryParam("columntypes") String optColumnTypes) throws Exception- Throws:
Exception
-
removeLayer
@DELETE @Path("/{layername}") public static javax.ws.rs.core.Response removeLayer(@PathParam("workspace") String workspace, @PathParam("layername") String layername)
-
-