Hi,

The GeoPackage standard lacks definitions about how to deliver styles with data 
but I know that it has been discussed in the OGC working group. It would be 
right time now to think about how it could be done well and make a suggestion. 
I believe that suggestions can leak to gpkg working group  even from 
geoserver-devel list, but perhaps a reasoned mail to contacts listed in 
http://www.opengeospatial.org/projects/groups/geopackageswg could be more 
effective. Perhaps saving SLD into some specific gpkg_style_table is not the 
best option for the future.

-Jukka Rahkonen-

Lähettäjä: Andrea Aime [mailto:andrea.a...@geo-solutions.it]
Lähetetty: 22. maaliskuuta 2018 10:59
Vastaanottaja: Jorge Gustavo Rocha <j...@geomaster.pt>
Kopio: Geoserver-devel <geoserver-devel@lists.sourceforge.net>
Aihe: Re: [Geoserver-devel] SLD from Postgis or from GeoPackage

Hi Jorge,
summarizing what others said and adding a few bits of my own. You'd need (top 
to bottom):

  *   A notion of "layer local style" in the configuration, right now styles 
are global and are just linked to the layer. Basically, what Nuno said. And add 
UI for it, what you said, but without "postgis" in the title, it should be 
generic (native styles or something like that)
  *   Change all style using bits (GetCapabilties, GetMap, GetFeatureInfo, 
GetLegendGraphic, GetStyles) to recognize this new type of style 
(GetCapabilities) and make a call to the ResourcePool that would look something 
like getStyle(LayerInfo, styleName)
  *   Have a generic way for datastores to publish a local style, basically 
what Jody said, using the Info data structure, that would have to be extended
  *   Implementation wise, GeoPackage and Postgis are actually two dialects of 
JDBCDataStore (one class for all JDBC based stores), the SQLDialect woudl have 
to be extended to locate native styles if present
  *   There is the issue of name conflicts, a native style name could overlap a 
configured one... in this case, if the native one is configured to be 
published, I guess it would have to take precedence on the other
GeoServer wise there is a core API change, so a improvement proposal + vote is 
needed, GeoTools wise, meh... it's more or less the same (ResourceInfo 
interface is public API that would need to be extended). Personally the 
GeoTools change looks smaller to me and I'd be content with just a mail 
discussion on geotools-devel, but it's just my feeling about it, writing a 
proposal is indeed just a little effort more.

Hope this helps!

Cheers
Andrea

On Wed, Mar 21, 2018 at 3:31 PM, Jorge Gustavo Rocha 
<j...@geomaster.pt<mailto: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<tel:%2B351%20910333888>
Email j...@geomaster.pt<mailto:j...@geomaster.pt>
Site geomaster.pt<http://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<mailto:Geoserver-devel@lists.sourceforge.net>
https://lists.sourceforge.net/lists/listinfo/geoserver-devel



--

Regards,

Andrea Aime

==
GeoServer Professional Services from the experts! Visit http://goo.gl/it488V 
for more information.
==

Ing. Andrea Aime
@geowolf
Technical Lead

GeoSolutions S.A.S.
Via di Montramito 3/A
55054  Massarosa (LU)
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39  339 8844549

http://www.geo-solutions.it
http://twitter.com/geosolutions_it

AVVERTENZE AI SENSI DEL D.Lgs. 196/2003

Le informazioni contenute in questo messaggio di posta elettronica e/o nel/i 
file/s allegato/i sono da considerarsi strettamente riservate. Il loro utilizzo 
è consentito esclusivamente al destinatario del messaggio, per le finalità 
indicate nel messaggio stesso. Qualora riceviate questo messaggio senza esserne 
il destinatario, Vi preghiamo cortesemente di darcene notizia via e-mail e di 
procedere alla distruzione del messaggio stesso, cancellandolo dal Vostro 
sistema. Conservare il messaggio stesso, divulgarlo anche in parte, 
distribuirlo ad altri soggetti, copiarlo, od utilizzarlo per finalità diverse, 
costituisce comportamento contrario ai principi dettati dal D.Lgs. 196/2003.

The information in this message and/or attachments, is intended solely for the 
attention and use of the named addressee(s) and may be confidential or 
proprietary in nature or covered by the provisions of privacy act (Legislative 
Decree June, 30 2003, no.196 - Italy's New Data Protection Code).Any use not in 
accord with its purpose, any disclosure, reproduction, copying, distribution, 
or either dissemination, either whole or partial, is strictly forbidden except 
previous formal approval of the named addressee(s). If you are not the intended 
recipient, please contact immediately the sender by telephone, fax or e-mail 
and delete the information in this message that has been received in error. The 
sender does not give any warranty or accept liability as the content, accuracy 
or completeness of sent messages and accepts no responsibility  for changes 
made after they were sent or for other risks which arise as a result of e-mail 
transmission, viruses, etc.

------------------------------------------------------------------------------
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