Groups
Groups
Sign in
Groups
Groups
GeoAdminCh API
Conversations
Labels
About
Send feedback
Help
Leaflet integration of SwissTopo map
909 views
Skip to first unread message
raf...@gmail.com
unread,
Jul 7, 2016, 7:19:46 AM
7/7/16
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to GeoAdmin API
Hello, I'm a bit new to all web developement but I would love to include the Swisstopo map on my leaflet map. (see
http://zoziologie.raphaelnussbaumer.com/improved-biolovision-visualisation/
)
I've try to use
http://leafletjs.com/examples/wms/wms.html
together with
https://api3.geo.admin.ch/services/sdiservices.html#wmts
to make this code:
var wmsLayer = L.tileLayer.wms('
http://wmts.geo.admin.ch/1.0.0/WMTSCapabilities.xml
', {
layers: '
ch.swisstopo.pixelkarte-farbe-pk1000.noscale
'
}).addTo(map);
If I understand correctly, the map should be free (
https://api3.geo.admin.ch/api/faq/index.html#available-layers
), is that right ?
But if I try a simple query like:
https://wmts.geo.admin.ch/1.0.0/ch.swisstopo.pixelkarte-farbe-pk1000.noscale/default/20140106/21781/20/58/70.jpeg
. It doesn't work.
I've also try the code provided in
https://www.procrastinatio.org/assets/js/native-wmts-leaflet.js
. And that also does not seem to work
1. Is the first method suppose to work ? O should I use the second o
ne (fro
m Marc Monnerat )?
2. If I need a swisstopo web access, How can I get it ? The link given
https://www.swisstopo.admin.ch/internet/swisstopo/en/home/products/services/web_services/webaccess.html
seems to be broken.
Thanks in advance for you help,
Gilbert Jeiziner
unread,
Jul 7, 2016, 7:26:12 AM
7/7/16
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to geoadm...@googlegroups.com, raf...@gmail.com
Hi
while the data is free, you need to register to be able to use it:
https://www.geo.admin.ch/de/geo-dienstleistungen/geodienste/darstellungsdienste-webmapping-webgis-anwendungen/programmierschnittstelle-api/anmeldung.html
There is a maximum quota that you can use for free. Once you have
registered a domain, it should work.
Gilbert
> --
> 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
[1].
>
>
> Links:
> ------
> [1]
https://groups.google.com/d/optout
Raphaël Nussbaumer
unread,
Jul 8, 2016, 7:05:17 AM
7/8/16
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Gilbert Jeiziner, geoadm...@googlegroups.com
Hi,
I finally managed to be registered! However, my script is still not working:
L.tileLayer.wms('
http://wmts.geo.admin.ch/1.0.0/WMTSCapabilities.xml
', {
layers: 'ch.swisstopo.pixelkarte-farbe-pk1000.noscale'
}).addTo(map)
Here is the error log:
GET
http://wmts.geo.admin.ch/1.0.0/WMTSCapabilities.xml?SERVICE=WMS&REQUEST=GetMap&VERSION=1.1.1&LAYERS=ch.swisstopo.pixelkarte-farbe-pk1000.noscale&STYLES=&FORMAT=image%2Fjpeg&TRANSPARENT=false&HEIGHT=256&WIDTH=256&SRS=EPSG%3A3857&BBOX=821850.9281222151,5909499.530783548,860986.6866042252,5948635.289265557
500 (Internal Server Error)
1. How can I check that the registration work from my page (
http://zoziologie.raphaelnussbaumer.com/improved-biolovision-visualisation/
)
2. the the query correct or am I doing a wrong set-up ?
Thanks in advance,
cheers,
--
Raphaël.
Loïc Gasser
unread,
Jul 8, 2016, 7:24:28 AM
7/8/16
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to geoadm...@googlegroups.com, Gilbert Jeiziner
Hi Raphael,
are you sure about
L.tileLayer.wms ?
It is a WMTS Capabilities you're trying to use here and not a WMS. Which service are you trying to use?
My advise would be to use
ch.swisstopo.pixelkarte-farbe rather than the noscale one.
You should generate requests that look like:
http://wmts10.geo.admin.ch/1.0.0/ch.swisstopo.pixelkarte-farbe/default/20140520/3857/9/266/180.jpeg
Kind Regards,
Loïc
For more options, visit
https://groups.google.com/d/optout
.
Loïc Gasser
unread,
Jul 8, 2016, 7:59:19 AM
7/8/16
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to geoadm...@googlegroups.com
Hi Raphael,
here is a codepen.
http://codepen.io/loicgasser/pen/bZobWz?editors=0010
Hope this helps
Raphaël Nussbaumer
unread,
Jul 8, 2016, 8:20:45 AM
7/8/16
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to geoadm...@googlegroups.com
Great ! Thank you so much !
Just to try to understand:
https://github.com/mylen/leaflet.TileLayer.WMTS
is using the KVP encoding while Swiss Topo is using REST ?
(cf:
https://en.wikipedia.org/wiki/Web_Map_Tile_Service
)
--
Raphaël.
Loïc Gasser
unread,
Jul 8, 2016, 8:32:35 AM
7/8/16
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to geoadm...@googlegroups.com
Yes indeed.
You can now access all our layers in EPSG:3857.
See also:
http://wmts10.geo.admin.ch/EPSG/3857/1.0.0/WMTSCapabilities.xml
for a complete list of layers. Enjoy!
Some contextual data might be of intrest for your use case.
Kind Regards,
Loïc
Raphaël Nussbaumer
unread,
Jul 13, 2016, 4:30:55 AM
7/13/16
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to geoadm...@googlegroups.com
thanks!
--
Raphaël.
Reply all
Reply to author
Forward
0 new messages