regione-piemonte / decsira

SIRA Decisionale Ambiente
1 stars 19 forks source link

WMTS compatibility #780

Open mbarto opened 4 years ago

mbarto commented 4 years ago

Check why this WMTS service is not working (works fine on latest MapStore DEV), we have an error when adding a layer to the map. Is it related to the custom CRS?

Connected to #720

dsuren1 commented 4 years ago

Hi @mbarto Kindly let me know the WMTS service tried

mbarto commented 4 years ago

Sorry, https://webgis.arpa.piemonte.it/ags/rest/services/topografia_dati_di_base/alluvione_20201003_S1_RGB/ImageServer/WMTS/1.0.0/WMTSCapabilities.xml

dsuren1 commented 4 years ago

@mbarto Yes, you are right. This issue is because of the custom srs (EPSG:32632) which is not supported in mapstore (Supported ones are EPSG:900913 & EPSG:3857)

mbarto commented 4 years ago

Do you think it is difficult to implement support for other CRS in WMTS? I just need an effort evaluation (trivial, medium, difficult), then we can ask @tdipisa if we want to do it

dsuren1 commented 4 years ago

The current WMTS capabilities URL shared doesn't have supporting TileMatrixSet for the custom CRS (EPSG:32632). Currently it only supports EPSG:3857.

mbarto commented 4 years ago

@dsuren1 Can you check this one? Seems to have issues too, in this case the EPSG:32632 grid should be supported:

http://geomap.reteunitaria.piemonte.it/mapproxy/service?

dsuren1 commented 4 years ago

@mbarto For testing purpose, I bypassed the supported CRS validation in Mapstore to check if the layer can be added I get an exception when making a call with REQUEST=DescribeDomains "unknown WMTS request type 'None'" service call However the getCapabilities lists the only two operations . Could this be the reason for the calls failing with REQUEST=DescribeDomains as the operation is not supported on the server?

<ows:OperationsMetadata>
        <ows:Operation name="GetCapabilities">
        </ows:Operation>
        <ows:Operation name="GetTile">
        </ows:Operation>
    </ows:OperationsMetadata>

In this case, should we need to request based on tiles, then this request type is not available in Mapstore. Kindly advise

mbarto commented 4 years ago

@dsuren1 I believe DescribeDomains is called to check if the layer supports the time dimension, but also if failing this should not prevent adding the layer to the map

dsuren1 commented 4 years ago

@mbarto Got it. Seems like while calling the getTiles, the TileMatrixSet name is sent incorrect along with missing param 'tilematrix' is preventing from adding the layer successfully

mbarto commented 4 years ago

Let's see if you can fix this bug

tdipisa commented 4 years ago

@mbarto @dsuren1 yes, the DescribeDomain is performed to check if a time dimension is available. I can confirm what @mbarto said here.

tdipisa commented 4 years ago

@dsuren1 can you please better clarify if the problem for this issue is related to this comment or this one or both? I was expecting an estimate for this as specified by @mbarto here but I don't understand precisely the problem at this point.

dsuren1 commented 4 years ago

Hi @tdipisa, this issue was closed earlier with this comment unfortunately by the time I added the issue was close already. This comment , is the actual issue and needs to be addressed in the Mapstore. I'm just investigating it a little and I should be able to give an estimate accordingly.

dsuren1 commented 4 years ago

@tdipisa @mbarto The effort required to implement this is support in Mapstore is high based on my understanding.

Kindly let me know your thoughts

tdipisa commented 4 years ago

@mbarto @dsuren1 I've involved @offtherailz for a double check on this. Thank you @dsuren1.

offtherailz commented 4 years ago

I report the result of my investigation. First of all MapStore uses ows:WGS84BoundingBox to assign to the WMTS source extent and so prevent issues for tile loading outside the limit, or when origin/origins is not calculable.

This is the first issue, because for layers coming from the bbox is wrong (this value is taken as boundingBox in creation of record and converted in the layer's bbox, then bbox is used in WMTSLayer to deternine the extent):

<ows:WGS84BoundingBox>
<ows:LowerCorner>-114.587420433 -2039.66243729</ows:LowerCorner>
<ows:UpperCorner>64.3425155404 1117.3210657</ows:UpperCorner>
</ows:WGS84BoundingBox>

Anyway this is an optional field that probably MapStore could have an option to ignore it.

Even removing this extent/bbox from the code (it is not mandatory), the tile requests are inconsinstent.

This is how I removed temporary the bbox creation to make the issue with tiles visible:

diff --git a/web/client/utils/CatalogUtils.js b/web/client/utils/CatalogUtils.js
index 1434621ed..bbd3921e1 100644
--- a/web/client/utils/CatalogUtils.js
+++ b/web/client/utils/CatalogUtils.js
@@ -304,15 +304,6 @@ const converters = {
                     matrixIds,
                     format: record.format,
                     TileMatrixSetLink: castArray(record.TileMatrixSetLink),
-                    boundingBox: {
-                        extent: [
-                            bbox["ows:LowerCorner"].split(" ")[0],
-                            bbox["ows:LowerCorner"].split(" ")[1],
-                            bbox["ows:UpperCorner"].split(" ")[0],
-                            bbox["ows:UpperCorner"].split(" ")[1]
-                        ],
-                        crs: "EPSG:4326"
-                    },
                     references: [{
                         type: "OGC:WMTS",
                         url: urls,
@@ -528,15 +519,7 @@ const CatalogUtils = {
             description: record.description || "",
             tileMatrixSet: type === "wmts" ? record.tileMatrixSet || [] : undefined,
             credits: !ConfigUtils.getConfigProp("noCreditsFromCatalog") && record.credits,
-            bbox: {
-                crs: record.boundingBox.crs,
-                bounds: {
-                    minx: record.boundingBox.extent[0],
-                    miny: record.boundingBox.extent[1],
-                    maxx: record.boundingBox.extent[2],
-                    maxy: record.boundingBox.extent[3]
-                }
-            },
+
             links: getRecordLinks(record),
             params: params,
             allowedSRS: allowedSRS,

This is one of the tile requests: https://geomap.reteunitaria.piemonte.it/mapproxy/service?layer=regp_basecarto10bn_2015_wmts&style=&tilematrixset=grid_32632_nw&Service=WMTS&Request=GetTile&Version=1.0.0&Format=image%2Fpng&TileMatrix=14&TileCol=8039&TileRow=-8064

TileRow=-8064 is negative, should be positive and with a different value. Not sure the reason of this problem, probably an issue determining

for this projection/tilematrix combination

I think these are the things to pay attention to. Comparing with other WMTS in different SRS that are working.

tdipisa commented 4 years ago

@mbarto, I put it in blocked. This isn't related to the MS project update but something to investigate MS side. I will open an issue MS side to schedule a fix for future MS releases.

simboss commented 4 years ago

@tdipisa please, like the othe issues here.