georchestra / mapstore2-georchestra

geOrchestra newest viewer
Other
6 stars 23 forks source link

Parameters config resolutions #314

Closed catmorales closed 3 years ago

catmorales commented 3 years ago

In the config.json and new.json, it is possible to configure resolutions to have appropriate scales in the map. cf https://mapstore.readthedocs.io/en/latest/developer-guide/maps-configuration/#map-options

In mapfishapp we use the scales below to define the levels to use in the map : scales The same scales are also used in geowebcache to define the gridsets. This scales permit a good interoperability between our platforms and allow us to quickly display the map on the levels thus defined in mapfishapp.

In Rennes Metropole we used as base layers all the WMTS we created with this gridsets and we don't use OSM.

Questions

1 -How should we calculate the resolutions to have the same scales as on mapfishapp? 2- We are seeing slowness in the display of our backgrounds in WMTS with a re-calculation probably in a local tile cache for each level. Will putting the right resolutions for our gridsets in the map solve this problem? 3- Is it possible to modify an application context by overloading it with these new resolutions and in which plugin (map)? And how?

Otherwise, as soon as we have the new resolutions, we will have to add them in the new.jon and config.json.

tdipisa commented 3 years ago

Dear @catmorales

1 -How should we calculate the resolutions to have the same scales as on mapfishapp?

I think you can simply use them, just pay attention on the opposite sorting of the array

2 - We are seeing slowness in the display of our backgrounds in WMTS with a re-calculation probably in a local tile cache for each level. Will putting the right resolutions for our gridsets in the map solve this problem?

It should be, yes. Usually the client resolutions should match the gridset ones in order to use cached tiles

3- Is it possible to modify an application context by overloading it with these new resolutions and in which plugin (map)? And how?

At the moment it is not possible. Custom resolutions client side can be defined only as a global configuration in MapStore inside new.json and/or config.json. What you are mentioning it is anyway possible with some development, it could be an interesting improvement.

catmorales commented 3 years ago

I think you can simply use them, just pay attention on the opposite sorting of the array

I tried it but it's not the same values. resolutions is a calculate value. By the way, in your example the values

         84666.66666666688,
          42333.33333333344,
          21166.66666666672,
          10583.33333333336,
          5291.66666666668,
          2645.83333333334,
          1322.91666666667,
          661.458333333335000,
          529.166666666668000,
          396.875000000001000,
          264.583333333334000,
          132.291666666667000,
          66.145833333333500,
          **39.687500000000100,**
          26.458333333333400,
          13.229166666666700,
          6.614583333333350,
          3.968750000000010,
          2.645833333333340,
          1.322916666666670,
          0.661458333333335

correspond to the scales : image I added the 4th last ones.

catmorales commented 3 years ago

Ok I think we should use this: denominator of the scale = resolution (m/px) /0.00028

0.00028 is the pixel size. I will try

catmorales commented 3 years ago

Something is wrong. With the denominator scale of geOrchestra listed here and a pixel size of 0.00028, i obtained the resolutions bellow and configured the new.json with it.

"mapOptions":{
          "view": {
            "resolutions": [
                156543.033928041010838933296,
                78271.516964020490865223112,
                39135.758482010230882442552,
                19567.879241005122716305764,
                9783.939620502561358152896,
                4891.969810251280679076448,
                2445.984905125640339538224,
                1222.992452562820169769112,
                611.496226281410084884556,
                305.748113140704815064064,
                152.874056570352521221132,
                76.437028285176246405396,
                38.218514142588130305276,
                19.109257071294061601356,
                9.554628535647032576312,
                4.777314267823516288156,
                2.388657133911758144092,
                1.194328566955879072032,
                0.597164283477939536016,
                0.298582141738969712512,
                0.149291070869484911752,
                0.07464553543474240038

            ]
          }
      },

So, I expected to find the original scales, namely: 1:266, 1:533, 1:1066,... And it is not the case cf image below. image

What is the problem ? Do you use another pixel size ( 0.00028) in mapstore to list the scales in the viewer ?

fvanderbiest commented 3 years ago

Reminds me of https://github.com/georchestra/georchestra/issues/736 ;-)

catmorales commented 3 years ago

Now , i could add in new.json and config.json the same scales as geowebcache gridset because parameter "scales" has been added : https://mapstore.readthedocs.io/en/latest/developer-guide/maps-configuration/#map-options

Thank you !

So it's works I have the same scales in both maps, based on the gridset of geowebcache. scales_mapfishappscalesmapstore Configuration is:

"mapOptions": {
            "view": {
                "scales": [
                    559082264.0287178958533332,
                    279541132.0143588959472254,
                    139770566.0071793960087234,
                    69885283.0035897239868063,
                    34942641.5017948619934032,
                    17471320.7508974309967016,
                    8735660.3754487154983508,
                    4367830.1877243577491754,
                    2183915.0938621788745877,
                    1091957.5469310886252288,
                    545978.7734655447186469,
                    272989.3867327723085907,
                    136494.6933663861796617,
                    68247.3466831930771477,
                    34123.6733415965449154,
                    17061.8366707982724577,
                    8530.9183353991362289,
                    4265.4591676995681144,
                    2132.7295838497840572,
                    1066.3647919248918304,
                    533.1823959624461134,
                    266.5911979812228585,
                    133.2955989906114292
                ]
            }
        },
MaelREBOUX commented 3 years ago

Good point !