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

        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)