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.ResponsecreateEmptyLayer(javax.servlet.ServletContext ctx, String workspace, String layerTitle, String geometryType, String columnHeaders, String columnTypes)static StringcreateLayer(javax.servlet.ServletContext ctx, String workspace, int srid, 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 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
public static String createLayer(javax.servlet.ServletContext ctx, String workspace, int srid, String delimiter, String fileName, String readableLayerName, String fileType, String optColumnHeaders, String optColumnTypes) throws Exception
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. 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
-
createEmptyLayer
@POST @Path("") @Consumes("application/x-www-form-urlencoded") public static javax.ws.rs.core.Response createEmptyLayer(@Context javax.servlet.ServletContext ctx, @PathParam("workspace") String workspace, @FormParam("layertitle") String layerTitle, @FormParam("geometrytype") String geometryType, @FormParam("columnheaders") String columnHeaders, @FormParam("columntypes") String columnTypes) throws Exception- 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("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)
-
-