mirror of
https://github.com/gpxstudio/gpx.studio.git
synced 2026-11-30 09:34:29 +00:00
more national imagery
This commit is contained in:
1 parent
9372df1c61
commit
3ac084be65
5 files changed
+60
-1
No files matched your search
@@ -82,6 +82,27 @@ describe('planTile', () => {
|
|||||||
parts: ['BE:partial', 'NL:partial'],
|
parts: ['BE:partial', 'NL:partial'],
|
||||||
fallback: false,
|
fallback: false,
|
||||||
});
|
});
|
||||||
|
// Elvas and Badajoz, on the border of Portugal and Spain
|
||||||
|
assert.deepEqual(await plan([13, 3935, 3135], tiles), {
|
||||||
|
parts: ['ES:partial', 'PT:partial'],
|
||||||
|
fallback: false,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
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'],
|
||||||
|
fallback: true,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
it('leaves the islands of Portugal to the fallback', async () => {
|
||||||
|
const { asked, tiles } = savedTiles();
|
||||||
|
// Funchal, on Madeira
|
||||||
|
assert.deepEqual(await plan(tile(-16.91, 32.65, 15), tiles), { parts: [], fallback: true });
|
||||||
|
assert.deepEqual(asked, []);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('asks for a tile of the countries once for all the tiles of imagery inside it', async () => {
|
it('asks for a tile of the countries once for all the tiles of imagery inside it', async () => {
|
||||||
|
|||||||
@@ -29,6 +29,25 @@ const xyz =
|
|||||||
(z, x, y) =>
|
(z, x, y) =>
|
||||||
template.replace('{z}', String(z)).replace('{x}', String(x)).replace('{y}', String(y));
|
template.replace('{z}', String(z)).replace('{x}', String(x)).replace('{y}', String(y));
|
||||||
|
|
||||||
|
/**
|
||||||
|
* For a WMS: the tile as an image of its bounds in Web Mercator. A WMS that draws nothing below
|
||||||
|
* the scale of zoom `minzoom` is asked for a larger image there, at that scale.
|
||||||
|
*/
|
||||||
|
const wms =
|
||||||
|
(base: string, minzoom = 0): TileUrl =>
|
||||||
|
(z, x, y) => {
|
||||||
|
const half = 20037508.342789244;
|
||||||
|
const size = (2 * half) / 2 ** z;
|
||||||
|
const pixels = 256 * 2 ** Math.max(0, minzoom - z);
|
||||||
|
const bbox = [
|
||||||
|
x * size - half,
|
||||||
|
half - (y + 1) * size,
|
||||||
|
(x + 1) * size - half,
|
||||||
|
half - y * size,
|
||||||
|
];
|
||||||
|
return `${base}&SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&STYLES=&CRS=EPSG:3857&WIDTH=${pixels}&HEIGHT=${pixels}&BBOX=${bbox.join(',')}`;
|
||||||
|
};
|
||||||
|
|
||||||
const ignOrthophotos = xyz(
|
const ignOrthophotos = xyz(
|
||||||
'https://data.geopf.fr/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=ORTHOIMAGERY.ORTHOPHOTOS&STYLE=normal&FORMAT=image/jpeg&TILEMATRIXSET=PM&TILEMATRIX={z}&TILECOL={x}&TILEROW={y}'
|
'https://data.geopf.fr/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=ORTHOIMAGERY.ORTHOPHOTOS&STYLE=normal&FORMAT=image/jpeg&TILEMATRIXSET=PM&TILEMATRIX={z}&TILECOL={x}&TILEROW={y}'
|
||||||
);
|
);
|
||||||
@@ -102,6 +121,23 @@ const sources: ImagerySource[] = [
|
|||||||
),
|
),
|
||||||
maxzoom: 19,
|
maxzoom: 19,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
// mainland Portugal only, as in the tileset of the countries
|
||||||
|
id: 'PT',
|
||||||
|
url: wms(
|
||||||
|
'https://cartografia.dgterritorio.gov.pt/wms/ortos2025?LAYERS=Ortos2025-RGB&FORMAT=image/jpeg',
|
||||||
|
// blank at zoom 13
|
||||||
|
14
|
||||||
|
),
|
||||||
|
maxzoom: 19,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 'DK',
|
||||||
|
url: xyz(
|
||||||
|
'https://wmts.datafordeler.dk/GeoDanmarkOrto/orto_foraar_webm/1.0.0/WMTS/orto_foraar_webm/default/DFD_GoogleMapsCompatible/{z}/{y}/{x}.jpg?apikey=pDSRuC5YLFT3jHf4XbaWDGSa9Td4TfYiGiB7YfhCKikJhZE6xibJAlaNp1KpDAzHdDss9DSKdq3nNoT2UFU3cmecaLrcRNTOc'
|
||||||
|
),
|
||||||
|
maxzoom: 20,
|
||||||
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
export const openSatelliteAttribution = [
|
export const openSatelliteAttribution = [
|
||||||
@@ -114,6 +150,8 @@ export const openSatelliteAttribution = [
|
|||||||
'<a href="https://cuzk.gov.cz/" target="_blank">ČÚZK</a>',
|
'<a href="https://cuzk.gov.cz/" target="_blank">ČÚZK</a>',
|
||||||
'<a href="https://www.ngi.be/" target="_blank">NGI/IGN</a>',
|
'<a href="https://www.ngi.be/" target="_blank">NGI/IGN</a>',
|
||||||
'<a href="https://www.geoportal.gov.pl/" target="_blank">GUGiK</a>',
|
'<a href="https://www.geoportal.gov.pl/" target="_blank">GUGiK</a>',
|
||||||
|
'<a href="https://www.dgterritorio.gov.pt/" target="_blank">DGT</a>',
|
||||||
|
'GeoDanmark © <a href="https://klimadatastyrelsen.dk/" target="_blank">Klimadatastyrelsen</a>',
|
||||||
].join(', ');
|
].join(', ');
|
||||||
|
|
||||||
// Countries, from the tileset of their polygons, built from the borders of OpenStreetMap
|
// Countries, from the tileset of their polygons, built from the borders of OpenStreetMap
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
{"zoom":10,"tiles":[332328,332329,332330,332331,332332,332333,332334,332335,332336,332337,332338,332339,332340,332341,332342,332343,332344,332345,332346,332347,332348,332349,332350,332351,332352,332353,332354,332355,332356,333352,333353,333354,333355,333356,333357,333358,333359,333360,333361,333362,333363,333364,333365,333366,333367,333368,333369,333370,333371,333372,333373,333374,333375,333376,333377,333378,333379,333380,334376,334377,334378,334379,334380,334381,334382,334383,334384,334385,334386,334387,334388,334389,334390,334391,334392,334393,334394,334395,334396,334397,334398,334399,334400,334401,334402,334403,334404,335400,335401,335402,335403,335404,335405,335406,335407,335408,335409,335410,335411,335412,335413,335414,335415,335416,335417,335418,335419,335420,335421,335422,335423,335424,335425,335426,335427,335428,336424,336425,336426,336427,336428,336429,336430,336431,336432,336433,336434,336435,336436,336437,336438,336439,336440,336441,336442,336443,336444,336445,336446,336447,336448,336449,336450,336451,336452,337448,337449,337450,337451,337452,337453,337454,337455,337456,337457,337458,337459,337460,337461,337462,337463,337464,337465,337466,337467,337468,337469,337470,337471,337472,337473,337474,337475,337476,338450,338472,338473,338474,338475,338476,338477,338478,338479,338480,338481,338482,338483,338484,338485,338486,338487,338488,338489,338490,338491,338492,338493,338494,338495,338496,338497,338498,338499,338500,339465,339466,339467,339468,339469,339470,339471,339472,339473,339474,339475,339476,339496,339497,339498,339499,339500,339501,339502,339503,339504,339505,339506,339507,339508,339509,339510,339511,339512,339513,339514,339515,339516,339517,339518,339519,339520,339521,339522,339523,339524,340489,340490,340491,340492,340493,340494,340495,340496,340497,340498,340499,340500,340520,340521,340522,340523,340524,340525,340526,340527,340528,340529,340530,340531,340532,340533,340534,340535,340536,340537,340538,340539,340540,340541,340542,340543,340544,340545,340546,340547,340548,341513,341514,341515,341516,341517,341518,341519,341520,341521,341522,341523,341524,341544,341545,341546,341547,341548,341549,341550,341551,341552,341553,341554,341555,341556,341557,341558,341559,341560,341561,341562,341563,341564,341565,341566,341567,341568,341569,341570,341571,341572,342537,342538,342539,342540,342541,342542,342543,342544,342545,342546,342547,342548,342568,342569,342570,342571,342572,342573,342574,342575,342576,342577,342578,342579,342580,342581,342582,342583,342584,342585,342586,342587,342588,342589,342590,342591,342592,342593,342594,342595,342596,343561,343562,343563,343564,343565,343566,343567,343568,343569,343570,343571,343572,343592,343593,343594,343595,343596,343597,343598,343599,343600,343601,343602,343603,343604,343605,343606,343607,343608,343609,343610,343611,343612,343613,343614,343615,343616,343617,343618,343619,343620,344585,344586,344587,344588,344589,344590,344591,344592,344593,344594,344595,344596,344616,344617,344618,344619,344620,344621,344622,344623,344624,344625,344626,344627,344628,344629,344630,344631,344632,344633,344634,344635,344636,344637,344638,344639,344640,344641,344642,344643,344644,345609,345610,345611,345612,345613,345614,345615,345616,345617,345618,345619,345620,345640,345641,345642,345643,345644,345645,345646,345647,345648,345649,345650,345651,345652,345653,345654,345655,345656,345657,345658,345659,345660,345661,345662,345663,345664,345665,345666,345667,345668,346633,346634,346635,346636,346637,346638,346639,346640,346641,346642,346643,346644,346664,346665,346666,346667,346668,346669,346670,346671,346672,346673,346674,346675,346676,346677,346678,346679,346680,346681,346682,346683,346684,346685,346686,346687,346688,346689,346690,346691,346692,347657,347658,347659,347660,347661,347662,347663,347664,347665,347666,347667,347668,347688,347689,347690,347691,347692,347693,347694,347695,347696,347697,347698,347699,347700,347701,347702,347703,347704,347705,347706,347707,347708,347709,347710,347711,347712,347713,347714,347715,347716,348679,348680,348681,348682,348683,348684,348685,348686,348687,348688,348689,348690,348691,348692,348712,348713,348714,348715,348716,348717,348718,348719,348720,348721,348722,348723,348724,348725,348726,348727,348728,348729,348730,348731,348732,348733,348734,348735,348736,348737,348738,348739,348740,349703,349704,349705,349706,349707,349708,349709,349710,349711,349712,349713,349714,349715,349716,349736,349737,349738,349739,349740,349741,349742,349743,349744,349745,349746,349747,349748,349749,349750,349751,349752,349753,349754,349755,349756,349757,349758,349759,349760,349761,349762,349763,349764,350706,350707,350708,350709,350710,350711,350712,350713,350714,350715,350716,350717,350718,350719,350720,350721,350722,350723,350724,350725,350726,350727,350728,350729,350730,350731,350732,350733,350734,350735,350736,350737,350738,350739,350740,350741,350742,350743,350754,350755,350756,350757,350758,350759,350760,350761,350762,350763,350764,350765,350766,350767,35Line truncated
|
{"zoom":10,"tiles":[316951,316952,316953,316954,316955,316956,316957,316958,317975,317976,317977,317978,317979,317980,317981,317982,318999,319000,319001,319002,319003,319004,319005,319006,319007,320023,320024,320025,320026,320027,320028,320029,320030,320031,321046,321047,321048,321049,321050,321051,321052,321053,321054,321055,322070,322071,322072,322073,322074,322075,322076,322077,322078,322079,323094,323095,323096,323097,323098,323099,323100,323101,323102,323103,323104,323105,324118,324119,324120,324121,324122,324123,324124,324125,324126,324127,325142,325143,325144,325145,325146,325147,325148,325149,325150,325151,325153,326166,326167,326168,326169,326170,326171,326172,326173,326174,326175,326176,326177,326178,326179,327190,327191,327192,327193,327194,327195,327196,327197,327198,327199,327200,327201,327202,327203,328214,328215,328216,328217,328218,328219,328220,328221,328222,328223,328224,328225,328226,328227,328228,329238,329239,329240,329241,329242,329243,329244,329245,329246,329247,329248,329249,329250,329251,329252,330262,330263,330264,330265,330266,330267,330268,330269,330270,330271,330272,330273,330274,330275,330281,330282,330283,331286,331287,331288,331289,331290,331291,331292,331293,331294,331295,331296,331297,331298,331299,331305,331306,331307,332310,332311,332312,332313,332314,332315,332316,332317,332318,332319,332320,332321,332322,332323,332328,332329,332330,332331,332332,332333,332334,332335,332336,332337,332338,332339,332340,332341,332342,332343,332344,332345,332346,332347,332348,332349,332350,332351,332352,332353,332354,332355,332356,333342,333343,333344,333345,333346,333352,333353,333354,333355,333356,333357,333358,333359,333360,333361,333362,333363,333364,333365,333366,333367,333368,333369,333370,333371,333372,333373,333374,333375,333376,333377,333378,333379,333380,334369,334370,334376,334377,334378,334379,334380,334381,334382,334383,334384,334385,334386,334387,334388,334389,334390,334391,334392,334393,334394,334395,334396,334397,334398,334399,334400,334401,334402,334403,334404,335400,335401,335402,335403,335404,335405,335406,335407,335408,335409,335410,335411,335412,335413,335414,335415,335416,335417,335418,335419,335420,335421,335422,335423,335424,335425,335426,335427,335428,336424,336425,336426,336427,336428,336429,336430,336431,336432,336433,336434,336435,336436,336437,336438,336439,336440,336441,336442,336443,336444,336445,336446,336447,336448,336449,336450,336451,336452,337448,337449,337450,337451,337452,337453,337454,337455,337456,337457,337458,337459,337460,337461,337462,337463,337464,337465,337466,337467,337468,337469,337470,337471,337472,337473,337474,337475,337476,338450,338472,338473,338474,338475,338476,338477,338478,338479,338480,338481,338482,338483,338484,338485,338486,338487,338488,338489,338490,338491,338492,338493,338494,338495,338496,338497,338498,338499,338500,339465,339466,339467,339468,339469,339470,339471,339472,339473,339474,339475,339476,339496,339497,339498,339499,339500,339501,339502,339503,339504,339505,339506,339507,339508,339509,339510,339511,339512,339513,339514,339515,339516,339517,339518,339519,339520,339521,339522,339523,339524,340489,340490,340491,340492,340493,340494,340495,340496,340497,340498,340499,340500,340520,340521,340522,340523,340524,340525,340526,340527,340528,340529,340530,340531,340532,340533,340534,340535,340536,340537,340538,340539,340540,340541,340542,340543,340544,340545,340546,340547,340548,341513,341514,341515,341516,341517,341518,341519,341520,341521,341522,341523,341524,341544,341545,341546,341547,341548,341549,341550,341551,341552,341553,341554,341555,341556,341557,341558,341559,341560,341561,341562,341563,341564,341565,341566,341567,341568,341569,341570,341571,341572,342537,342538,342539,342540,342541,342542,342543,342544,342545,342546,342547,342548,342568,342569,342570,342571,342572,342573,342574,342575,342576,342577,342578,342579,342580,342581,342582,342583,342584,342585,342586,342587,342588,342589,342590,342591,342592,342593,342594,342595,342596,343561,343562,343563,343564,343565,343566,343567,343568,343569,343570,343571,343572,343592,343593,343594,343595,343596,343597,343598,343599,343600,343601,343602,343603,343604,343605,343606,343607,343608,343609,343610,343611,343612,343613,343614,343615,343616,343617,343618,343619,343620,344585,344586,344587,344588,344589,344590,344591,344592,344593,344594,344595,344596,344616,344617,344618,344619,344620,344621,344622,344623,344624,344625,344626,344627,344628,344629,344630,344631,344632,344633,344634,344635,344636,344637,344638,344639,344640,344641,344642,344643,344644,345609,345610,345611,345612,345613,345614,345615,345616,345617,345618,345619,345620,345640,345641,345642,345643,345644,345645,345646,345647,345648,345649,345650,345651,345652,345653,345654,345655,345656,345657,345658,345659,345660,345661,345662,345663,345664,345665,345666,345667,345668,346633,346634,346635,346636,346637,346638,346639,346640,346641,346642,346643,346644,346664,346665,346666,346667,346668,346669,346670,346671,34Line truncated
|
||||||
Binary file not shown.
Binary file not shown.
Reference in new issue
Block a user