Skip to content
Snippets Groups Projects
Commit b4770085 authored by Olivier Maury's avatar Olivier Maury
Browse files

Migrer les couches IGN vers Géoplateforme. fixes #9919

parent 98c98175
No related branches found
No related tags found
No related merge requests found
......@@ -56,7 +56,7 @@ import ol.tilegrid.WmtsTileGridOptions;
/**
* Helper methods to construct various tiles for OpenLayers.
*
* Service list for IGN : https://geoservices.ign.fr/documentation/services
* Service list for IGN : https://geoservices.ign.fr/services-geoplateforme
*
* @author Olivier Maury
* @author Louis Tromel
......@@ -67,7 +67,6 @@ public abstract class TileSuppliers {
* Base infos to create an IGN layer.
*
* @author ltromel
*
*/
private static class IgnWmtsLayer {
......@@ -92,7 +91,7 @@ public abstract class TileSuppliers {
private String style = "normal";
/**
* Layer name displayed in tempo.
* Layer name displayed on map.
*/
private String title;
......@@ -101,11 +100,6 @@ public abstract class TileSuppliers {
*/
private String type = "base";
/**
* URL requested (contains the key).
*/
private String url;
/**
* @return the attributions
*/
......@@ -148,13 +142,6 @@ public abstract class TileSuppliers {
return type;
}
/**
* @return the url
*/
String getUrl() {
return url;
}
/**
* @param values the attributions to set
*/
......@@ -197,15 +184,13 @@ public abstract class TileSuppliers {
type = layerType;
}
/**
* @param layerUrl the url to set
*/
void setUrl(final String layerUrl) {
url = layerUrl;
}
}
/**
* Attributions attribute.
*/
private static final String ATTRIBUTIONS = "layer-attributions";
/**
* I18n constants.
*/
......@@ -226,10 +211,9 @@ public abstract class TileSuppliers {
*/
public static Base createIgnAdministrativeLimits() {
final IgnWmtsLayer wmts = new IgnWmtsLayer();
wmts.setLayer("ADMINEXPRESS-COG-CARTO.LATEST");
wmts.setLayer("ADMINEXPRESS-COG.LATEST");
wmts.setTitle(CSTS.ignAdministrativeLimits());
wmts.setType("");
wmts.setUrl("https://wxs.ign.fr/administratif/geoportail/wmts");
wmts.setAttributions(" - " + CSTS.ignOverlayAttributions());
return createIgnWmtsLayer(wmts);
}
......@@ -243,7 +227,6 @@ public abstract class TileSuppliers {
wmts.setTitle(CSTS.ignAerial());
wmts.setAttributions(CSTS.ignAerialAttributions());
wmts.setFormat("image/jpeg");
wmts.setUrl("https://wxs.ign.fr/ortho/geoportail/wmts");
return createIgnWmtsLayer(wmts);
}
......@@ -254,7 +237,6 @@ public abstract class TileSuppliers {
wmts.setAttributions(" - " + CSTS.ignOverlayAttributions());
wmts.setType("");
wmts.setStyle("normal");
wmts.setUrl("https://wxs.ign.fr/agriculture/geoportail/wmts");
return createIgnWmtsLayer(wmts);
}
......@@ -266,7 +248,6 @@ public abstract class TileSuppliers {
wmts.setLayer("GEOGRAPHICALGRIDSYSTEMS.PLANIGNV2");
wmts.setTitle(CSTS.ignInternationalMap());
wmts.setAttributions(CSTS.ignInternationalMapAttributions());
wmts.setUrl("https://wxs.ign.fr/cartes/geoportail/wmts");
return createIgnWmtsLayer(wmts);
}
......@@ -277,12 +258,11 @@ public abstract class TileSuppliers {
wmts.setAttributions(" - " + CSTS.ignOverlayAttributions());
wmts.setType("");
wmts.setStyle("estompage_grayscale");
wmts.setUrl("https://wxs.ign.fr/altimetrie/geoportail/wmts");
return createIgnWmtsLayer(wmts);
}
/**
* See https://geoservices.ign.fr/services-web-decouverte .
* See https://geoservices.ign.fr/services-geoplateforme-diffusion .
*
* @param wmts basic caracteristics to generate an IGN served layer
* @return base layer
......@@ -290,7 +270,7 @@ public abstract class TileSuppliers {
private static Base createIgnWmtsLayer(final IgnWmtsLayer wmts) {
final Projection projection = Projection.get("EPSG:3857");
final WmtsOptions wmtsOptions = OLFactory.createOptions();
wmtsOptions.setUrl(wmts.getUrl());
wmtsOptions.setUrl("https://data.geopf.fr/wmts");
wmtsOptions.setLayer(wmts.getLayer());
wmtsOptions.setFormat(wmts.getFormat());
wmtsOptions.setMatrixSet("PM");
......@@ -309,6 +289,7 @@ public abstract class TileSuppliers {
wmtsLayer.set(TITLE, wmts.getTitle());
wmtsLayer.set(TYPE, wmts.getType());
wmtsLayer.setVisible(false);
wmtsLayer.set(ATTRIBUTIONS, wmts.getAttributions());
return wmtsLayer;
}
......@@ -320,6 +301,7 @@ public abstract class TileSuppliers {
layer.set(TITLE, CSTS.mapBaseLayerEmpty());
layer.set(TYPE, "base");
layer.setVisible(false);
layer.set(ATTRIBUTIONS, "-");
return layer;
}
......@@ -337,6 +319,7 @@ public abstract class TileSuppliers {
tile.set(TITLE, "OpenTopoMap");
tile.set(TYPE, "base");
tile.setVisible(false);
tile.set(ATTRIBUTIONS, options.getAttributions());
return tile;
}
......@@ -359,6 +342,7 @@ public abstract class TileSuppliers {
final Tile osmLayer = new Tile(osmLayerOptions);
osmLayer.set(TITLE, "OpenStreetMap");
osmLayer.set(TYPE, "base");
osmLayer.set(ATTRIBUTIONS, options.getAttributions());
return osmLayer;
}
......@@ -380,6 +364,7 @@ public abstract class TileSuppliers {
tile.set(TITLE, "OpenStreetMap Piano");
tile.set(TYPE, "base");
tile.setVisible(false);
tile.set(ATTRIBUTIONS, options.getAttributions());
return tile;
}
......@@ -418,4 +403,4 @@ public abstract class TileSuppliers {
private TileSuppliers() {
}
}
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment