Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Mapstore's conf to optimise layers loading #218

Open
jusabatier opened this issue Sep 24, 2021 · 5 comments
Open

Update Mapstore's conf to optimise layers loading #218

jusabatier opened this issue Sep 24, 2021 · 5 comments

Comments

@jusabatier
Copy link

As discuted previously with other administrators, we should setup the way example catalogs are configured in order to have faster tiles loading.

Here is an example of what can be done :

[...]
"newService": {
    "url": "",
    "type": "wms",
    "title": "",
    "isNew": true,
    "autoload": false,
    "format":"image/vnd.jpeg-png",
    "layerOptions":{
        "tileSize":512,
        "singleTile":false,
        "legendOptions":{
            "legendWidth":30,
            "legendHeight":30
        }
    }
},
[...]
"services": {
    "localgs": {
        "url": "/geoserver/ows",
        "type": "wms",
        "title": "le geoserver local",
        "autoload": true,
        "format":"image/vnd.jpeg-png",
        "layerOptions":{
            "tileSize":512,
            "singleTile":false,
            "legendOptions":{
                "legendWidth":30,
                "legendHeight":30
            }
        },
    }
[...]

The use of image/vnd.jpeg-png should allow to faster tiles loading as it rely on GS to choose between JPEG or PNG (transparency or not).

In the last Mapstore release, image/vnd.jpeg-png8 is also available, so when it will be integrated in Georchestra, we could use it.

Any opinions about this sample conf ?

@MaelREBOUX @landryb @catmorales ?

@catmorales
Copy link
Contributor

It's OK for me .
It can be applied with localgn too.

In our configuration (localConfig.json) we have:

"localgs": {
		"url": "/geoserver/ows",
		"type": "wms",
		"title": "Géoservices",
		"autoload": true,
		"layerOptions": {
      					"tileSize": 512,
					"format": "image/png8"
  						},
		"format": "image/png8"
		},
"localgn": {
		"url": "/geonetwork/srv/fre/csw",
		"type": "csw",
		"title": "Catalogue Rennes Métropole",
		"autoload": true,
		"layerOptions": {
      					"tileSize": 512,
					"format": "image/png8"
  				      },
		"format": "image/png8"
	   }

About legendOptions i applied it in the TOC plugin section:

"name": "TOC",
				"cfg": {
					"activateDownloadTool": false,
					"activateMetedataTool": true,
					"layerOptions": {
   						"legendOptions": {
    							"scaleDependent": true,
							"legendStyle": {
								"maxWidth": "250%"
        						},
    							"WMSLegendOptions": "forceLabels:on",
    							"legendWidth": 30,
    							"legendHeight": 20,
							"legendContainerStyle": {
          							"overflowX": "auto"
							}	
        					}
   					},

@jusabatier
Copy link
Author

jusabatier commented Sep 24, 2021

Ok so I suggest to :

1°/ Update catalogs to set :

"format":"image/vnd.jpeg-png",
"layerOptions":{
    "tileSize":512,
    "singleTile":false
},

Note : Provide singleTile option allow user to know it's available here.

2°/ Add legend options conf to TOC in localConfig.json :

"legendOptions": {
    "scaleDependent": true,
    "legendStyle": {
        "maxWidth": "250%"
    },
    "WMSLegendOptions": "forceLabels:on",
    "legendWidth": 30,
    "legendHeight": 30,
    "legendContainerStyle": {
        "overflowX": "auto"
    }
}

Also here are some PGSQL example requests to update those confs for already created contexts :

=> To update catalogs config, just replace last param with your own conf.

UPDATE mapstore.gs_stored_data
SET stored_data = regexp_replace(
	stored_data,
	'"catalogServices":{.*,"selectedService":"gpvgs"}',
	'"catalogServices":{"services":{"gpvc":{"url":"https://geoportail.lepuyenvelay.fr/geonetwork/srv/fre/csw","type":"csw","title":"Catalogue GeoPortail du Velay","autoload":true,"format":"image/vnd.jpeg-png","layerOptions":{"tileSize":512,"singleTile":true},"oldService":"gpvc","showAdvancedSettings":true},"gpvgs":{"url":"https://geoportail.lepuyenvelay.fr/geoserver/ows","type":"wms","title":"Geoserver GeoPortail du Velay","autoload":true,"format":"image/vnd.jpeg-png","layerOptions":{"tileSize":512,"singleTile":true},"oldService":"gpvgs","showAdvancedSettings":true},"gpvgwc":{"url":"https://geoportail.lepuyenvelay.fr/geowebcache/service/wmts","type":"wmts","title":"GeoWebCache GeoPortail du Velay","autoload":true,"format":"image/png","layerOptions":{"tileSize":256,"singleTile":false},"oldService":"gpvgwc","showAdvancedSettings":true}},"selectedService":"gpvgs"}'
)

@landryb
Copy link
Member

landryb commented Sep 25, 2021

i just want to stress the fact that image/vnd.jpeg-png is probably a vendor format only supported by the default config of geoserver. Having that by default for all new services probably means someone adding a non-geoserver url will have to fiddle with the default format for that service ?

mapserver supports it but not by default, per the example config on https://mapserver.org/mapfile/outputformat.html

other than that, i really like the way this is going :)

@jusabatier
Copy link
Author

Ok, so maybe we can just add it as a comment and keep simple png8 by default.

After all, the config provided in datadir have to be adapted for the environment where it is deployed.
And it still possible to set the format at the catalog creation in the UI.
Also if I well understand, in last MS version, the available formats are retrieved directly from the GetCapabilities for WMS services.

@landryb
Copy link
Member

landryb commented Sep 27, 2021

Also if I well understand, in last MS version, the available formats are retrieved directly from the GetCapabilities for WMS services.

well there's geosolutions-it/MapStore2#6522, right, but i havent tested it (and i dunno if its in our mapstore2) so georchestra/mapstore2-georchestra#301 and georchestra/mapstore2-georchestra#302 are still open...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants