Bílý vrch
icon TrekBuddy
www.trekbuddy.net
Outdoor companion.
  • internal / bluetooth / simulator GPS
  • offline raster maps
  • smart GPX / raw NMEA logs
  • waypoints and simple navigation
  • custom views
  • MIDP and Symbian phones
  • Blackberry
  • Android
Visit wiki to see all features, guides and howtos. Project tracker.

Partners:    (Polish/Polski)(Polski) Compass mapy      (Polish/Polski)(Polski) Galileos mapy      (Polish/Polski)(Polski) CartoMedia      (Czech/Èesky)(Èesky) Eaglesoft trasy      (Polish/Polski)(Polski) ExpressMap     

 FAQFAQ   SearchSearch   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
MOBAC + Cartes suisses

 
Post new topic   Reply to topic    TrekBuddy Forum Index -> Français
View previous topic :: View next topic  
Author Message
guest



Joined: 08 Oct 2006
Posts: 4855

PostPosted: Mon May 28, 2018 10:44 am    Post subject: MOBAC + Cartes suisses Reply with quote

Bonjour,
Les cartes suisses ne fonctionnent plus avec ce bsh

Code:
name = "Suisse, Swisstopo - 2018";
tileType = "jpg";
minZoom = 4;
maxZoom = 20;
String getTileUrl(int Zoom, int X, int Y) {
   return "http://wmts10.geo.admin.ch/1.0.0/ch.swisstopo.pixelkarte-farbe/default/current/3857/" + Zoom + "/" + X + "/"+ Y + ".png";
   }
void addHeaders(java.net.HttpURLConnection conn) {
   if (Windows_ou_Linux) {
   // Pour Windows et Linux
 
 conn.addRequestProperty("Referer","http://www.swisstopo.admin.ch/internet/swisstopo/en/home.html");
   conn.addRequestProperty("User-Agent","Mozilla/5.0 Gecko/20100101 Firefox/49.0");
   }else{
   // Pour MacOS
 
 conn.addRequestProperty("Referer","http://www.swisstopo.admin.ch/internet/swisstopo/en/home.html");
   conn.addRequestProperty("User-Agent",UserAgent);   
   }
}


Savez-vous où est le changement. Je recherche ici : https://www.swisstopo.admin.ch/fr/home.html mais ne trouve rien de probant
Merci
Nicolas PAOUR
Back to top
View user's profile Send private message Visit poster's website
guest



Joined: 08 Oct 2006
Posts: 4855

PostPosted: Tue Jun 26, 2018 8:24 am    Post subject: Reply with quote

Probablement un pb de referer à rajouter, remplace ton addHeaders compliqué par celui là :
Code:
void addHeaders( java.net.HttpURLConnection conn) {
conn.addRequestProperty("Referer","https://map.geo.admin.ch/");
conn.addRequestProperty("User-Agent","Mozilla/5.0 (Windows NT 5.1; rv:51.0) Gecko/20100101 Firefox/51.0");
}

Qui marche en tous cas bien sous Windows.
Back to top
View user's profile Send private message Visit poster's website
guest



Joined: 08 Oct 2006
Posts: 4855

PostPosted: Thu Jul 05, 2018 7:18 pm    Post subject: Reply with quote

Bonjour,
Merci pour le retour, mais ça ne marche pas. L'avais-tu testé ?
Avec quel code ?
Nicolas
Back to top
View user's profile Send private message Visit poster's website
guest



Joined: 08 Oct 2006
Posts: 4855

PostPosted: Mon Jul 09, 2018 12:40 pm    Post subject: Reply with quote

Le mien montre un niveau de plan LM3D avant les orthophotos :
Code:
name = "Suisse, Swisstopo - 2018";

tileType = "jpg";
tileSize = 256;
minZoom = 6;
maxZoom = 19;
tileUpdate = TileUpdate.IfModifiedSince;
backgroundColor = "#ffffff";
ignoreError = "True";

String getTileUrl( int zoom, int x, int y ) {
if (zoom < 16)
   {return "http://wmts10.geo.admin.ch/1.0.0/ch.swisstopo.pixelkarte-farbe/default/current/3857/" + zoom + "/" + x + "/" + y + ".jpeg";}
else
   {if (zoom < 17)
      {return "http://wmts10.geo.admin.ch/1.0.0/ch.swisstopo.swisstlm3d-karte-farbe/default/current/3857/" + zoom + "/" + x + "/" + y + ".png";}
   else
      {return "http://wmts10.geo.admin.ch/1.0.0/ch.swisstopo.swissimage/default/current/3857/" + zoom + "/" + x + "/" + y + ".jpeg";}
   }
}
}

void addHeaders( java.net.HttpURLConnection conn) {
conn.addRequestProperty("Referer","https://map.geo.admin.ch/");
conn.addRequestProperty("User-Agent","Mozilla/5.0 (Windows NT 5.1; rv:51.0) Gecko/20100101 Firefox/51.0");
}
Back to top
View user's profile Send private message Visit poster's website
guest



Joined: 08 Oct 2006
Posts: 4855

PostPosted: Thu Oct 04, 2018 6:50 pm    Post subject: Suisse format .bsh Reply with quote

Suisse format .bsh

Code:
name = "SwissTopo";

tileType = "jpg";
tileSize = 256;
minZoom = 6;
maxZoom = 18;
tileUpdate = TileUpdate.IfModifiedSince;
backgroundColor = "#ffffff";
ignoreError = "True";

String getTileUrl( int zoom, int x, int y ) {
if (zoom < 16)
{return "http://wmts10.geo.admin.ch/1.0.0/ch.swisstopo.pixelkarte-farbe/default/current/3857/" + zoom + "/" + x + "/" + y + ".jpeg";}
else
{return "http://wmts10.geo.admin.ch/1.0.0/ch.swisstopo.swissimage/default/current/3857/" + zoom + "/" + x + "/" + y + ".jpeg";}
}

void addHeaders( java.net.HttpURLConnection conn) {
conn.addRequestProperty("Referer","http://www.swisstopo.admin.ch/internet/swisstopo/en/home.html");
conn.addRequestProperty("User-Agent","Mozilla/5.0 (Windows NT 5.1; rv:42.0) Gecko/20100101 Firefox/42.0");
}
Back to top
View user's profile Send private message Visit poster's website
guest



Joined: 08 Oct 2006
Posts: 4855

PostPosted: Mon Oct 08, 2018 10:26 am    Post subject: Reply with quote

Peut-être faut-il mettre à jour le referer de cette dernière carte (qui donne un 404) avec celui de la précédente pour éviter des erreurs dans le futur? (pour l'instant ça a l'air de marcher comme ça)
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    TrekBuddy Forum Index -> Français All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group