We have a similar need with shape files, the presence of a sidecar SLD file
is great way to pass styling around.

At a GeoTools level I would love a way to "discover" a built-in style for a
layer so we could make it available for either a) GeoServer Data Import
(sadly that would just be a one time solution), or see we could make a
placeholder in the LayerInfo (maybe with a special default style
placeholder.


GeoTools does have a per layer "info" data structure used to pass meta
information on to the application, we could see about making the style
available in this manner.

--
Jody Garnett

On 21 March 2018 at 15:31, Jorge Gustavo Rocha <j...@geomaster.pt> wrote:

> Hi devs,
>
> QGIS can save the style back to the provider (to Postgis and to
> GeoPackage). The style is stored on a table called layers_style. On
> Postgis, the table is stored in the public schema.
>
> The table has a column to store the native QGIS style format and another
> column to store the SLD style (stylesld).
>
> I would like to use the SLD style stored on layers_style table on
> Geoserver. It would improve the interoperability between QGIS and
> Geoserver.
>
> It can be done both for Postgis and for GeoPackage stores. For example,
> when publishing a GeoPackahe layer, it would be nice to use the SLD
> already stored in the GeoPackage. The same for Postgis.
>
> The layers_table [1] also has a useasdefault column. It would be super
> cool to immediately render the layer using that default style for the
> layer.
>
> I would appreciate your feedback regarding this use case.
>
> I've done a simple mockup [2] to improve the Publishing tab for the
> layer. It adds one more list of styles. The user can choose from the
> 'Available styles' list and also from the 'Available style in Postgis'
> (or 'Available style in GeoPackage') list.
>
> The store (when connecting to Postgis) is always related with a schema
> that might be not the public. To support this use case, we need to add
> an additional connection to the database to the public schema using the
> same credentials.
>
> Regards from Bonn Code Sprint,
>
> Jorge Gustavo
>
>
> [1] CREATE TABLE public.layer_styles (
>     id integer NOT NULL DEFAULT nextval('layer_styles_id_seq'::regclass),
>     f_table_catalog character varying COLLATE pg_catalog."default",
>     f_table_schema character varying COLLATE pg_catalog."default",
>     f_table_name character varying COLLATE pg_catalog."default",
>     f_geometry_column character varying COLLATE pg_catalog."default",
>     stylename text COLLATE pg_catalog."default",
>     styleqml xml,
>     stylesld xml,
>     useasdefault boolean,
>     description text COLLATE pg_catalog."default",
>     owner character varying(63) COLLATE pg_catalog."default",
>     ui xml,
>     update_time timestamp without time zone DEFAULT now(),
>     CONSTRAINT layer_styles_pkey PRIMARY KEY (id)
> );
>
> [2]
> https://www.dropbox.com/s/nh72i4tv21y1h0o/mockup%20with%
> 20styles%20from%20postgis.png?dl=0
>
> --
> Geomaster, Lda
> Avenida Barros e Soares, 423
> Nogueira
> 4715-214 Braga
> NIF 510906109
> Tm +351 910333888
> Email j...@geomaster.pt
> Site geomaster.pt
> GPS 41.53322,-8.41929
>
> ------------------------------------------------------------
> ------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> _______________________________________________
> Geoserver-devel mailing list
> Geoserver-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/geoserver-devel
>
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

Reply via email to