From 6324b66531d865dfd108ced869eb70a872bea9b5 Mon Sep 17 00:00:00 2001 From: Mathieu Bredif Date: Mon, 26 Mar 2018 17:12:36 +0200 Subject: [PATCH] refactor(parsers): move and rename parsers to a new parser directory Multiple classes are in charge of decoding file chunks. They were scattered into multiple directories and had different names : Loaders, Parsers, IoDrivers... They are now all moved to a new src/Parser directory This commit addresses first item of #695 --- examples/gpx.html | 2 +- src/Core/Scheduler/Providers/3dTiles_Provider.js | 12 ++++++------ .../Scheduler/Providers/OGCWebServiceHelper.js | 8 ++++---- src/Core/Scheduler/Providers/PointCloudProvider.js | 8 ++++---- src/Core/Scheduler/Providers/Raster_Provider.js | 4 ++-- src/Core/Scheduler/Providers/WFS_Provider.js | 4 ++-- src/Core/View.js | 2 +- src/Main.js | 4 ++-- .../B3dmLoader.js => Parser/B3dmParser.js} | 8 ++++---- .../ThreeExtended => Parser}/BatchTable.js | 0 .../ThreeExtended => Parser}/GLTFLoader.js | 0 .../GeoJsonParser.js} | 4 ++-- .../Providers/GpxUtils.js => Parser/GpxParser.js} | 14 +++++++------- .../KMZLoader.js => Parser/KmzParser.js} | 14 +++++++------- .../deprecated => Parser}/LegacyGLTFLoader.js | 0 .../PntsLoader.js => Parser/PntsParser.js} | 0 .../PotreeBinParser.js} | 2 +- .../PotreeCinParser.js} | 2 +- .../IoDriver_XBIL.js => Parser/XbilParser.js} | 12 ++++++------ src/Process/LayeredMaterialNodeProcessing.js | 2 +- test/feature2mesh_unit_test.js | 4 ++-- test/featureUtils_unit_test.js | 2 +- 22 files changed, 54 insertions(+), 54 deletions(-) rename src/{Renderer/ThreeExtended/B3dmLoader.js => Parser/B3dmParser.js} (96%) rename src/{Renderer/ThreeExtended => Parser}/BatchTable.js (100%) rename src/{Renderer/ThreeExtended => Parser}/GLTFLoader.js (100%) rename src/{Renderer/ThreeExtended/GeoJSON2Features.js => Parser/GeoJsonParser.js} (98%) rename src/{Core/Scheduler/Providers/GpxUtils.js => Parser/GpxParser.js} (94%) rename src/{Renderer/ThreeExtended/KMZLoader.js => Parser/KmzParser.js} (81%) rename src/{Renderer/ThreeExtended/deprecated => Parser}/LegacyGLTFLoader.js (100%) rename src/{Renderer/ThreeExtended/PntsLoader.js => Parser/PntsParser.js} (100%) rename src/{Core/Scheduler/Providers/PotreeBinLoader.js => Parser/PotreeBinParser.js} (96%) rename src/{Core/Scheduler/Providers/PotreeCinLoader.js => Parser/PotreeCinParser.js} (95%) rename src/{Core/Scheduler/Providers/IoDriver_XBIL.js => Parser/XbilParser.js} (81%) diff --git a/examples/gpx.html b/examples/gpx.html index cbdfb5b85e..1b75460b10 100644 --- a/examples/gpx.html +++ b/examples/gpx.html @@ -38,7 +38,7 @@ // Listen for globe full initialisation event globeView.addEventListener(itowns.GLOBE_VIEW_EVENTS.GLOBE_INITIALIZED, function () { console.info('Globe initialized'); - itowns.GpxUtils.load('https://raw.githubusercontent.com/iTowns/iTowns2-sample-data/master/ULTRA2009.gpx', globeView.referenceCrs).then(function (gpx) { + itowns.GpxParser.load('https://raw.githubusercontent.com/iTowns/iTowns2-sample-data/master/ULTRA2009.gpx', globeView.referenceCrs).then(function (gpx) { if (gpx) { globeView.scene.add(gpx); globeView.controls.setTilt(45, true); diff --git a/src/Core/Scheduler/Providers/3dTiles_Provider.js b/src/Core/Scheduler/Providers/3dTiles_Provider.js index 9af43e5176..405c281598 100644 --- a/src/Core/Scheduler/Providers/3dTiles_Provider.js +++ b/src/Core/Scheduler/Providers/3dTiles_Provider.js @@ -1,6 +1,6 @@ import * as THREE from 'three'; -import B3dmLoader from '../../../Renderer/ThreeExtended/B3dmLoader'; -import PntsLoader from '../../../Renderer/ThreeExtended/PntsLoader'; +import B3dmParser from '../../../Parser/B3dmParser'; +import PntsParser from '../../../Parser/PntsParser'; import Fetcher from './Fetcher'; import OBB from '../../../Renderer/ThreeExtended/OBB'; import Extent from '../../Geographic/Extent'; @@ -142,11 +142,11 @@ export function patchMaterialForLogDepthSupport(material) { }; } -let b3dmLoader; +let b3dmParser; let textDecoder; function b3dmToMesh(data, layer, url) { - b3dmLoader = b3dmLoader || new B3dmLoader(); - return b3dmLoader.parse(data, layer.asset.gltfUpAxis, url, textDecoder).then((result) => { + b3dmParser = b3dmParser || new B3dmParser(); + return b3dmParser.parse(data, layer.asset.gltfUpAxis, url, textDecoder).then((result) => { const init = function f_init(mesh) { mesh.frustumCulled = false; if (mesh.material) { @@ -177,7 +177,7 @@ function b3dmToMesh(data, layer, url) { function pntsParse(data) { return new Promise((resolve) => { - resolve({ object3d: PntsLoader.parse(data, textDecoder).point }); + resolve({ object3d: PntsParser.parse(data, textDecoder).point }); }); } diff --git a/src/Core/Scheduler/Providers/OGCWebServiceHelper.js b/src/Core/Scheduler/Providers/OGCWebServiceHelper.js index 1af68ba37e..4696bd23c2 100644 --- a/src/Core/Scheduler/Providers/OGCWebServiceHelper.js +++ b/src/Core/Scheduler/Providers/OGCWebServiceHelper.js @@ -1,6 +1,6 @@ import * as THREE from 'three'; import Fetcher from './Fetcher'; -import IoDriver_XBIL from './IoDriver_XBIL'; +import XbilParser from '../../../Parser/XbilParser'; import Projection from '../../Geographic/Projection'; import Extent from '../../Geographic/Extent'; @@ -12,7 +12,7 @@ export const SIZE_TEXTURE_TILE = 256; // Info : THREE.js have cache image https://github.com/mrdoob/three.js/blob/master/src/loaders/ImageLoader.js#L25 const cache = new Map(); const pending = new Map(); -const ioDXBIL = new IoDriver_XBIL(); +const XBIL = new XbilParser(); const projection = new Projection(); const getTextureFloat = function getTextureFloat(buffer) { @@ -24,7 +24,7 @@ const getTextureFloat = function getTextureFloat(buffer) { const tileCoord = new Extent('WMTS:WGS84G', 0, 0, 0); export default { - ioDXBIL, + XBIL, getColorTextureByUrl(url, networkOptions) { if (cache.has(url)) { return Promise.resolve(cache.get(url)); @@ -59,7 +59,7 @@ export default { return pending.get(url); } - const promiseXBil = ioDXBIL.read(url, networkOptions).then((result) => { + const promiseXBil = XBIL.read(url, networkOptions).then((result) => { // TODO RGBA is needed for navigator with no support in texture float // In RGBA elevation texture LinearFilter give some errors with nodata value. // need to rewrite sample function in shader diff --git a/src/Core/Scheduler/Providers/PointCloudProvider.js b/src/Core/Scheduler/Providers/PointCloudProvider.js index 6c1182e2ad..485b03ceef 100644 --- a/src/Core/Scheduler/Providers/PointCloudProvider.js +++ b/src/Core/Scheduler/Providers/PointCloudProvider.js @@ -1,8 +1,8 @@ import * as THREE from 'three'; import Fetcher from './Fetcher'; import PointCloudProcessing from '../../../Process/PointCloudProcessing'; -import PotreeBinLoader from './PotreeBinLoader'; -import PotreeCinLoader from './PotreeCinLoader'; +import PotreeBinParser from '../../../Parser/PotreeBinParser'; +import PotreeCinParser from '../../../Parser/PotreeCinParser'; import Picking from '../../Picking'; // Create an A(xis)A(ligned)B(ounding)B(ox) for the child `childIndex` of one aabb. @@ -123,9 +123,9 @@ function addPickingAttribute(points) { function loadPointFile(layer, url) { return fetch(url, layer.fetchOptions).then(foo => foo.arrayBuffer()).then((ab) => { if (layer.metadata.customBinFormat) { - return addPickingAttribute(PotreeCinLoader.parse(ab)); + return addPickingAttribute(PotreeCinParser.parse(ab)); } else { - return addPickingAttribute(PotreeBinLoader.parse(ab)); + return addPickingAttribute(PotreeBinParser.parse(ab)); } }); } diff --git a/src/Core/Scheduler/Providers/Raster_Provider.js b/src/Core/Scheduler/Providers/Raster_Provider.js index 1223e07ab8..54641b7a33 100644 --- a/src/Core/Scheduler/Providers/Raster_Provider.js +++ b/src/Core/Scheduler/Providers/Raster_Provider.js @@ -8,7 +8,7 @@ import * as THREE from 'three'; import togeojson from 'togeojson'; import Extent from '../../Geographic/Extent'; import Feature2Texture from '../../../Renderer/ThreeExtended/Feature2Texture'; -import GeoJSON2Features from '../../../Renderer/ThreeExtended/GeoJSON2Features'; +import GeoJsonParser from '../../../Parser/GeoJsonParser'; import Fetcher from './Fetcher'; function getExtentFromGpxFile(file) { @@ -104,7 +104,7 @@ export default { } if (geojson) { - return GeoJSON2Features.parse(parentCrs, geojson, layer.extent, options); + return GeoJsonParser.parse(parentCrs, geojson, layer.extent, options); } }).then((feature) => { if (feature) { diff --git a/src/Core/Scheduler/Providers/WFS_Provider.js b/src/Core/Scheduler/Providers/WFS_Provider.js index 422ed363e5..d7b15b28fa 100644 --- a/src/Core/Scheduler/Providers/WFS_Provider.js +++ b/src/Core/Scheduler/Providers/WFS_Provider.js @@ -7,7 +7,7 @@ import Extent from '../../Geographic/Extent'; import URLBuilder from './URLBuilder'; import Fetcher from './Fetcher'; -import GeoJSON2Features from '../../../Renderer/ThreeExtended/GeoJSON2Features'; +import GeoJsonParser from '../../../Parser/GeoJsonParser'; import Feature2Mesh from '../../../Renderer/ThreeExtended/Feature2Mesh'; const cache = new Map(); @@ -71,7 +71,7 @@ function getFeatures(crs, tile, layer) { return Fetcher.json(urld, layer.networkOptions) .then( - geojson => GeoJSON2Features.parse(crs, geojson, tile.extent, { filter: layer.filter }), + geojson => GeoJsonParser.parse(crs, geojson, tile.extent, { filter: layer.filter }), (err) => { // special handling for 400 errors, as it probably means the config is wrong if (err.response.status == 400) { diff --git a/src/Core/View.js b/src/Core/View.js index d3414acc08..af0cb97750 100644 --- a/src/Core/View.js +++ b/src/Core/View.js @@ -37,7 +37,7 @@ export const VIEW_EVENTS = { * @constructor * @example * // How add gpx object - * itowns.GpxUtils.load(url, viewer.referenceCrs).then((gpx) => { + * itowns.GpxParser.load(url, viewer.referenceCrs).then((gpx) => { * if (gpx) { * viewer.scene.add(gpx); * } diff --git a/src/Main.js b/src/Main.js index ef8a5262bf..9b11d0b34c 100644 --- a/src/Main.js +++ b/src/Main.js @@ -3,7 +3,6 @@ export { default as Extent } from './Core/Geographic/Extent'; export { GeometryLayer, ImageryLayers } from './Core/Layer/Layer'; export { STRATEGY_MIN_NETWORK_TRAFFIC, STRATEGY_GROUP, STRATEGY_PROGRESSIVE, STRATEGY_DICHOTOMY } from './Core/Layer/LayerUpdateStrategy'; export { default as GlobeView, GLOBE_VIEW_EVENTS, createGlobeLayer } from './Core/Prefab/GlobeView'; -export { default as GpxUtils } from './Core/Scheduler/Providers/GpxUtils'; export { default as PlanarView, createPlanarLayer } from './Core/Prefab/PlanarView'; export { default as PanoramaView, createPanoramaLayer } from './Core/Prefab/PanoramaView'; export { default as Panorama } from './Core/Prefab/Panorama/Constants'; @@ -11,6 +10,8 @@ export { default as Fetcher } from './Core/Scheduler/Providers/Fetcher'; export { MAIN_LOOP_EVENTS } from './Core/MainLoop'; export { default as View } from './Core/View'; export { VIEW_EVENTS } from './Core/View'; +export { default as GpxParser } from './Parser/GpxParser'; +export { default as GeoJsonParser } from './Parser/GeoJsonParser'; export { process3dTilesNode, init3dTilesLayer, $3dTilesCulling, $3dTilesSubdivisionControl, pre3dTilesUpdate } from './Process/3dTilesProcessing'; export { default as FeatureProcessing } from './Process/FeatureProcessing'; export { updateLayeredMaterialNodeImagery, updateLayeredMaterialNodeElevation } from './Process/LayeredMaterialNodeProcessing'; @@ -22,7 +23,6 @@ export { default as Feature2Mesh } from './Renderer/ThreeExtended/Feature2Mesh'; export { default as FlyControls } from './Renderer/ThreeExtended/FlyControls'; export { default as FirstPersonControls } from './Renderer/ThreeExtended/FirstPersonControls'; export { default as PlanarControls } from './Renderer/ThreeExtended/PlanarControls'; -export { default as GeoJSON2Features } from './Renderer/ThreeExtended/GeoJSON2Features'; export { default as FeaturesUtils } from './Renderer/ThreeExtended/FeaturesUtils'; export { CONTROL_EVENTS } from './Renderer/ThreeExtended/GlobeControls'; export { default as DEMUtils } from './utils/DEMUtils'; diff --git a/src/Renderer/ThreeExtended/B3dmLoader.js b/src/Parser/B3dmParser.js similarity index 96% rename from src/Renderer/ThreeExtended/B3dmLoader.js rename to src/Parser/B3dmParser.js index 833aedfffe..6de9d3f4be 100644 --- a/src/Renderer/ThreeExtended/B3dmLoader.js +++ b/src/Parser/B3dmParser.js @@ -1,13 +1,13 @@ import * as THREE from 'three'; import GLTFLoader from './GLTFLoader'; -import LegacyGLTFLoader from './deprecated/LegacyGLTFLoader'; +import LegacyGLTFLoader from './LegacyGLTFLoader'; import BatchTable from './BatchTable'; const matrixChangeUpVectorZtoY = (new THREE.Matrix4()).makeRotationX(Math.PI / 2); // For gltf rotation const matrixChangeUpVectorZtoX = (new THREE.Matrix4()).makeRotationZ(-Math.PI / 2); -function B3dmLoader() { +function B3dmParser() { this.glTFLoader = new GLTFLoader(); this.LegacyGLTFLoader = new LegacyGLTFLoader(); } @@ -46,7 +46,7 @@ function applyOptionalCesiumRTC(data, gltf, textDecoder) { } } -B3dmLoader.prototype.parse = function parse(buffer, gltfUpAxis, url, textDecoder) { +B3dmParser.prototype.parse = function parse(buffer, gltfUpAxis, url, textDecoder) { if (!buffer) { throw new Error('No array buffer provided.'); } @@ -124,4 +124,4 @@ B3dmLoader.prototype.parse = function parse(buffer, gltfUpAxis, url, textDecoder } }; -export default B3dmLoader; +export default B3dmParser; diff --git a/src/Renderer/ThreeExtended/BatchTable.js b/src/Parser/BatchTable.js similarity index 100% rename from src/Renderer/ThreeExtended/BatchTable.js rename to src/Parser/BatchTable.js diff --git a/src/Renderer/ThreeExtended/GLTFLoader.js b/src/Parser/GLTFLoader.js similarity index 100% rename from src/Renderer/ThreeExtended/GLTFLoader.js rename to src/Parser/GLTFLoader.js diff --git a/src/Renderer/ThreeExtended/GeoJSON2Features.js b/src/Parser/GeoJsonParser.js similarity index 98% rename from src/Renderer/ThreeExtended/GeoJSON2Features.js rename to src/Parser/GeoJsonParser.js index 5908bb5011..5aa2752908 100644 --- a/src/Renderer/ThreeExtended/GeoJSON2Features.js +++ b/src/Parser/GeoJsonParser.js @@ -3,8 +3,8 @@ * Class: FeatureToolBox * Description: */ -import Coordinates from '../../Core/Geographic/Coordinates'; -import Extent from '../../Core/Geographic/Extent'; +import Coordinates from '../Core/Geographic/Coordinates'; +import Extent from '../Core/Geographic/Extent'; function readCRS(json) { if (json.crs) { diff --git a/src/Core/Scheduler/Providers/GpxUtils.js b/src/Parser/GpxParser.js similarity index 94% rename from src/Core/Scheduler/Providers/GpxUtils.js rename to src/Parser/GpxParser.js index c72762a8b1..e14952a40b 100644 --- a/src/Core/Scheduler/Providers/GpxUtils.js +++ b/src/Parser/GpxParser.js @@ -1,15 +1,15 @@ /** * Generated On: 2016-07-07 - * Class: GpxUtils + * Class: GpxParser * Description: Parse Gpx file to get [lat, lon, alt] */ import * as THREE from 'three'; import Line from 'three.meshline'; -import Fetcher from './Fetcher'; -import Coordinates from '../../Geographic/Coordinates'; -import Capabilities from '../../System/Capabilities'; -import { patchMaterialForLogDepthSupport } from './3dTiles_Provider'; +import Fetcher from '../Core/Scheduler/Providers/Fetcher'; +import Coordinates from '../Core/Geographic/Coordinates'; +import Capabilities from '../Core/System/Capabilities'; +import { patchMaterialForLogDepthSupport } from '../Core/Scheduler/Providers/3dTiles_Provider'; function _gpxToWayPointsArray(gpxXML) { return gpxXML.getElementsByTagName('wpt'); @@ -171,7 +171,7 @@ function _gpxToMesh(gpxXML, options = {}) { } export default { - /** @module gpxUtils */ + /** @module GpxParser */ /** Load gpx file and convert to THREE.Mesh * @function load * @param {string} urlFile The url of gpx file @@ -183,7 +183,7 @@ export default { * @return {THREE.Mesh} Three.js Mesh see {@link https://threejs.org/docs/#api/objects/Mesh} * @example * // How add gpx object - * itowns.GpxUtils.load(url, viewer.referenceCrs).then((gpx) => { + * itowns.GpxParser.load(url, viewer.referenceCrs).then((gpx) => { * if (gpx) { * viewer.scene.add(gpx); * viewer.notifyChange(true); diff --git a/src/Renderer/ThreeExtended/KMZLoader.js b/src/Parser/KmzParser.js similarity index 81% rename from src/Renderer/ThreeExtended/KMZLoader.js rename to src/Parser/KmzParser.js index b038b6ceba..61c0702d4c 100644 --- a/src/Renderer/ThreeExtended/KMZLoader.js +++ b/src/Parser/KmzParser.js @@ -4,19 +4,19 @@ import JSZip from 'jszip'; import * as THREE from 'three'; -import Coordinates from '../../Core/Geographic/Coordinates'; +import Coordinates from '../Core/Geographic/Coordinates'; -function KMZLoader() { +function KmzParser() { this.colladaLoader = new THREE.ColladaLoader(); this.colladaLoader.options.convertUpAxis = true; this.cache = []; } -KMZLoader.prototype = Object.create(KMZLoader.prototype); +KmzParser.prototype = Object.create(KmzParser.prototype); -KMZLoader.prototype.constructor = KMZLoader; +KmzParser.prototype.constructor = KmzParser; -KMZLoader.prototype.parseCollada = function parseCollada(buffer) { +KmzParser.prototype.parseCollada = function parseCollada(buffer) { var zip = new JSZip(buffer); var collada; var coordCarto; @@ -40,7 +40,7 @@ KMZLoader.prototype.parseCollada = function parseCollada(buffer) { return collada; }; -KMZLoader.prototype.load = function load(url) { +KmzParser.prototype.load = function load(url) { return fetch(url).then((response) => { if (response.status < 200 || response.status >= 300) { throw new Error(`Error loading ${url}: status ${response.status}`); @@ -49,4 +49,4 @@ KMZLoader.prototype.load = function load(url) { }).then(buffer => this.parseCollada(buffer)); }; -export default KMZLoader; +export default KmzParser; diff --git a/src/Renderer/ThreeExtended/deprecated/LegacyGLTFLoader.js b/src/Parser/LegacyGLTFLoader.js similarity index 100% rename from src/Renderer/ThreeExtended/deprecated/LegacyGLTFLoader.js rename to src/Parser/LegacyGLTFLoader.js diff --git a/src/Renderer/ThreeExtended/PntsLoader.js b/src/Parser/PntsParser.js similarity index 100% rename from src/Renderer/ThreeExtended/PntsLoader.js rename to src/Parser/PntsParser.js diff --git a/src/Core/Scheduler/Providers/PotreeBinLoader.js b/src/Parser/PotreeBinParser.js similarity index 96% rename from src/Core/Scheduler/Providers/PotreeBinLoader.js rename to src/Parser/PotreeBinParser.js index 4e355130f0..02cd160b3a 100644 --- a/src/Core/Scheduler/Providers/PotreeBinLoader.js +++ b/src/Parser/PotreeBinParser.js @@ -1,5 +1,5 @@ import * as THREE from 'three'; -import PointsMaterial from '../../../Renderer/PointsMaterial'; +import PointsMaterial from '../Renderer/PointsMaterial'; // Parse .bin PotreeConverter format export default { diff --git a/src/Core/Scheduler/Providers/PotreeCinLoader.js b/src/Parser/PotreeCinParser.js similarity index 95% rename from src/Core/Scheduler/Providers/PotreeCinLoader.js rename to src/Parser/PotreeCinParser.js index 634f33a796..5f725a5140 100644 --- a/src/Core/Scheduler/Providers/PotreeCinLoader.js +++ b/src/Parser/PotreeCinParser.js @@ -1,5 +1,5 @@ import * as THREE from 'three'; -import PointsMaterial from '../../../Renderer/PointsMaterial'; +import PointsMaterial from '../Renderer/PointsMaterial'; // Parse .cin PotreeConverter format (see https://github.com/peppsac/PotreeConverter/tree/custom_bin) export default { diff --git a/src/Core/Scheduler/Providers/IoDriver_XBIL.js b/src/Parser/XbilParser.js similarity index 81% rename from src/Core/Scheduler/Providers/IoDriver_XBIL.js rename to src/Parser/XbilParser.js index f4eba5767b..ccc8e6dfdc 100644 --- a/src/Core/Scheduler/Providers/IoDriver_XBIL.js +++ b/src/Parser/XbilParser.js @@ -1,4 +1,4 @@ -import Fetcher from './Fetcher'; +import Fetcher from '../Core/Scheduler/Providers/Fetcher'; var portableXBIL = function portableXBIL(buffer) { @@ -9,10 +9,10 @@ var portableXBIL = function portableXBIL(buffer) { }; -function IoDriver_XBIL() { +function XbilParser() { } -IoDriver_XBIL.prototype.computeMinMaxElevation = function computeMinMaxElevation(buffer, width, height, offsetScale) { +XbilParser.prototype.computeMinMaxElevation = function computeMinMaxElevation(buffer, width, height, offsetScale) { let min = 1000000; let max = -1000000; @@ -44,7 +44,7 @@ IoDriver_XBIL.prototype.computeMinMaxElevation = function computeMinMaxElevation return { min, max }; }; -IoDriver_XBIL.prototype.parseXBil = function parseXBil(buffer, url) { +XbilParser.prototype.parseXBil = function parseXBil(buffer, url) { if (!buffer) { throw new Error('Error processing XBIL'); } @@ -62,9 +62,9 @@ IoDriver_XBIL.prototype.parseXBil = function parseXBil(buffer, url) { }; -IoDriver_XBIL.prototype.read = function read(url, networkOptions) { +XbilParser.prototype.read = function read(url, networkOptions) { return Fetcher.arrayBuffer(url, networkOptions).then(buffer => this.parseXBil(buffer, url)); }; -export default IoDriver_XBIL; +export default XbilParser; diff --git a/src/Process/LayeredMaterialNodeProcessing.js b/src/Process/LayeredMaterialNodeProcessing.js index ecfe76f054..6e8b68d87b 100644 --- a/src/Process/LayeredMaterialNodeProcessing.js +++ b/src/Process/LayeredMaterialNodeProcessing.js @@ -57,7 +57,7 @@ function initNodeElevationTextureFromParent(node, parent, layer) { // to use parent's min-max. const useMinMaxFromParent = node.level - texture.coords.zoom > 6; if (!useMinMaxFromParent) { - const { min, max } = OGCWebServiceHelper.ioDXBIL.computeMinMaxElevation( + const { min, max } = OGCWebServiceHelper.XBIL.computeMinMaxElevation( texture.image.data, SIZE_TEXTURE_TILE, SIZE_TEXTURE_TILE, pitch); diff --git a/test/feature2mesh_unit_test.js b/test/feature2mesh_unit_test.js index f42ed4f258..db8299c0e8 100644 --- a/test/feature2mesh_unit_test.js +++ b/test/feature2mesh_unit_test.js @@ -1,6 +1,6 @@ import * as THREE from 'three'; import proj4 from 'proj4'; -import GeoJSON2Features from '../src/Renderer/ThreeExtended/GeoJSON2Features'; +import GeoJsonParser from '../src/Parser/GeoJsonParser'; import Feature2Mesh from '../src/Renderer/ThreeExtended/Feature2Mesh'; /* global describe, it */ @@ -11,7 +11,7 @@ proj4.defs('EPSG:3946', '+proj=lcc +lat_1=45.25 +lat_2=46.75 +lat_0=46 +lon_0=3 +x_0=1700000 +y_0=5200000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs'); function parse() { - return GeoJSON2Features.parse( + return GeoJsonParser.parse( 'EPSG:3946', geojson, undefined, { buildExtent: true, crsIn: 'EPSG:3946' }); } diff --git a/test/featureUtils_unit_test.js b/test/featureUtils_unit_test.js index cfa0c5ac9a..8165cfd470 100644 --- a/test/featureUtils_unit_test.js +++ b/test/featureUtils_unit_test.js @@ -1,4 +1,4 @@ -import GeoJSON2Features from '../src/Renderer/ThreeExtended/GeoJSON2Features'; +import GeoJSON2Features from '../src/Parser/GeoJsonParser'; import FeaturesUtils from '../src/Renderer/ThreeExtended/FeaturesUtils'; import Coordinates from '../src/Core/Geographic/Coordinates'; /* global describe, it */