WMTS cadastralwebmap tiles appear 'shifted'

136 views
Skip to first unread message

t.ma...@amenti.ch

unread,
Jan 7, 2019, 11:04:00 AM1/7/19
to GeoAdmin API
Hi GeoAdmin API team

I am trying to use the 'ch.kantone.cadastralwebmap-farbe' layer as WMTS service in Openlayers EPSG:3857; we registered for wmts service and all other layers are working well, but the cadastralwebmap tiles appear 'shifted'. Do you know the problem? 

Screenshot 2019-01-07 at 16.59.38.png



let projection = getProjection('EPSG:3857');
let projectionExtent = projection.getExtent();
let size = getWidth(projectionExtent) / 256;

export const cadastralLayer = new TileLayer({
  source: new WMTS({
    url:
    crossOrigin: 'anonymous',
    attributions: attributions,
    matrixSet: '3857',
    format: 'image/png',
    resourceType: 'tile',
    requestEncoding: 'REST',
    projection: projection,
    tileGrid: new WMTSTileGrid({
      origin: getTopLeft(projectionExtent),
      resolutions: [...Array(21).keys()].map(key => size / Math.pow(2, key)),
      matrixIds: [...Array(21).keys()]
    })
  }),
  extent: projectionExtent,
  style: 'default',
  wrapX: true,
  visible: true
});


Best regards,
Tõnu 


David Oesch

unread,
Jan 7, 2019, 12:58:18 PM1/7/19
to geoadm...@googlegroups.com
We are working on this issue


--
You received this message because you are subscribed to the Google Groups "GeoAdmin API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to geoadmin-api...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Marc Monnerat

unread,
Jan 10, 2019, 8:10:59 AM1/10/19
to geoadmin-api
Hello,

Cadastral survey and spherical mercator...
We are only cascading this layer and the original server does not support webmercator.
If you really want to use this layer, the only solution for now is to use a single image from WMS (wms.geo.admin.ch), layername is the same).
In the future, we will probably host this layer ourselves.

Regards,

Marc


--
-- ἡ φύσις οὐδὲν ποιεῖ ἅλματα.

t.ma...@amenti.ch

unread,
Jan 16, 2019, 6:21:23 AM1/16/19
to GeoAdmin API
Hello, 

I tried wms.geo.admin.ch for 'ch.kantone.cadastralwebmap-farbe' layer, 

get still the same problem: 

Screenshot 2019-01-16 at 12.17.10.png


could you help with the right settings? 


export const cadastralLayer = new TileLayer({

  source: new TileWMS({

    url: 'https://wms.geo.admin.ch/',

    crossOrigin: 'anonymous',

    attributions: attributions,

    params: {

      LAYERS: 'ch.kantone.cadastralwebmap-farbe',

      FORMAT: 'image/png',

      TILED: false,

      VERSION: '1.1.1'

    },

    serverType: 'mapserver'

  }),

Marc Monnerat

unread,
Jan 16, 2019, 10:58:42 AM1/16/19
to geoadmin-api
Hello Tönu, 

No, you are using a tiled WMS, so the result should be the same as WMTS. Use a single image WMS. For OL5 it is something like:

var projection = ol.proj.get("EPSG:3857");
const wms = new ol.layer.Image({
  source: new ol.source.ImageWMS({
    crossOrigin: "anonymous",
    attributions:
      'en/home.html">Bund + Kantone</a>',
    params: {
      LAYERS: "ch.kantone.cadastralwebmap-farbe",
      FORMAT: "image/png"
    },
    serverType: "mapserver",
    projection: projection
  })
});

If you are using a projection which is not EPSG:3857 or EPSG:4326, you should configure it manually.

Regards,


Marc

t.ma...@amenti.ch

unread,
Jan 17, 2019, 5:58:32 AM1/17/19
to GeoAdmin API
Hello Marc, 

thank you! it's working fine.

Regards,
Tõnu

t.ma...@amenti.ch

unread,
Apr 4, 2019, 4:54:17 AM4/4/19
to GeoAdmin API
Hello Marc,

we are using ch.kantone.cadastralwebmap-farbe layer from  https://wms.geo.admin.ch/.
its working fine with external monitor and lower resolution laptops; 
but we are experiencing problem to get the layer with laptops with retina screen (MacBook 13"); the WITH and the HEIGHT are set larger accordingly.
 
Do you know can we control the tile size?

In post from Jan 10 you mention that "in the future, we will probably host this layer ourselves." Do you know is it likely to happen or in which timeframe? Other WMTS layers are working perfectly.

Best regards,
Tõnu 


-------------
Cadastral survey and spherical mercator...
We are only cascading this layer and the original server does not support webmercator.
If you really want to use this layer, the only solution for now is to use a single image from WMS (wms.geo.admin.ch), layername is the same).
In the future, we will probably host this layer ourselves.
-------------

Marc Monnerat

unread,
Apr 4, 2019, 7:26:24 AM4/4/19
to geoadmin-api
Hello Tönu,

You mean, how to control the size of the map? Assign some CSS to your <div> holding the map. 

Regarding my remark, I think I was referring to the fact that we are currently proxying this layer, which is served by a custom WMS server reading directly Interlis files (If I'am correct).
It not very efficient, and there was the idea to migrate this layer to mapserver. Apparently, the geodata are already in our database, "only" the style is missing.

I have not heard of these project since a while, so I guess it is pretty down for now.

Regards,

Marc





--
You received this message because you are subscribed to the Google Groups "GeoAdmin API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to geoadmin-api...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

t.ma...@amenti.ch

unread,
Apr 4, 2019, 7:45:13 AM4/4/19
to GeoAdmin API
Thank you Marc,

with the first question I meant that we do not get the picture at all, if in our query the WIDTH= is too high (over 4000 by mac laptop retina display) we do not get the picture from server. Might it be that there is size limit?

example

probably you have an idea how to solve that?

Best regards,
Tõnu
To unsubscribe from this group and stop receiving emails from it, send an email to geoadm...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages