Problem concerning Scales/Resolutions and Tiled Services

561 views
Skip to first unread message
Assigned to bovio....@gmail.com by me

pgs...@gmail.com

unread,
Mar 8, 2021, 9:32:58 AM3/8/21
to mapstore-users

Hi all,

I have the following customised gridSet in Geoserver (using GeowebCache with Direct integration with GeoServer WMS) 

gridset.png

So, I’ve customised the resolutions in mapstore to match geoserver scales, as you can see below:


{

  "version": 2,

        "map": {

    "projection": "EPSG:25830",

                "units": "m",

                "center": {"x": 636000, "y": 4200000, "crs": "EPSG:25830"},

    "zoom":6,

                "maxExtent": [

                        227071.8572857892, 3901876.695336829,

                        772928.1427142108, 8942165.537905218

                ],

 

        "mapOptions": {

              "view": {

                "resolutions": [

                        2187.6253656980857,

                        1093.8126828490429,

                        546.9063414245214,

                        273.4531707122607,

                        136.72658535613036,

                        68.36329267806518,

                        34.18164633903259,

                        17.090823169516295,

                        8.545411584758147,

                        4.272705792379074

                ]

              }

            },

                "layers": [

……

However, you can see at following screenshot from a new map in mapstore missmatching scales with geoserver. This missmatching I think leads to problems due to the client making WMS requests (mapstore) that do not align with the grid of tiles that GeoWebCache has created.

 scales_mapstore.png

I would be very grateful if anyone can help me with this problem or clarify me how it works.

 

Thanks a lot.

Petar Sapunar

unread,
Mar 8, 2021, 9:42:55 AM3/8/21
to mapstor...@googlegroups.com
Hello pgs93h
as i recall, several people had the same problem. In essence the problem with "new.json" is that you are defining resolutions and not scales. i think you can just go something like this:

        "scales": [

                        1:100,

                        1:200,

                        1:3000,

etc. search the github forum and mapstore groups i think you will find the answer.

https://groups.google.com/g/mapstore-users/c/J418lCt4mtQ/m/3_6CusdZCAAJ


Virus-free. www.avast.com

--
You received this message because you are subscribed to the Google Groups "mapstore-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mapstore-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mapstore-users/2f4eea79-fc0b-4568-91db-66bf37a56aaen%40googlegroups.com.

Virus-free. www.avast.com

pgs...@gmail.com

unread,
Mar 9, 2021, 6:39:09 AM3/9/21
to mapstore-users
Sorry but I think I don't understand you. Your proposal about "scales" doesn't work (I've replaced 'resolutions' by 'scales' and filled with related scales ).
Besides, I've read your link and applied what Mauro Bartolomeoli says about 
 - scale = resolution * dpu where dpu = dpi * (100 / 2.54), where dpi = 96

and although at small scales (zoom out) works fine, but a bigger scales (zoom in, more details) appears again problems related to grid misalignment, as it showed in the following message:
400: Requested horizontal resolution: 2145.5411359375003 , best match: 2445.984905625 exceeds 10% threshold. Perhaps the client is configured with an incorrect set of scales (resolutions), or the DPI setting is off compared to the one in GWC ?

So, that makes me believe that mapstore uses different method to calculate scales versus geoserver. Any idea?

Regards.

Stefano Bovio

unread,
Mar 15, 2021, 6:47:54 AM3/15/21
to mapstor...@googlegroups.com
Hi psg93h,


Sorry but I think I don't understand you. Your proposal about "scales" doesn't work (I've replaced 'resolutions' by 'scales' and filled with related scales ).

Scales property did not work before but it was recently added to MapStore master branch and it uses a list of scales denominators
https://github.com/geosolutions-it/MapStore2/pull/6577


  Besides, I've read your link and applied what Mauro Bartolomeoli says about 
 - scale = resolution * dpu where dpu = dpi * (100 / 2.54), where dpi = 96  

The scale box tools shows only the list of scales and it has not effect on the request and the missmatch seems due to different DPI used as you noted. https://github.com/geosolutions-it/MapStore2/blob/master/web/client/utils/MapUtils.js#L206
The gridset in GeoServer seems to use a DPI of ~90.7 and we are using it in the WMTS request to get the correct scales see here:
https://github.com/geosolutions-it/MapStore2/blob/master/web/client/components/map/openlayers/plugins/WMTSLayer.js#L57-L62

  and although at small scales (zoom out) works fine, but a bigger scales (zoom in, more details) appears again problems related to grid misalignment, as it showed in the following message:
400: Requested horizontal resolution: 2145.5411359375003 , best match: 2445.984905625 exceeds 10% threshold. Perhaps the client is configured with an incorrect set of scales (resolutions), or the DPI setting is off compared to the one in GWC ?
  
I tried also to test that gridset locally and I did not find artifacts or misalignements on the different zoom levels,
these are the steps I followed:
- configured a new gridset EPSG:25830 on geoserver and assigned this new gridset to a layer
image.png
- add to localConfig the new projection in the projectionDefs property https://mapstore.readthedocs.io/en/latest/developer-guide/local-config/#projectiondefs-configuration
"projectionDefs": [{
  "code": "EPSG:25830",
  "def": "+proj=utm +zone=30 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs",
  "extent": [-729785.76, 3715125.82, 945351.10, 9522561.39],
  "worldExtent": [-16.1, 32.88, 40.18, 84.17]
}
- copied your new json configuration in a static map
- imported the layer in the map

wmts (cropped on the tile extents of gridset)
image.png
wms  
image.png

tried also to zoom in but there were not visible artifact or misalignement on the tiles.

Hope this information could help,
Regards,

Stefano





--

Regards,

Stefano Bovio

==

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

==

Stefano Bovio

Digital Cartographer - UI/UX Designer


GeoSolutions S.A.S.

Via di Montramito 3/A

55054  Massarosa (LU)

Italy

phone: +39 0584 962313

fax:     +39 0584 1660272


http://www.geo-solutions.it

http://twitter.com/geosolutions_it


-------------------------------------------------------


Con riferimento alla normativa sul trattamento dei dati personali (Reg. UE 2016/679 - Regolamento generale sulla protezione dei dati “GDPR”), si precisa che ogni circostanza inerente alla presente email (il suo contenuto, gli eventuali allegati, etc.) è un dato la cui conoscenza è riservata al/i solo/i destinatario/i indicati dallo scrivente. Se il messaggio Le è giunto per errore, è tenuta/o a cancellarlo, ogni altra operazione è illecita. Le sarei comunque grato se potesse darmene notizia.

This email is intended only for the person or entity to which it is addressed and may contain information that is privileged, confidential or otherwise protected from disclosure. We remind that - as provided by European Regulation 2016/679 “GDPR” - copying, dissemination or use of this e-mail or the information herein by anyone other than the intended recipient is prohibited. If you have received this email by mistake, please notify us immediately by telephone or e-mail.

Reply all
Reply to author
Forward
0 new messages