Class LayerController


  • @Provider
    @Path("/workspaces/{workspace}/layers")
    public class LayerController
    extends Object
    georepo.com layer API
    Author:
    Ulrich Mann
    • Constructor Detail

      • LayerController

        public LayerController()
    • 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 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
      • 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)