How esafastprototyping/webworldwind-esa works
Project Type and Purpose
• This is not a typical full-stack application—it is primarily a client-side geospatial visualization engine. The README shows that it is a custom build of Web WorldWind, with enhancements for WKT/AAIGrid readers/writers, an improved Collada loader, new elevation APIs, custom camera effects, trending layers (e.g., Sentinel-2 Cloudless), and support for several geospatial protocols (WCS 2.0.1, OpenSearch, etc.).
• The purpose is to enable complex globe rendering and geoscientific visualizations in a browser, with support for various specialized data formats and interactive features (like ArcBall and FirstPerson camera controls).
File Structure for Architectural Components
• Top-level directories:
• “src”: The heart of the engine containing all of the source code.
• “apps” and “examples”: Demonstrate different use cases and interactive tools built using the engine (each HTML file loading different functionalities).
• “test”: Contains unit and integration tests to ensure robustness.
• “tools”: Helps generate builds or documentation (e.g., jsdoc config).
• Inside “src”, you see many subdirectories:
• “formats”: Contains parsers, exporters, and utilities for geospatial formats like Collada, GeoJSON, KML, GeoTiff, WKT, and shapefiles. This indicates a well-modularized approach to handling different data formats.
• “geom”: Geometric and mathematical primitives (Matrix, Vec2/3, Angle, BoundingBox…) that are used across the engine.
• “globe”: Core globe classes and terrain/elevation models that constitute the visualization “engine” behind the globe.
• “layer”: Different layers for rendering imagery, vector overlays, heatmaps, etc.
• “gesture”, “navigate”, “render”, “shaders”: Modules that manage input recognition, camera controls, rendering pipelines, and graphics shader programs.
• “util”: Contains helper classes and general utilities (e.g., logger, promise, image handling, projection utilities).
• Other directories like “test” mirror the structure within “src”, showing clear separation of concerns and test coverage.
• Main Components:
• User Interface/Applications
• Apps/Examples: Each HTML/JS application that boots the engine and demonstrates a particular feature (e.g., Collada, Explorer, NDVIViewer).
• Core Engine
• WorldWind Core: Based on files in “src/WorldWind.js”, “WorldWindow.js”, and “WorldWindowController.js”. This is the base engine initializing the canvas, rendering loop, and overall state.
• Camera & Navigation: Modules like “ArcBallCamera”, “FirstPersonCamera”, and “Navigator” handle user input and movement on the globe.
• Rendering System: “render” and “shaders” directories contain the WebGL/graphics pipeline for drawing the globe and layers.
• Data Parsing and Formats
• Format Handlers: Parsers and exporters for geospatial data including:
▪ Collada (3D models)
▪ KML and KMZ (geospatial annotations)
▪ GeoJSON (vector data)
▪ GeoTiff (raster data)
▪ WKT (well-known text geometric descriptions)
▪ AAIGrid (elevation data)
• Globe & Layer Management
• Globe: In “src/globe”, classes that manage the 3D globe (terrain, elevation coverages).
• Layers: “src/layer” includes various layers that cover imagery (Bing, OpenStreetMap), vector overlays, heatmaps, and other thematic data.
• Utility and Supporting Modules
• Utility functions: Cached resources, logging, mathematical utilities, and general purpose helper methods.
• Gesture recognition: Modules to manage dragging, pinching, and other touch/mouse interactions.
• External Integrations and Protocols
• Services: OpenSearch integration and OGC services (WMS, WCS, WMTS) are present for pulling external geospatial data.
• Third-party libraries: Integrated ES6-Promise, JSZip, Proj4js, libtess.js for handling asynchronous operations, zip files, map projections, and tessellations.
• Relationships and Interactions:
• Data flows from the Format Handlers into the Core Engine: Once a geospatial dataset is parsed (using components in “src/formats”), the resultant data is handed off to rendering layers (within “src/layer” and “src/globe”) to be visualized.
• The User Interface (apps/examples) interacts with the Core via the WorldWindController, which then handles events (gestures and navigation) and updates the rendering pipeline.
• The Utility modules are used almost everywhere, supporting mathematical calculations, caching, projection computations, and logging.
• The communication between camera/navigation modules and the rendering engine is critical to provide the interactive globe experience.
Architectural Patterns and Design Principles
• Modularization: Clear separation by domain (e.g., formats, globe, layer, render) which simplifies future extension or substitution of modules.
• MVC-like Interaction: Although not strictly MVC, separate modules manage data extraction (formats), business logic (core engine/globe), and presentation (rendering and UI apps).
• Layered Architecture: The system is organized in layers – from low-level graphics and math at the bottom to high-level format parsing and application UI.
• Extensibility: The design shows extension points (readers, exporters, and external service integrations) that allow additional formats or rendering features to be easily added.