WebGIS Discussions

Need a push in the right direction when configuring WebMap, Portal or SDI services? Looking for hints and tips, or just looking for Ideas and information? The WebGIS discussion board is where you start those discussions, connect and share information.
Showing results for 
Search instead for 
Do you mean 
Reply
Contributor
Posts: 33
Registered: ‎11-19-2015
Accepted Solution

How to create Webmap WMTS custom tile matrix set?

[ Edited ]

Hello everybody,

 

 

In past I did number of successfull Webmap WMTS cache generations in EPSG3857 with Google well known matrix set (global).

Now I am investigating how to create custom tile matrix set for our projected EPSG3059 coordinate system. All attempts so far is ending with empty screen Geomedia Webmap and Geomedia desktop as test client. In some cases the distorted image parts are displayed.

 

What kind of rules would be apropriate to create custome tile matrix set for Cartesian systems?

 

<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<AdvancedRasterServices name="[name]" contactPerson="[contactPerson]" contactOrganization="[contactOrganization]">
  <RasterService>
    <Code>ortofoto_2016_prod</Code>
    <Name>ortofoto_2016_prod</Name>
    <DateStamp>20091022</DateStamp>
    <MapType>PNG</MapType>
    <MapSize>256</MapSize>
    <JpegQuality>0</JpegQuality>
    <VectorQuality>100</VectorQuality>
    <CoordinateSystem geographic="false">EPSG:3059</CoordinateSystem>
    <BoundingBox minx="477883.63" miny="300530.3" maxx="537116.37" maxy="328169.89"/>
    <Levels>
        <Level levelNumber="0" tileSize="59233" />
        <Level levelNumber="1" tileSize="29616" />
        <Level levelNumber="2" tileSize="14808" />
        <Level levelNumber="3" tileSize="7404" />
        <Level levelNumber="4" tileSize="3702" />
        <Level levelNumber="5" tileSize="1851" />
    </Levels>
  </RasterService>
</AdvancedRasterServices>

 

Ervins

Staff
Posts: 295
Registered: ‎11-05-2015

Re: How to create Webmap WMTS custom tile matrix set?

 

What do you mean by saying "distorted"? Do the tiles look like they've been shuffled around, or is the raster image somehow different from what you'd expect?

The EPSG:3059 looks to be defined as using a Cartesian system of Northing/Easting expressed in meteres. This is the same axes direction as EPSG:4326 and this might be the root of your problems.

I see that you have your levels defined so that at the zeroth level there should be exactly one tile (at most two, depending on numerical error Smiley Wink). Can you verify the WMS output for the whole bounding box and compare that against this level 0 tile?

How does the WMS behave in both Geospatial Portal and GeoMedia Desktop?

Contributor
Posts: 33
Registered: ‎11-19-2015

Re: How to create Webmap WMTS custom tile matrix set?

Hello,

 

Still no any reasonable result on WMTS caching in EPSG3059.

With "distorted" I mean two separate effects. At the overview scale - in my example 826353 Webmap(and Geospatial portal) shows the WMTS data shifted 162 km from WMS data. The WMS originating service ortofoto maps fits prefectly with known coordinates in all software - including Geomedia desktop, Webmap, Geospatial portal et cetera. But on next closer zoom the WMTS map is going to be totally desorganized - some tiles are visibly missing, some has wrong scale.

In the number of trials WMTS resonse simply gives the empty blank screen.

 

WMS getcapabilities response excerpt:

<BoundingBox maxy="328169.89" maxx="537116.37" miny="300530.3" minx="477883.63" CRS="EPSG:3059"/>

 

I did large number of different trials with "0"  map tile similar to X and also Y difference from WMS response:

 

maxy-miny = 328169.89 - 300530.3 = 27639.59 rounded to 27640
maxx-minx= 537116.37 - 477883.63 = 59232.74  rounded to 59233

 

 

My Web.config excerpt for Axis part:

  <RasterService rasterServiceCode="ortofoto_2016_prod">
                   <SimpleMapping swapCoords="true" invertXAxis="false" invertYAxis="false" />
                      <ProductDefinition epsg="EPSG:3059">

 

 

Kind regards,

Ervins

 

 

 

 

Staff
Posts: 295
Registered: ‎11-05-2015

Re: How to create Webmap WMTS custom tile matrix set?

Since EPSG:3059 is defined exactly the same axes order-wise as EPSG:4326, I think your <SimpleMapping> section should look like it did in the default sample configuration, i.e.:

<SimpleMapping swapCoords="true" invertXAxis="true" invertYAxis="true" />

This doesn't explain why the images on the tiles are so strange, though Smiley Sad Nor the 162km displacement.

 

Have you tried to display this WMS straight in the Geospatial Portal and switching it into "tiled" mode?

2017-01-26 16_15_06-localhost_portal2_.png

Does it work ok then?

Contributor
Posts: 33
Registered: ‎11-19-2015

Re: How to create Webmap WMTS custom tile matrix set?

Hello, again !

 

1) Yes, it is - strange tiles is also in WMS service on Webmap Geoportal map display if Display mode is switched to "Tiled" . There is no " Tiled"  mode in Geomedia desktop so WMS output is always good testing on desktop. I did not find anything wrong in publishing original ECW ortophoto files via Webmap Publisher. Service source is Microsof Access.

2) Switching to

<SimpleMapping swapCoords="true" invertXAxis="true" invertYAxis="true" />

 

results no shift 162 km. Now tiles are desorganized in but placed in approx. right  places.

 

 

Regards,

Ervins

Technical Evangelist
Posts: 1,144
Registered: ‎09-11-2015

Re: How to create Webmap WMTS custom tile matrix set?

Hi Ervins,

 

I recalled that we had the same problem for EPSG:3844 used for Romania. It too has swapped cordinates and even the WMS did not render correctly when tiled.

 

There's a commented section in the WMS web.config file <CRSStore storeName="globalStore"/> inside WMSBasicOriginatingPipe section. If you uncomment it  the axis will be according to the CSF file definition from the csf subfolder. You need to fill the GlobalCRSStore / CRSStore section first in the web.config, adding the supported CRS definitions with csf files and EPSG names. Of course make sure that the CSF file is then placed in proper folder. After that the WMS service should be correctly displayed in the Portal in tiled mode.

 

As for the WMTS:

  • shared CacheConfiguration.xml
    <CoordinateSystem geographic="false">EPSG:3059</CoordinateSystem>
    bbox as you have defined
  • web.config
    <RasterService rasterServiceCode="..service name...">
                          <SimpleMapping swapCoords="true" invertXAxis="true" invertYAxis="true" />
                          <ProductDefinition epsg="EPSG:3059">
                            <LayerDefinitions>
                              <LayerDefinition style="" layer="...layer name..." />
                            </LayerDefinitions>

 

Regards,

Jan

Jan Neumann
Post Sales Engineer Web Applications
Hexagon Geospatial

Highlighted
Contributor
Posts: 33
Registered: ‎11-19-2015

Re: How to create Webmap WMTS custom tile matrix set?

Hello,

 

I did all tests again - the "feeding" WMS service web.config changes did not help to prevent distorted tiles in WMTS for EPSG3059.
The  WMS service response in tiled mode still is desorganized.

 

The another test WMTS from the same ortophoto data set (originally ECW)   but in EPSG3857 coordinate system works fine (" feeding"  WMS in EPSG3857 and resulting WMTS in EPSG3857). No problems in WMS service tiled mode in EPSG3857.

 

But we shall manage to do the same for EPSG3059.

 

 

 

Kind regards,

Ervins

Technical Evangelist
Posts: 1,144
Registered: ‎09-11-2015

Re: How to create Webmap WMTS custom tile matrix set?

[ Edited ]

Hi Ervins,

 

I gave it some testing and found out the source of the problem. The CSF definition used in GeoMedia does not have the axes switched. This problem is not apparent on desktop as GeoMedia does not take care of that and displays everything fine. But WebMap is more strict.

 

To make it work properly please edit the CSF file and change axis orders. I did for both projection and geographic as I was not sure which one is picked up by WebMap:

Untitled.png

 

  1. Place this updated CSF file into both WMS service instance csf and into C:\WebMap Publisher Projects\<WMS-source>\CSF folders.
  2. Keep the globalCrsStore modification in WMS web.config
  3. Restart WWW, WebMap and Capabilities Cache (if used) services.
  4. Get rid of the browser cache in Portal and check if you can see the WMS in tiled mode properly.

Once done, you can go back and continue on the WMTS pilgrimage Smiley Wink

 

Regards,

Jan

Jan Neumann
Post Sales Engineer Web Applications
Hexagon Geospatial

Contributor
Posts: 33
Registered: ‎11-19-2015

Re: How to create Webmap WMTS custom tile matrix set?

Hello,

 

Thanks! Solution tehnicaly works and produces WMTS tile cache. Unfortunatelly according to Spatial Reference organization axis order is Longitude/Latitude and as a result X and Y coordinates is interchanged in wrong way in Geoportal.

 

 

 

Best regards,

Ervins

Contributor
Posts: 33
Registered: ‎11-19-2015

Re: How to create Webmap WMTS custom tile matrix set?

The official Latvia Geoportal sequence of X and Y axis.