Skip to content

Commit

Permalink
refactor(unitTests): use sinon to mock hidden itowns.Fetcher and add …
Browse files Browse the repository at this point in the history
…json file localy
  • Loading branch information
ftoromanoff authored and Desplandis committed Mar 15, 2024
1 parent 4d21c1e commit 9dcfed3
Show file tree
Hide file tree
Showing 46 changed files with 1,462 additions and 766 deletions.
1 change: 0 additions & 1 deletion src/Process/3dTilesProcessing.js
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,6 @@ export function process3dTilesNode(cullingTest = $3dTilesCulling, subdivisionTes
return undefined;
}


// do proper culling
const isVisible = cullingTest ? (!cullingTest(layer, context.camera, node, node.matrixWorld)) : true;
node.visible = isVisible;
Expand Down
59 changes: 59 additions & 0 deletions test/data/EGM2008_simplified.gdf
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
long_lat_unit degree
latlimit_north 90.000000000000
latlimit_south -90.000000000000
longlimit_west -180.00000000000
longlimit_east 180.00000000000
gridstep 45.000000000000
latitude_parallels 5
longitude_parallels 9
number_of_gridpoints 45
grid_format long_lat_value

longitude latitude geoid
[deg.] [deg.] [meter]
end_of_head ============================================
-180.0000 90.0000 15.303555275629
-135.0000 90.0000 15.303555275629
-90.0000 90.0000 15.303555275629
-45.0000 90.0000 15.303555275629
0.0000 90.0000 15.303555275629
45.0000 90.0000 15.303555275629
90.0000 90.0000 15.303555275629
135.0000 90.0000 15.303555275629
180.0000 90.0000 15.303555275629
-180.0000 45.0000 -5.932658849087
-135.0000 45.0000 -26.975163013039
-90.0000 45.0000 -33.177905776048
-45.0000 45.0000 28.384029129025
0.0000 45.0000 47.171595586227
45.0000 45.0000 1.250168904938
90.0000 45.0000 -57.850806052736
135.0000 45.0000 28.732846840211
180.0000 45.0000 -5.932658849086
-180.0000 0.0000 21.686023009812
-135.0000 0.0000 -6.357450314494
-90.0000 0.0000 -3.655670977408
-45.0000 0.0000 -22.874077173170
0.0000 0.0000 17.630240691122
45.0000 0.0000 -43.169258390344
90.0000 0.0000 -62.880767797666
135.0000 0.0000 73.143720247498
180.0000 0.0000 21.686023009809
-180.0000 -45.0000 3.784451421987
-135.0000 -45.0000 -14.624611735984
-90.0000 -45.0000 -0.474825154979
-45.0000 -45.0000 -3.262856182088
0.0000 -45.0000 21.392469069597
45.0000 -45.0000 46.285391983932
90.0000 -45.0000 8.143232184390
135.0000 -45.0000 -19.858291708014
180.0000 -45.0000 3.784451421987
-180.0000 -90.0000 -29.705396897506
-135.0000 -90.0000 -29.705396897506
-90.0000 -90.0000 -29.705396897506
-45.0000 -90.0000 -29.705396897506
0.0000 -90.0000 -29.705396897506
45.0000 -90.0000 -29.705396897506
90.0000 -90.0000 -29.705396897506
135.0000 -90.0000 -29.705396897506
180.0000 -90.0000 -29.705396897506
48 changes: 48 additions & 0 deletions test/data/OrientedImage/cameraCalibration.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
[
{
"id": 300,
"rotation": [
-0.00205265,
-0.999998,
0.000732591,
0.999997,
-0.00205156,
0.00149035,
-0.00148884,
0.000735648,
0.999999
],
"position": [
-0.000,
-0.145,
0.867
],
"projection": [
1150.66785706630299,
0,
1030.29,
0,
1150.66785706630299,
1024.96,
0,
0,
1
],
"size": [
2048,
2048
],
"distortion": {
"pps": [
1042.178,
1027.565
],
"poly357": [
-1.33791587603751819E-7,
3.47540977328314388E-14,
-4.44103985918888078E-21
],
"limit": 2079
}
}
]
32 changes: 32 additions & 0 deletions test/data/OrientedImage/panoramicsMetaDataParis.geojson
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [
651187.76,
6861379.05,
41.39
]
},
"properties": {
"id": 482,
"easting": 651187.76,
"northing": 6861379.05,
"altitude": 41.39,
"heading": 176.117188,
"roll": 0.126007,
"pitch": 1.280821,
"date": "2014-06-16T12:31:34.841Z"
}
}
],
"crs": {
"type": "EPSG",
"properties": {
"code": 2154
}
}
}
14 changes: 14 additions & 0 deletions test/data/entwine/ept-hierarchy/0-0-0-0.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"0-0-0-0": 65341,
"1-0-0-0": 438,
"2-0-1-0": 322,
"1-0-0-1": 56209,
"2-0-1-2": 4332,
"2-1-1-2": 20300,
"2-1-1-3": 64020,
"3-2-3-6": -1,
"3-3-3-7": -1,
"1-0-1-0": 30390,
"2-1-2-0": 2300,
"1-1-1-1": 2303
}
34 changes: 34 additions & 0 deletions test/data/entwine/ept.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"bounds": [634962.0, 848881.0, -1818.0, 639620.0, 853539.0, 2840.0],
"boundsConforming": [635577.0, 848882.0, 406.0, 639004.0, 853538.0, 616.0],
"dataType": "laszip",
"hierarchyType": "json",
"points": 10653336,
"schema": [
{ "name": "X", "type": "signed", "size": 4, "scale": 0.01, "offset": 637291.0 },
{ "name": "Y", "type": "signed", "size": 4, "scale": 0.01, "offset": 851210.0 },
{ "name": "Z", "type": "signed", "size": 4, "scale": 0.01, "offset": 511.0 },
{ "name": "Intensity", "type": "unsigned", "size": 2 },
{ "name": "ReturnNumber", "type": "unsigned", "size": 1 },
{ "name": "NumberOfReturns", "type": "unsigned", "size": 1 },
{ "name": "ScanDirectionFlag", "type": "unsigned", "size": 1 },
{ "name": "EdgeOfFlightLine", "type": "unsigned", "size": 1 },
{ "name": "Classification", "type": "unsigned", "size": 1 },
{ "name": "ScanAngleRank", "type": "float", "size": 4 },
{ "name": "UserData", "type": "unsigned", "size": 1 },
{ "name": "PointSourceId", "type": "unsigned", "size": 2 },
{ "name": "GpsTime", "type": "float", "size": 8 },
{ "name": "Red", "type": "unsigned", "size": 2 },
{ "name": "Green", "type": "unsigned", "size": 2 },
{ "name": "Blue", "type": "unsigned", "size": 2 },
{ "name": "OriginId", "type": "unsigned", "size": 4 }
],
"span" : 256,
"srs": {
"authority": "EPSG",
"horizontal": "3857",
"vertical": "5703",
"wkt": "PROJCS[\"WGS 84 / Pseudo-Mercator\",GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6326\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]],PROJECTION[\"Mercator_1SP\"],PARAMETER[\"central_meridian\",0],PARAMETER[\"scale_factor\",1],PARAMETER[\"false_easting\",0],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH],EXTENSION[\"PROJ4\",\"+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs\"],AUTHORITY[\"EPSG\",\"3857\"]]"
},
"version" : "1.0.0"
}
52 changes: 52 additions & 0 deletions test/data/filesource/featCollec_Polygone.geojson
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
{
"type": "FeatureCollection",
"name": "departement-09-ariege_simplified",
"features": [
{
"type": "Feature",
"properties": {
"code": "09s",
"nom": "Ariège_simplified"
},
"geometry": {
"type": "Polygon",
"coordinates": [
[
[
0.832209677419342,
42.908846774193506
],
[
1.531306451612893,
43.271943548387057
],
[
1.959435483870959,
43.087685483870928
],
[
2.154532258064508,
42.662266129032218
],
[
1.786016129032249,
42.580975806451569
],
[
0.886403225806439,
42.80858870967738
],
[
0.886403225806439,
42.80858870967738
],
[
0.832209677419342,
42.908846774193506
]
]
]
}
}
]
}
46 changes: 46 additions & 0 deletions test/data/filesource/feat_Polygone.geojson
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{
"type": "Feature",
"properties": {
"code": "09s",
"nom": "Ariège_simplified"
},
"geometry": {
"type": "Polygon",
"coordinates": [
[
[
0.832209677419342,
42.908846774193506
],
[
1.531306451612893,
43.271943548387057
],
[
1.959435483870959,
43.087685483870928
],
[
2.154532258064508,
42.662266129032218
],
[
1.786016129032249,
42.580975806451569
],
[
0.886403225806439,
42.80858870967738
],
[
0.886403225806439,
42.80858870967738
],
[
0.832209677419342,
42.908846774193506
]
]
]
}
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
21 changes: 21 additions & 0 deletions test/data/raf09_simplified.isg
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
begin_of_head ================================================
model name : RAF09
model type : hybrid
units : meters
reference : GRS80
lat min = 41.9875
lat max = 51.5125
lon min = -5.5167
lon max = 8.5167
delta lat = 1.9050
delta lon = 0.0242
nrows = 5
ncols = 7
nodata = -9999.0000
ISG format = 1.0
end_of_head ==================================================
50.0000 55.0000 60.0000 65.0000 70.0000 75.0000 80.0000
55.0000 60.0000 65.0000 70.0000 75.0000 80.0000 85.0000
60.0000 65.0000 70.0000 75.0000 80.0000 85.0000 90.0000
65.0000 70.0000 75.0000 80.0000 85.0000 90.0000 95.0000
70.0000 75.0000 80.0000 85.0000 90.0000 95.0000 100.000
1 change: 1 addition & 0 deletions test/data/vectortiles/sprite.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
25 changes: 25 additions & 0 deletions test/data/vectortiles/style.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"sources": {
"sourceName": {
"url": "https://test/tilejson.json"
}
},
"sprite": "https://test/sprite",
"layers": [
{
"type": "background",
"paint": {
"fill-color": "#0000ff"
}
},
{
"id": "land",
"type": "fill",
"minzoom": 5,
"maxzoom": 13,
"paint": {
"fill-color": "rgb(255, 0, 0)"
}
}
]
}
5 changes: 5 additions & 0 deletions test/data/vectortiles/tilejson.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"tiles": [
"http://server.geo/vectortiles/{z}/{x}/{y}"
]
}
Loading

0 comments on commit 9dcfed3

Please sign in to comment.