mirror of
https://github.com/gpxstudio/gpx.studio.git
synced 2026-12-06 10:34:13 +00:00
regional sources for germany
This commit is contained in:
1 parent
12c4d3c594
commit
cc97f03e29
5 files changed
+152
-8
No files matched your search
@@ -61,12 +61,12 @@ describe('planTile', () => {
|
||||
|
||||
it('puts the countries of a border tile together, over the fallback where none is', async () => {
|
||||
const { tiles } = savedTiles();
|
||||
// Basel: France, Switzerland and Germany, which is not in the patchwork
|
||||
// Basel: France, Switzerland and Baden-Württemberg, which is not in the patchwork
|
||||
assert.deepEqual(await plan([13, 4268, 2861], tiles), {
|
||||
parts: ['CH:partial', 'FR:partial'],
|
||||
fallback: true,
|
||||
});
|
||||
// only Germany
|
||||
// only Baden-Württemberg
|
||||
assert.deepEqual(await plan([13, 4269, 2860], tiles), { parts: [], fallback: true });
|
||||
});
|
||||
|
||||
@@ -91,13 +91,27 @@ describe('planTile', () => {
|
||||
|
||||
it('takes a country from its agency next to one without open imagery', async () => {
|
||||
const { tiles } = savedTiles();
|
||||
// Padborg, with Germany to the south
|
||||
assert.deepEqual(await plan([13, 4309, 2597], tiles), {
|
||||
parts: ['DK:partial'],
|
||||
// Ulm, in Baden-Württemberg, and Neu-Ulm, in Bavaria
|
||||
assert.deepEqual(await plan(tile(9.99, 48.39, 13), tiles), {
|
||||
parts: ['DE-BY:partial'],
|
||||
fallback: true,
|
||||
});
|
||||
});
|
||||
|
||||
it('takes the states of Germany from their own agencies', async () => {
|
||||
const { tiles } = savedTiles();
|
||||
// Neu-Ulm
|
||||
assert.deepEqual(await plan(tile(10.01, 48.38, 16), tiles), {
|
||||
parts: ['DE-BY:full'],
|
||||
fallback: false,
|
||||
});
|
||||
// Padborg, with Schleswig-Holstein to the south
|
||||
assert.deepEqual(await plan([13, 4309, 2597], tiles), {
|
||||
parts: ['DE-SH:partial', 'DK:partial'],
|
||||
fallback: false,
|
||||
});
|
||||
});
|
||||
|
||||
it('leaves the islands of Portugal to the fallback', async () => {
|
||||
const { asked, tiles } = savedTiles();
|
||||
// Funchal, on Madeira
|
||||
|
||||
@@ -17,11 +17,16 @@ export const OPEN_SATELLITE_PROTOCOL = 'opensat';
|
||||
type TileUrl = (z: number, x: number, y: number) => string;
|
||||
|
||||
type ImagerySource = {
|
||||
/** ISO code of the country, in the tileset of the countries */
|
||||
/** ISO code of the country, or of its state, in the tileset of the countries */
|
||||
id: string;
|
||||
url: TileUrl;
|
||||
/** Above it, the tile of this zoom level is scaled up. */
|
||||
maxzoom: number;
|
||||
/**
|
||||
* Its server only answers pages on https: elsewhere, such as in the desktop app, the country
|
||||
* is left to the fallback.
|
||||
*/
|
||||
httpsOnly?: boolean;
|
||||
};
|
||||
|
||||
const xyz =
|
||||
@@ -145,6 +150,113 @@ const sources: ImagerySource[] = [
|
||||
),
|
||||
maxzoom: 20,
|
||||
},
|
||||
// Germany, by state: Baden-Württemberg is left to the fallback, its services often give blank
|
||||
// tiles
|
||||
{
|
||||
id: 'DE-BY',
|
||||
url: xyz('https://wmtsod1.bayernwolke.de/wmts/by_dop/smerc/{z}/{x}/{y}'),
|
||||
maxzoom: 19,
|
||||
},
|
||||
{
|
||||
id: 'DE-MV',
|
||||
// its tile matrices are numbered from zoom 5
|
||||
url: (z, x, y) =>
|
||||
`https://www.geodaten-mv.de/dienste/dop_wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=mv_dop&STYLE=default&FORMAT=image/png&TILEMATRIXSET=GoogleMapsCompatible&TILEMATRIX=${String(z - 5).padStart(2, '0')}&TILEROW=${y}&TILECOL=${x}`,
|
||||
maxzoom: 19,
|
||||
},
|
||||
{
|
||||
id: 'DE-BB',
|
||||
url: wms(
|
||||
'https://isk.geobasis-bb.de/mapproxy/dop20c/service/wms?LAYERS=bebb_dop20c&FORMAT=image/jpeg'
|
||||
),
|
||||
maxzoom: 19,
|
||||
},
|
||||
{
|
||||
// the service of Brandenburg, which has Berlin too
|
||||
id: 'DE-BE',
|
||||
url: wms(
|
||||
'https://isk.geobasis-bb.de/mapproxy/dop20c/service/wms?LAYERS=bebb_dop20c&FORMAT=image/jpeg'
|
||||
),
|
||||
maxzoom: 19,
|
||||
},
|
||||
{
|
||||
// Bremen and Bremerhaven
|
||||
id: 'DE-HB',
|
||||
url: wms(
|
||||
'https://geodienste.bremen.de/wms_dop_lb?LAYERS=dop10_2025_HB,dop10_2025_BHV&FORMAT=image/jpeg'
|
||||
),
|
||||
maxzoom: 19,
|
||||
},
|
||||
{
|
||||
// without its islands in the North Sea, as in the tileset of the countries
|
||||
id: 'DE-HH',
|
||||
url: wms(
|
||||
'https://geodienste.hamburg.de/wms_dop_zeitreihe_unbelaubt?LAYERS=dop_zeitreihe_unbelaubt&FORMAT=image/jpeg'
|
||||
),
|
||||
maxzoom: 19,
|
||||
},
|
||||
{
|
||||
id: 'DE-HE',
|
||||
url: wms(
|
||||
'https://www.gds-srv.hessen.de/cgi-bin/lika-services/ogc-free-images.ows?LAYERS=he_dop_rgb&FORMAT=image/jpeg'
|
||||
),
|
||||
maxzoom: 19,
|
||||
},
|
||||
{
|
||||
id: 'DE-NI',
|
||||
url: wms(
|
||||
'https://opendata.lgln.niedersachsen.de/doorman/noauth/dop_wms?LAYERS=ni_dop20&FORMAT=image/jpeg'
|
||||
),
|
||||
maxzoom: 19,
|
||||
},
|
||||
{
|
||||
id: 'DE-NW',
|
||||
url: wms('https://www.wms.nrw.de/geobasis/wms_nw_dop?LAYERS=nw_dop_rgb&FORMAT=image/jpeg'),
|
||||
maxzoom: 19,
|
||||
},
|
||||
{
|
||||
id: 'DE-RP',
|
||||
url: wms(
|
||||
'https://geo4.service24.rlp.de/wms/rp_dop20.fcgi?LAYERS=rp_dop20&FORMAT=image/jpeg'
|
||||
),
|
||||
maxzoom: 19,
|
||||
},
|
||||
{
|
||||
id: 'DE-SL',
|
||||
url: wms(
|
||||
'https://geoportal.saarland.de/freewms/truedop?LAYERS=sl_dop20_rgb&FORMAT=image/jpeg'
|
||||
),
|
||||
maxzoom: 19,
|
||||
},
|
||||
{
|
||||
id: 'DE-SN',
|
||||
url: wms(
|
||||
'https://geodienste.sachsen.de/wms_geosn_dop-rgb/guest?LAYERS=sn_dop_020&FORMAT=image/jpeg'
|
||||
),
|
||||
maxzoom: 19,
|
||||
},
|
||||
{
|
||||
id: 'DE-ST',
|
||||
url: wms(
|
||||
'https://www.geodatenportal.sachsen-anhalt.de/wss/service/ST_LVermGeo_DOP_WMS_OpenData/guest?LAYERS=lsa_lvermgeo_dop20_2&FORMAT=image/jpeg'
|
||||
),
|
||||
maxzoom: 19,
|
||||
},
|
||||
{
|
||||
id: 'DE-SH',
|
||||
url: wms(
|
||||
'https://dienste.gdi-sh.de/WMS_SH_DOP20col_OpenGBD?LAYERS=sh_dop20_rgb&FORMAT=image/jpeg'
|
||||
),
|
||||
maxzoom: 19,
|
||||
httpsOnly: true,
|
||||
},
|
||||
{
|
||||
id: 'DE-TH',
|
||||
url: wms(
|
||||
'https://www.geoproxy.geoportal-th.de/geoproxy/services/DOP?LAYERS=th_dop&FORMAT=image/jpeg'
|
||||
),
|
||||
maxzoom: 19,
|
||||
},
|
||||
];
|
||||
|
||||
export const openSatelliteAttribution = [
|
||||
@@ -160,6 +272,21 @@ export const openSatelliteAttribution = [
|
||||
'<a href="https://www.dgterritorio.gov.pt/" target="_blank">DGT</a>',
|
||||
'GeoDanmark © <a href="https://klimadatastyrelsen.dk/" target="_blank">Klimadatastyrelsen</a>',
|
||||
'© <a href="https://www.linz.govt.nz/linz-copyright" target="_blank">LINZ CC BY 4.0</a> © <a href="https://www.linz.govt.nz/data/linz-data/linz-basemaps/data-attribution" target="_blank">Imagery Basemap contributors</a>',
|
||||
'© <a href="https://geodaten.bayern.de/" target="_blank">Bayerische Vermessungsverwaltung</a>',
|
||||
'© <a href="https://geobasis-bb.de/" target="_blank">GeoBasis-DE/LGB</a>',
|
||||
'© <a href="https://www.berlin.de/sen/sbw/stadtdaten/geoportal/" target="_blank">Geoportal Berlin</a>',
|
||||
'© <a href="https://www.geo.bremen.de/" target="_blank">Landesamt GeoInformation Bremen</a>',
|
||||
'© <a href="https://www.hamburg.de/" target="_blank">LGV Hamburg</a>',
|
||||
'© <a href="https://hvbg.hessen.de/" target="_blank">HVBG</a>',
|
||||
'© <a href="https://www.laiv-mv.de/" target="_blank">GeoBasis-DE/M-V</a>',
|
||||
'© <a href="https://www.lgln.niedersachsen.de/" target="_blank">LGLN</a>',
|
||||
'© <a href="https://www.bezreg-koeln.nrw.de/" target="_blank">Geobasis NRW</a>',
|
||||
'© <a href="https://lvermgeo.rlp.de/" target="_blank">GeoBasis-DE/LVermGeoRP</a>',
|
||||
'© <a href="https://geoportal.saarland.de/" target="_blank">LVGL Saarland</a>',
|
||||
'© <a href="https://www.geosn.sachsen.de/" target="_blank">GeoSN</a>',
|
||||
'© <a href="https://www.lvermgeo.sachsen-anhalt.de/" target="_blank">GeoBasis-DE/LVermGeo LSA</a>',
|
||||
'© <a href="https://www.schleswig-holstein.de/" target="_blank">GeoBasis-DE/LVermGeo SH</a>',
|
||||
'© <a href="https://geoportal.thueringen.de/" target="_blank">GDI-Th</a>',
|
||||
].join(', ');
|
||||
|
||||
// Countries, from the tileset of their polygons, built from the borders of OpenStreetMap
|
||||
@@ -168,7 +295,10 @@ const COUNTRIES_URL = xyz('https://tiles.gpx.studio/satellite-countries/{z}/{x}/
|
||||
/** The only zoom level of the tileset. */
|
||||
const COUNTRIES_ZOOM = 12;
|
||||
|
||||
const sourceByCountry = new Map(sources.map((source) => [source.id, source]));
|
||||
const onHttps = typeof location === 'undefined' || location.protocol === 'https:';
|
||||
const sourceByCountry = new Map(
|
||||
sources.filter((source) => onHttps || !source.httpsOnly).map((source) => [source.id, source])
|
||||
);
|
||||
|
||||
/** The tiles of the countries, from their tileset: null where there is none. */
|
||||
export type CountryTiles = (z: number, x: number, y: number) => Promise<ArrayBuffer | null>;
|
||||
|
||||
Reference in new issue
Block a user