Skip to content

Commit

Permalink
Added Galil-Tahton and Hod-Hasharon
Browse files Browse the repository at this point in the history
  • Loading branch information
barak committed Aug 13, 2024
1 parent 73c9378 commit d8438b2
Show file tree
Hide file tree
Showing 6 changed files with 199 additions and 182 deletions.
178 changes: 86 additions & 92 deletions src/common/maps/galil-tahton.data.ts
Original file line number Diff line number Diff line change
@@ -1,92 +1,86 @@
// import * as pimage from "pureimage";
// import { Bitmap } from "pureimage/types/bitmap";
// import { Readable } from "stream";
// import { MapData, UrlResult, UrlUsageType } from "./map.data";
//
// export const mapDataGalilTahton: MapData = {
// name: "Galil Tahton",
//
// urlProvider: async (usageType: UrlUsageType, mapType: string, zoomLevel: number, row: number, col: number): Promise<UrlResult> => {
// const zoomLevelStr = (zoomLevel + 4).toString();
// https://v5.gis-net.co.il/proxy/proxy.ashx?http://10.237.72.71:8080/geoserver/gwc/service/wmts?SERVICE=WMTS&VERSION=1.0.0&REQUEST=GetTile&LAYER=Galil_tachton_SHP:Galil_tachton_Reka&STYLE=raster&FORMAT=image/jpeg&TILEMATRIXSET=Galil_tachton&TILEMATRIX=Galil_tachton:8&TILEROW=110&TILECOL=128
// debugger
// return { url: `https://v5.gis-net.co.il/proxy/proxy.ashx?http://10.237.72.71:8080/geoserver/gwc/service/wmts?SERVICE=WMTS&VERSION=1.0.0&REQUEST=GetTile&LAYER=Galil_tachton_2023:2023&STYLE=raster&FORMAT=image/jpeg&TILEMATRIXSET=Galil_tachton&TILEMATRIX=Galil_tachton:${zoomLevelStr}&TILEROW=${row}&TILECOL=${col}` };
// },
//
// zoomLevelProvider: (zoomLevel: number): string => {
// return (zoomLevel + 4).toString();
// },
//
// zoomFactorProvider: (zoomLevel: number, zoomIn: boolean): number => {
// return 2;
// },
//
// decode: async (mapType: string, buffer: Buffer): Promise<Bitmap> => {
// return pimage.decodeJPEGFromStream(Readable.from(buffer));
// },
//
// supportedMapTypes: ["Satellite"],
//
// showScale: true,
//
// referer: undefined,
//
// zoomLayers: [
// {
// scale: 32000,
// centerTileX: 8,
// centerTileY: 7,
// centerTileOffsetX: 117,
// centerTileOffsetY: 61,
// },
// {
// scale: 16000,
// centerTileX: 16,
// centerTileY: 14,
// centerTileOffsetX: 234,
// centerTileOffsetY: 122,
// },
// {
// scale: 8000,
// centerTileX: 33,
// centerTileY: 28,
// centerTileOffsetX: 213,
// centerTileOffsetY: 247,
// },
// {
// scale: 4000,
// centerTileX: 67,
// centerTileY: 57,
// centerTileOffsetX: 171,
// centerTileOffsetY: 239,
// },
// {
// scale: 2000,
// centerTileX: 135,
// centerTileY: 115,
// centerTileOffsetX: 87,
// centerTileOffsetY: 219,
// },
// {
// scale: 1000,
// centerTileX: 270,
// centerTileY: 231,
// centerTileOffsetX: 179,
// centerTileOffsetY: 190,
// },
// {
// scale: 500,
// centerTileX: 541,
// centerTileY: 463,
// centerTileOffsetX: 108,
// centerTileOffsetY: 129,
// },
// {
// scale: 250,
// centerTileX: 1082,
// centerTileY: 927,
// centerTileOffsetX: 219,
// centerTileOffsetY: 5,
// }
// ],
// };
import { MapData, UrlResult, UrlUsageType } from './map.data'

export const mapDataGalilTahton: MapData = {
name: 'Galil Tahton',

urlProvider: async (_usageType: UrlUsageType, _mapType: string, zoomLevel: number, row: number, col: number): Promise<UrlResult> => {
const zoomLevelStr = (zoomLevel + 4).toString()

return {
url: `https://v5.gis-net.co.il/proxy/proxy.ashx?http://10.237.72.71:8080/geoserver/gwc/service/wmts?SERVICE=WMTS&VERSION=1.0.0&REQUEST=GetTile&LAYER=Galil_tachton_2023:2023&STYLE=raster&FORMAT=image/jpeg&TILEMATRIXSET=Galil_tachton&TILEMATRIX=Galil_tachton:${zoomLevelStr}&TILEROW=${row}&TILECOL=${col}`
}
},

zoomLevelProvider: (zoomLevel: number): string => {
return (zoomLevel + 4).toString()
},

zoomFactorProvider: (_zoomLevel: number, _zoomIn: boolean): number => {
return 2
},

supportedMapTypes: ['Satellite'],

showScale: true,

referer: 'https://v5.gis-net.co.il/v5/GalilTachton',

zoomLayers: [
{
scale: 32000,
centerTileX: 8,
centerTileY: 7,
centerTileOffsetX: 117,
centerTileOffsetY: 61
},
{
scale: 16000,
centerTileX: 16,
centerTileY: 14,
centerTileOffsetX: 234,
centerTileOffsetY: 122
},
{
scale: 8000,
centerTileX: 33,
centerTileY: 28,
centerTileOffsetX: 213,
centerTileOffsetY: 247
},
{
scale: 4000,
centerTileX: 67,
centerTileY: 57,
centerTileOffsetX: 171,
centerTileOffsetY: 239
},
{
scale: 2000,
centerTileX: 135,
centerTileY: 115,
centerTileOffsetX: 87,
centerTileOffsetY: 219
},
{
scale: 1000,
centerTileX: 270,
centerTileY: 231,
centerTileOffsetX: 179,
centerTileOffsetY: 190
},
{
scale: 500,
centerTileX: 541,
centerTileY: 463,
centerTileOffsetX: 108,
centerTileOffsetY: 129
},
{
scale: 250,
centerTileX: 1082,
centerTileY: 927,
centerTileOffsetX: 219,
centerTileOffsetY: 5
}
]
}
167 changes: 81 additions & 86 deletions src/common/maps/hod-hasharon.data.ts
Original file line number Diff line number Diff line change
@@ -1,86 +1,81 @@
// import * as pimage from "pureimage";
// import { Bitmap } from "pureimage/types/bitmap";
// import { Readable } from "stream";
// import { MapData, UrlResult, UrlUsageType } from "./map.data";
//
// export const mapDataHodHasharon: MapData = {
// name: "Hod Hasharon",
//
// urlProvider: async (usageType: UrlUsageType, mapType: string, zoomLevel: number, row: number, col: number): Promise<UrlResult> => {
// let zoomLevelStr = (zoomLevel + 3).toString();
// const rowStr = row.toString();
// const colStr = col.toString();
// const mapTypeStr = mapType === "Satellite" ? "Hod_Hasharon_2022:2022" : "Hod_Hasharon_SHP:Hod_Hasharon_Reka";
// return { url: `https://v5.gis-net.co.il/proxy/proxy.ashx?http://10.237.72.70:8080/geoserver/gwc/service/wmts?SERVICE=WMTS&VERSION=1.0.0&REQUEST=GetTile&LAYER=${mapTypeStr}&STYLE=raster&FORMAT=image/jpeg&TILEMATRIXSET=Hod_Hasharon&TILEMATRIX=Hod_Hasharon:${zoomLevelStr}&TILEROW=${rowStr}&TILECOL=${colStr}` };
// },
//
// zoomLevelProvider: (zoomLevel: number): string => {
// return zoomLevel.toString();
// },
//
// zoomFactorProvider: (zoomLevel: number, zoomIn: boolean): number => {
// return 2;
// },
//
// decode: async (mapType: string, buffer: Buffer): Promise<Bitmap> => {
// return await pimage.decodeJPEGFromStream(Readable.from(buffer));
// },
//
// supportedMapTypes: ["Satellite", "Street & Buildings"],
//
// showScale: true,
//
// referer: undefined,
//
// zoomLayers: [
// {
// scale: 16000,
// centerTileX: 3,
// centerTileY: 4,
// centerTileOffsetX: 221,
// centerTileOffsetY: 216,
// },
// {
// scale: 8000,
// centerTileX: 7,
// centerTileY: 9,
// centerTileOffsetX: 184,
// centerTileOffsetY: 176,
// },
// {
// scale: 4000,
// centerTileX: 15,
// centerTileY: 19,
// centerTileOffsetX: 111,
// centerTileOffsetY: 96,
// },
// {
// scale: 2000,
// centerTileX: 30,
// centerTileY: 38,
// centerTileOffsetX: 223,
// centerTileOffsetY: 192,
// },
// {
// scale: 1000,
// centerTileX: 61,
// centerTileY: 77,
// centerTileOffsetX: 193,
// centerTileOffsetY: 129,
// },
// {
// scale: 500,
// centerTileX: 123,
// centerTileY: 155,
// centerTileOffsetX: 130,
// centerTileOffsetY: 3,
// },
// {
// scale: 250,
// centerTileX: 247,
// centerTileY: 310,
// centerTileOffsetX: 4,
// centerTileOffsetY: 6,
// },
// ],
// };
import { MapData, UrlResult, UrlUsageType } from './map.data'

export const mapDataHodHasharon: MapData = {
name: 'Hod Hasharon',

urlProvider: async (_usageType: UrlUsageType, mapType: string, zoomLevel: number, row: number, col: number): Promise<UrlResult> => {
const zoomLevelStr = (zoomLevel + 3).toString()
const rowStr = row.toString()
const colStr = col.toString()
const mapTypeStr = mapType === 'Satellite' ? 'Hod_Hasharon_2022:2022' : 'Hod_Hasharon_SHP:Hod_Hasharon_Reka'
return {
url: `https://v5.gis-net.co.il/proxy/proxy.ashx?http://10.237.72.70:8080/geoserver/gwc/service/wmts?SERVICE=WMTS&VERSION=1.0.0&REQUEST=GetTile&LAYER=${mapTypeStr}&STYLE=raster&FORMAT=image/jpeg&TILEMATRIXSET=Hod_Hasharon&TILEMATRIX=Hod_Hasharon:${zoomLevelStr}&TILEROW=${rowStr}&TILECOL=${colStr}`
}
},

zoomLevelProvider: (zoomLevel: number): string => {
return zoomLevel.toString()
},

zoomFactorProvider: (_zoomLevel: number, _zoomIn: boolean): number => {
return 2
},

supportedMapTypes: ['Satellite', 'Street & Buildings'],

showScale: true,

referer: 'https://v5.gis-net.co.il/v5/Hod_Hasharon',

zoomLayers: [
{
scale: 16000,
centerTileX: 3,
centerTileY: 4,
centerTileOffsetX: 221,
centerTileOffsetY: 216
},
{
scale: 8000,
centerTileX: 7,
centerTileY: 9,
centerTileOffsetX: 184,
centerTileOffsetY: 176
},
{
scale: 4000,
centerTileX: 15,
centerTileY: 19,
centerTileOffsetX: 111,
centerTileOffsetY: 96
},
{
scale: 2000,
centerTileX: 30,
centerTileY: 38,
centerTileOffsetX: 223,
centerTileOffsetY: 192
},
{
scale: 1000,
centerTileX: 61,
centerTileY: 77,
centerTileOffsetX: 193,
centerTileOffsetY: 129
},
{
scale: 500,
centerTileX: 123,
centerTileY: 155,
centerTileOffsetX: 130,
centerTileOffsetY: 3
},
{
scale: 250,
centerTileX: 247,
centerTileY: 310,
centerTileOffsetX: 4,
centerTileOffsetY: 6
}
]
}
6 changes: 4 additions & 2 deletions src/common/maps/map.data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import { mapDataGovMap } from './govmap.data'
import { mapDataTelAviv } from './tel-aviv.data'
import { mapDataHaifa } from './haifa.data'
import { mapDataNetanya } from './netanya.data'
import { mapDataGalilTahton } from './galil-tahton.data'
import { mapDataHodHasharon } from './hod-hasharon.data'

export type ZoomLayer = {
readonly scale: number
Expand Down Expand Up @@ -35,10 +37,10 @@ export type MapData = {

export const maps = [
mapDataGovMap,
// mapDataGalilTahton,
mapDataGalilTahton,
mapDataTelAviv,
mapDataHaifa,
// mapDataHodHasharon,
mapDataHodHasharon,
mapDataNetanya,
// mapDataMapy
]
12 changes: 12 additions & 0 deletions src/main/maps/galil-tahton.backend.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import * as pimage from 'pureimage'
import { Bitmap } from 'pureimage'
import { Readable } from 'stream'
import { MapBackendData } from './map-backend'

export const mapBackendGalilTahton: MapBackendData = {
name: 'Galil Tahton',

decode: async (_mapType: string, buffer: Buffer): Promise<Bitmap> => {
return pimage.decodeJPEGFromStream(Readable.from(buffer))
}
}
12 changes: 12 additions & 0 deletions src/main/maps/hod-hasharon.backend.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import * as pimage from 'pureimage'
import { Bitmap } from 'pureimage'
import { Readable } from 'stream'
import { MapBackendData } from './map-backend'

export const mapBackendHodHasharon: MapBackendData = {
name: 'Hod Hasharon',

decode: async (_mapType: string, buffer: Buffer): Promise<Bitmap> => {
return await pimage.decodeJPEGFromStream(Readable.from(buffer))
}
}
Loading

0 comments on commit d8438b2

Please sign in to comment.