@reearth/core 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +18 -0
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_0.json +1 -0
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_1.json +1 -0
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_10.json +1 -0
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_11.json +1 -0
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_12.json +1 -0
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_13.json +1 -0
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_14.json +1 -0
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_15.json +1 -0
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_16.json +1 -0
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_17.json +1 -0
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_18.json +1 -0
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_19.json +1 -0
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_2.json +1 -0
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_20.json +1 -0
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_21.json +1 -0
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_22.json +1 -0
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_23.json +1 -0
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_24.json +1 -0
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_25.json +1 -0
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_26.json +1 -0
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_27.json +1 -0
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_3.json +1 -0
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_4.json +1 -0
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_5.json +1 -0
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_6.json +1 -0
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_7.json +1 -0
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_8.json +1 -0
- package/dist/cesium/Assets/IAU2006_XYS/IAU2006_XYS_9.json +1 -0
- package/dist/cesium/Assets/Images/bing_maps_credit.png +0 -0
- package/dist/cesium/Assets/Images/cesium_credit.png +0 -0
- package/dist/cesium/Assets/Images/google_earth_credit.png +0 -0
- package/dist/cesium/Assets/Images/ion-credit.png +0 -0
- package/dist/cesium/Assets/Textures/LensFlare/DirtMask.jpg +0 -0
- package/dist/cesium/Assets/Textures/LensFlare/StarBurst.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/0/0/0.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/0/1/0.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/1/0/0.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/1/0/1.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/1/1/0.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/1/1/1.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/1/2/0.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/1/2/1.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/1/3/0.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/1/3/1.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/0/0.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/0/1.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/0/2.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/0/3.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/1/0.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/1/1.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/1/2.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/1/3.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/2/0.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/2/1.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/2/2.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/2/3.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/3/0.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/3/1.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/3/2.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/3/3.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/4/0.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/4/1.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/4/2.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/4/3.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/5/0.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/5/1.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/5/2.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/5/3.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/6/0.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/6/1.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/6/2.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/6/3.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/7/0.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/7/1.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/7/2.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/2/7/3.jpg +0 -0
- package/dist/cesium/Assets/Textures/NaturalEarthII/tilemapresource.xml +14 -0
- package/dist/cesium/Assets/Textures/SkyBox/tycho2t3_80_mx.jpg +0 -0
- package/dist/cesium/Assets/Textures/SkyBox/tycho2t3_80_my.jpg +0 -0
- package/dist/cesium/Assets/Textures/SkyBox/tycho2t3_80_mz.jpg +0 -0
- package/dist/cesium/Assets/Textures/SkyBox/tycho2t3_80_px.jpg +0 -0
- package/dist/cesium/Assets/Textures/SkyBox/tycho2t3_80_py.jpg +0 -0
- package/dist/cesium/Assets/Textures/SkyBox/tycho2t3_80_pz.jpg +0 -0
- package/dist/cesium/Assets/Textures/maki/airfield.png +0 -0
- package/dist/cesium/Assets/Textures/maki/airport.png +0 -0
- package/dist/cesium/Assets/Textures/maki/alcohol-shop.png +0 -0
- package/dist/cesium/Assets/Textures/maki/america-football.png +0 -0
- package/dist/cesium/Assets/Textures/maki/art-gallery.png +0 -0
- package/dist/cesium/Assets/Textures/maki/bakery.png +0 -0
- package/dist/cesium/Assets/Textures/maki/bank.png +0 -0
- package/dist/cesium/Assets/Textures/maki/bar.png +0 -0
- package/dist/cesium/Assets/Textures/maki/baseball.png +0 -0
- package/dist/cesium/Assets/Textures/maki/basketball.png +0 -0
- package/dist/cesium/Assets/Textures/maki/beer.png +0 -0
- package/dist/cesium/Assets/Textures/maki/bicycle.png +0 -0
- package/dist/cesium/Assets/Textures/maki/building.png +0 -0
- package/dist/cesium/Assets/Textures/maki/bus.png +0 -0
- package/dist/cesium/Assets/Textures/maki/cafe.png +0 -0
- package/dist/cesium/Assets/Textures/maki/camera.png +0 -0
- package/dist/cesium/Assets/Textures/maki/campsite.png +0 -0
- package/dist/cesium/Assets/Textures/maki/car.png +0 -0
- package/dist/cesium/Assets/Textures/maki/cemetery.png +0 -0
- package/dist/cesium/Assets/Textures/maki/cesium.png +0 -0
- package/dist/cesium/Assets/Textures/maki/chemist.png +0 -0
- package/dist/cesium/Assets/Textures/maki/cinema.png +0 -0
- package/dist/cesium/Assets/Textures/maki/circle-stroked.png +0 -0
- package/dist/cesium/Assets/Textures/maki/circle.png +0 -0
- package/dist/cesium/Assets/Textures/maki/city.png +0 -0
- package/dist/cesium/Assets/Textures/maki/clothing-store.png +0 -0
- package/dist/cesium/Assets/Textures/maki/college.png +0 -0
- package/dist/cesium/Assets/Textures/maki/commercial.png +0 -0
- package/dist/cesium/Assets/Textures/maki/cricket.png +0 -0
- package/dist/cesium/Assets/Textures/maki/cross.png +0 -0
- package/dist/cesium/Assets/Textures/maki/dam.png +0 -0
- package/dist/cesium/Assets/Textures/maki/danger.png +0 -0
- package/dist/cesium/Assets/Textures/maki/disability.png +0 -0
- package/dist/cesium/Assets/Textures/maki/dog-park.png +0 -0
- package/dist/cesium/Assets/Textures/maki/embassy.png +0 -0
- package/dist/cesium/Assets/Textures/maki/emergency-telephone.png +0 -0
- package/dist/cesium/Assets/Textures/maki/entrance.png +0 -0
- package/dist/cesium/Assets/Textures/maki/farm.png +0 -0
- package/dist/cesium/Assets/Textures/maki/fast-food.png +0 -0
- package/dist/cesium/Assets/Textures/maki/ferry.png +0 -0
- package/dist/cesium/Assets/Textures/maki/fire-station.png +0 -0
- package/dist/cesium/Assets/Textures/maki/fuel.png +0 -0
- package/dist/cesium/Assets/Textures/maki/garden.png +0 -0
- package/dist/cesium/Assets/Textures/maki/gift.png +0 -0
- package/dist/cesium/Assets/Textures/maki/golf.png +0 -0
- package/dist/cesium/Assets/Textures/maki/grocery.png +0 -0
- package/dist/cesium/Assets/Textures/maki/hairdresser.png +0 -0
- package/dist/cesium/Assets/Textures/maki/harbor.png +0 -0
- package/dist/cesium/Assets/Textures/maki/heart.png +0 -0
- package/dist/cesium/Assets/Textures/maki/heliport.png +0 -0
- package/dist/cesium/Assets/Textures/maki/hospital.png +0 -0
- package/dist/cesium/Assets/Textures/maki/ice-cream.png +0 -0
- package/dist/cesium/Assets/Textures/maki/industrial.png +0 -0
- package/dist/cesium/Assets/Textures/maki/land-use.png +0 -0
- package/dist/cesium/Assets/Textures/maki/laundry.png +0 -0
- package/dist/cesium/Assets/Textures/maki/library.png +0 -0
- package/dist/cesium/Assets/Textures/maki/lighthouse.png +0 -0
- package/dist/cesium/Assets/Textures/maki/lodging.png +0 -0
- package/dist/cesium/Assets/Textures/maki/logging.png +0 -0
- package/dist/cesium/Assets/Textures/maki/london-underground.png +0 -0
- package/dist/cesium/Assets/Textures/maki/marker-stroked.png +0 -0
- package/dist/cesium/Assets/Textures/maki/marker.png +0 -0
- package/dist/cesium/Assets/Textures/maki/minefield.png +0 -0
- package/dist/cesium/Assets/Textures/maki/mobilephone.png +0 -0
- package/dist/cesium/Assets/Textures/maki/monument.png +0 -0
- package/dist/cesium/Assets/Textures/maki/museum.png +0 -0
- package/dist/cesium/Assets/Textures/maki/music.png +0 -0
- package/dist/cesium/Assets/Textures/maki/oil-well.png +0 -0
- package/dist/cesium/Assets/Textures/maki/park.png +0 -0
- package/dist/cesium/Assets/Textures/maki/park2.png +0 -0
- package/dist/cesium/Assets/Textures/maki/parking-garage.png +0 -0
- package/dist/cesium/Assets/Textures/maki/parking.png +0 -0
- package/dist/cesium/Assets/Textures/maki/pharmacy.png +0 -0
- package/dist/cesium/Assets/Textures/maki/pitch.png +0 -0
- package/dist/cesium/Assets/Textures/maki/place-of-worship.png +0 -0
- package/dist/cesium/Assets/Textures/maki/playground.png +0 -0
- package/dist/cesium/Assets/Textures/maki/police.png +0 -0
- package/dist/cesium/Assets/Textures/maki/polling-place.png +0 -0
- package/dist/cesium/Assets/Textures/maki/post.png +0 -0
- package/dist/cesium/Assets/Textures/maki/prison.png +0 -0
- package/dist/cesium/Assets/Textures/maki/rail-above.png +0 -0
- package/dist/cesium/Assets/Textures/maki/rail-light.png +0 -0
- package/dist/cesium/Assets/Textures/maki/rail-metro.png +0 -0
- package/dist/cesium/Assets/Textures/maki/rail-underground.png +0 -0
- package/dist/cesium/Assets/Textures/maki/rail.png +0 -0
- package/dist/cesium/Assets/Textures/maki/religious-christian.png +0 -0
- package/dist/cesium/Assets/Textures/maki/religious-jewish.png +0 -0
- package/dist/cesium/Assets/Textures/maki/religious-muslim.png +0 -0
- package/dist/cesium/Assets/Textures/maki/restaurant.png +0 -0
- package/dist/cesium/Assets/Textures/maki/roadblock.png +0 -0
- package/dist/cesium/Assets/Textures/maki/rocket.png +0 -0
- package/dist/cesium/Assets/Textures/maki/school.png +0 -0
- package/dist/cesium/Assets/Textures/maki/scooter.png +0 -0
- package/dist/cesium/Assets/Textures/maki/shop.png +0 -0
- package/dist/cesium/Assets/Textures/maki/skiing.png +0 -0
- package/dist/cesium/Assets/Textures/maki/slaughterhouse.png +0 -0
- package/dist/cesium/Assets/Textures/maki/soccer.png +0 -0
- package/dist/cesium/Assets/Textures/maki/square-stroked.png +0 -0
- package/dist/cesium/Assets/Textures/maki/square.png +0 -0
- package/dist/cesium/Assets/Textures/maki/star-stroked.png +0 -0
- package/dist/cesium/Assets/Textures/maki/star.png +0 -0
- package/dist/cesium/Assets/Textures/maki/suitcase.png +0 -0
- package/dist/cesium/Assets/Textures/maki/swimming.png +0 -0
- package/dist/cesium/Assets/Textures/maki/telephone.png +0 -0
- package/dist/cesium/Assets/Textures/maki/tennis.png +0 -0
- package/dist/cesium/Assets/Textures/maki/theatre.png +0 -0
- package/dist/cesium/Assets/Textures/maki/toilets.png +0 -0
- package/dist/cesium/Assets/Textures/maki/town-hall.png +0 -0
- package/dist/cesium/Assets/Textures/maki/town.png +0 -0
- package/dist/cesium/Assets/Textures/maki/triangle-stroked.png +0 -0
- package/dist/cesium/Assets/Textures/maki/triangle.png +0 -0
- package/dist/cesium/Assets/Textures/maki/village.png +0 -0
- package/dist/cesium/Assets/Textures/maki/warehouse.png +0 -0
- package/dist/cesium/Assets/Textures/maki/waste-basket.png +0 -0
- package/dist/cesium/Assets/Textures/maki/water.png +0 -0
- package/dist/cesium/Assets/Textures/maki/wetland.png +0 -0
- package/dist/cesium/Assets/Textures/maki/zoo.png +0 -0
- package/dist/cesium/Assets/Textures/moonSmall.jpg +0 -0
- package/dist/cesium/Assets/Textures/pin.svg +1 -0
- package/dist/cesium/Assets/Textures/waterNormals.jpg +0 -0
- package/dist/cesium/Assets/Textures/waterNormalsSmall.jpg +0 -0
- package/dist/cesium/Assets/approximateTerrainHeights.json +1 -0
- package/dist/cesium/ThirdParty/Workers/package.json +1 -0
- package/dist/cesium/ThirdParty/Workers/pako_deflate.min.js +1 -0
- package/dist/cesium/ThirdParty/Workers/pako_inflate.min.js +1 -0
- package/dist/cesium/ThirdParty/Workers/z-worker-pako.js +1 -0
- package/dist/cesium/ThirdParty/basis_transcoder.wasm +0 -0
- package/dist/cesium/ThirdParty/draco_decoder.wasm +0 -0
- package/dist/cesium/ThirdParty/google-earth-dbroot-parser.js +1 -0
- package/dist/cesium/Widgets/Animation/Animation.css +127 -0
- package/dist/cesium/Widgets/Animation/lighter.css +70 -0
- package/dist/cesium/Widgets/BaseLayerPicker/BaseLayerPicker.css +108 -0
- package/dist/cesium/Widgets/BaseLayerPicker/lighter.css +22 -0
- package/dist/cesium/Widgets/Cesium3DTilesInspector/Cesium3DTilesInspector.css +102 -0
- package/dist/cesium/Widgets/CesiumInspector/CesiumInspector.css +113 -0
- package/dist/cesium/Widgets/CesiumWidget/CesiumWidget.css +124 -0
- package/dist/cesium/Widgets/CesiumWidget/lighter.css +14 -0
- package/dist/cesium/Widgets/FullscreenButton/FullscreenButton.css +8 -0
- package/dist/cesium/Widgets/Geocoder/Geocoder.css +70 -0
- package/dist/cesium/Widgets/Geocoder/lighter.css +17 -0
- package/dist/cesium/Widgets/I3SBuildingSceneLayerExplorer/I3SBuildingSceneLayerExplorer.css +27 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/ArcGisMapServiceWorldHillshade.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/ArcGisMapServiceWorldImagery.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/ArcGisMapServiceWorldOcean.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/bingAerial.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/bingAerialLabels.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/bingRoads.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/blueMarble.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/earthAtNight.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/mapQuestOpenStreetMap.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/mapboxSatellite.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/mapboxStreets.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/mapboxTerrain.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/naturalEarthII.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/openStreetMap.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/sentinel-2.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/stadiaAlidadeSmooth.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/stadiaAlidadeSmoothDark.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/stamenToner.png +0 -0
- package/dist/cesium/Widgets/Images/ImageryProviders/stamenWatercolor.png +0 -0
- package/dist/cesium/Widgets/Images/NavigationHelp/Mouse.svg +84 -0
- package/dist/cesium/Widgets/Images/NavigationHelp/MouseLeft.svg +76 -0
- package/dist/cesium/Widgets/Images/NavigationHelp/MouseMiddle.svg +76 -0
- package/dist/cesium/Widgets/Images/NavigationHelp/MouseRight.svg +76 -0
- package/dist/cesium/Widgets/Images/NavigationHelp/Touch.svg +120 -0
- package/dist/cesium/Widgets/Images/NavigationHelp/TouchDrag.svg +129 -0
- package/dist/cesium/Widgets/Images/NavigationHelp/TouchRotate.svg +76 -0
- package/dist/cesium/Widgets/Images/NavigationHelp/TouchTilt.svg +135 -0
- package/dist/cesium/Widgets/Images/NavigationHelp/TouchZoom.svg +74 -0
- package/dist/cesium/Widgets/Images/TerrainProviders/CesiumWorldTerrain.png +0 -0
- package/dist/cesium/Widgets/Images/TerrainProviders/Ellipsoid.png +0 -0
- package/dist/cesium/Widgets/Images/TimelineIcons.png +0 -0
- package/dist/cesium/Widgets/Images/info-loading.gif +0 -0
- package/dist/cesium/Widgets/InfoBox/InfoBox.css +92 -0
- package/dist/cesium/Widgets/InfoBox/InfoBoxDescription.css +178 -0
- package/dist/cesium/Widgets/NavigationHelpButton/NavigationHelpButton.css +93 -0
- package/dist/cesium/Widgets/NavigationHelpButton/lighter.css +38 -0
- package/dist/cesium/Widgets/PerformanceWatchdog/PerformanceWatchdog.css +15 -0
- package/dist/cesium/Widgets/ProjectionPicker/ProjectionPicker.css +38 -0
- package/dist/cesium/Widgets/SceneModePicker/SceneModePicker.css +56 -0
- package/dist/cesium/Widgets/SelectionIndicator/SelectionIndicator.css +20 -0
- package/dist/cesium/Widgets/Timeline/Timeline.css +103 -0
- package/dist/cesium/Widgets/Timeline/lighter.css +23 -0
- package/dist/cesium/Widgets/VRButton/VRButton.css +8 -0
- package/dist/cesium/Widgets/Viewer/Viewer.css +107 -0
- package/dist/cesium/Widgets/VoxelInspector/VoxelInspector.css +16 -0
- package/dist/cesium/Widgets/lighter.css +237 -0
- package/dist/cesium/Widgets/lighterShared.css +46 -0
- package/dist/cesium/Widgets/shared.css +103 -0
- package/dist/cesium/Widgets/widgets.css +1346 -0
- package/dist/cesium/Workers/chunk-2ED5WI77.js +26 -0
- package/dist/cesium/Workers/chunk-2MBPFWCP.js +26 -0
- package/dist/cesium/Workers/chunk-3C74MLG3.js +26 -0
- package/dist/cesium/Workers/chunk-45U7TTT3.js +26 -0
- package/dist/cesium/Workers/chunk-4N7SRDH5.js +26 -0
- package/dist/cesium/Workers/chunk-4T6AS6BZ.js +26 -0
- package/dist/cesium/Workers/chunk-5AG2MVRM.js +26 -0
- package/dist/cesium/Workers/chunk-5Z6L2FHX.js +26 -0
- package/dist/cesium/Workers/chunk-6AUUBDOF.js +26 -0
- package/dist/cesium/Workers/chunk-74N6MC2V.js +26 -0
- package/dist/cesium/Workers/chunk-7VJK3KHI.js +26 -0
- package/dist/cesium/Workers/chunk-7VZHIB6P.js +26 -0
- package/dist/cesium/Workers/chunk-7X2YQ6I4.js +27 -0
- package/dist/cesium/Workers/chunk-B2SKQ7LU.js +26 -0
- package/dist/cesium/Workers/chunk-B4TQDFIE.js +26 -0
- package/dist/cesium/Workers/chunk-B6TRTFAA.js +26 -0
- package/dist/cesium/Workers/chunk-BK3HCS7I.js +26 -0
- package/dist/cesium/Workers/chunk-BOPB43LN.js +26 -0
- package/dist/cesium/Workers/chunk-C6DMEJQ7.js +26 -0
- package/dist/cesium/Workers/chunk-CN7UN2OZ.js +26 -0
- package/dist/cesium/Workers/chunk-CSISXEG7.js +26 -0
- package/dist/cesium/Workers/chunk-CUOR5F7T.js +28 -0
- package/dist/cesium/Workers/chunk-DGCK3LD2.js +30 -0
- package/dist/cesium/Workers/chunk-DXEZYE3K.js +62 -0
- package/dist/cesium/Workers/chunk-EXBFEYPQ.js +26 -0
- package/dist/cesium/Workers/chunk-FK5KFB6H.js +26 -0
- package/dist/cesium/Workers/chunk-HPBHKP5S.js +26 -0
- package/dist/cesium/Workers/chunk-JCJ24DHF.js +26 -0
- package/dist/cesium/Workers/chunk-JEWHFDAA.js +26 -0
- package/dist/cesium/Workers/chunk-JZLZJJQD.js +26 -0
- package/dist/cesium/Workers/chunk-KRZBI2MU.js +26 -0
- package/dist/cesium/Workers/chunk-KTTUANTJ.js +26 -0
- package/dist/cesium/Workers/chunk-LDCAXLGS.js +26 -0
- package/dist/cesium/Workers/chunk-LOPN5R3I.js +26 -0
- package/dist/cesium/Workers/chunk-MDLPQIMP.js +26 -0
- package/dist/cesium/Workers/chunk-MRR3RGFO.js +26 -0
- package/dist/cesium/Workers/chunk-NPBZI5YA.js +26 -0
- package/dist/cesium/Workers/chunk-NUSW5B6A.js +26 -0
- package/dist/cesium/Workers/chunk-OUXRUXNB.js +26 -0
- package/dist/cesium/Workers/chunk-QPOPEH3M.js +26 -0
- package/dist/cesium/Workers/chunk-R2AN7EKC.js +26 -0
- package/dist/cesium/Workers/chunk-RURL6ZX2.js +26 -0
- package/dist/cesium/Workers/chunk-SUQM3OSW.js +28 -0
- package/dist/cesium/Workers/chunk-UBIRX2SP.js +26 -0
- package/dist/cesium/Workers/chunk-VAKC5J5C.js +26 -0
- package/dist/cesium/Workers/chunk-VHNZBQTR.js +27 -0
- package/dist/cesium/Workers/chunk-VKV642QV.js +26 -0
- package/dist/cesium/Workers/chunk-VMSXG4OA.js +26 -0
- package/dist/cesium/Workers/chunk-VQZSIOZW.js +26 -0
- package/dist/cesium/Workers/chunk-WZUWQMI7.js +26 -0
- package/dist/cesium/Workers/chunk-YBI55DLZ.js +26 -0
- package/dist/cesium/Workers/chunk-YEJWCH6C.js +26 -0
- package/dist/cesium/Workers/chunk-YPDO7SPO.js +26 -0
- package/dist/cesium/Workers/chunk-ZYWD6OQH.js +26 -0
- package/dist/cesium/Workers/combineGeometry.js +26 -0
- package/dist/cesium/Workers/createBoxGeometry.js +26 -0
- package/dist/cesium/Workers/createBoxOutlineGeometry.js +26 -0
- package/dist/cesium/Workers/createCircleGeometry.js +26 -0
- package/dist/cesium/Workers/createCircleOutlineGeometry.js +26 -0
- package/dist/cesium/Workers/createCoplanarPolygonGeometry.js +26 -0
- package/dist/cesium/Workers/createCoplanarPolygonOutlineGeometry.js +26 -0
- package/dist/cesium/Workers/createCorridorGeometry.js +26 -0
- package/dist/cesium/Workers/createCorridorOutlineGeometry.js +26 -0
- package/dist/cesium/Workers/createCylinderGeometry.js +26 -0
- package/dist/cesium/Workers/createCylinderOutlineGeometry.js +26 -0
- package/dist/cesium/Workers/createEllipseGeometry.js +26 -0
- package/dist/cesium/Workers/createEllipseOutlineGeometry.js +26 -0
- package/dist/cesium/Workers/createEllipsoidGeometry.js +26 -0
- package/dist/cesium/Workers/createEllipsoidOutlineGeometry.js +26 -0
- package/dist/cesium/Workers/createFrustumGeometry.js +26 -0
- package/dist/cesium/Workers/createFrustumOutlineGeometry.js +26 -0
- package/dist/cesium/Workers/createGeometry.js +26 -0
- package/dist/cesium/Workers/createGroundPolylineGeometry.js +26 -0
- package/dist/cesium/Workers/createPlaneGeometry.js +26 -0
- package/dist/cesium/Workers/createPlaneOutlineGeometry.js +26 -0
- package/dist/cesium/Workers/createPolygonGeometry.js +26 -0
- package/dist/cesium/Workers/createPolygonOutlineGeometry.js +26 -0
- package/dist/cesium/Workers/createPolylineGeometry.js +26 -0
- package/dist/cesium/Workers/createPolylineVolumeGeometry.js +26 -0
- package/dist/cesium/Workers/createPolylineVolumeOutlineGeometry.js +26 -0
- package/dist/cesium/Workers/createRectangleGeometry.js +26 -0
- package/dist/cesium/Workers/createRectangleOutlineGeometry.js +26 -0
- package/dist/cesium/Workers/createSimplePolylineGeometry.js +26 -0
- package/dist/cesium/Workers/createSphereGeometry.js +26 -0
- package/dist/cesium/Workers/createSphereOutlineGeometry.js +26 -0
- package/dist/cesium/Workers/createTaskProcessorWorker.js +26 -0
- package/dist/cesium/Workers/createVectorTileClampedPolylines.js +26 -0
- package/dist/cesium/Workers/createVectorTileGeometries.js +26 -0
- package/dist/cesium/Workers/createVectorTilePoints.js +26 -0
- package/dist/cesium/Workers/createVectorTilePolygons.js +26 -0
- package/dist/cesium/Workers/createVectorTilePolylines.js +26 -0
- package/dist/cesium/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +26 -0
- package/dist/cesium/Workers/createVerticesFromHeightmap.js +26 -0
- package/dist/cesium/Workers/createVerticesFromQuantizedTerrainMesh.js +26 -0
- package/dist/cesium/Workers/createWallGeometry.js +26 -0
- package/dist/cesium/Workers/createWallOutlineGeometry.js +26 -0
- package/dist/cesium/Workers/decodeDraco.js +26 -0
- package/dist/cesium/Workers/decodeGoogleEarthEnterprisePacket.js +26 -0
- package/dist/cesium/Workers/decodeI3S.js +26 -0
- package/dist/cesium/Workers/transcodeKTX2.js +56 -0
- package/dist/cesium/Workers/transferTypedArrayTest.js +26 -0
- package/dist/cesium/Workers/upsampleQuantizedTerrainMesh.js +26 -0
- package/dist/core.js +83397 -0
- package/dist/core.umd.cjs +6710 -0
- package/dist/index-DqatWUTw.js +3225 -0
- package/dist/index.d.ts +1760 -0
- package/package.json +115 -0
- package/src/Map/ClusteredLayers/index.tsx +106 -0
- package/src/Map/Layer/hooks.ts +180 -0
- package/src/Map/Layer/index.tsx +92 -0
- package/src/Map/Layers/hooks.test.ts +819 -0
- package/src/Map/Layers/hooks.ts +955 -0
- package/src/Map/Layers/index.test.tsx +188 -0
- package/src/Map/Layers/index.tsx +76 -0
- package/src/Map/Layers/keys.ts +51 -0
- package/src/Map/Layers/utils.test.ts +53 -0
- package/src/Map/Layers/utils.ts +37 -0
- package/src/Map/Sketch/hooks.ts +641 -0
- package/src/Map/Sketch/index.tsx +101 -0
- package/src/Map/Sketch/preset.ts +29 -0
- package/src/Map/Sketch/sketchMachine.ts +323 -0
- package/src/Map/Sketch/sketchMachine.typegen.ts +72 -0
- package/src/Map/Sketch/types.ts +52 -0
- package/src/Map/Sketch/utils.ts +24 -0
- package/src/Map/hooks.ts +127 -0
- package/src/Map/index.tsx +147 -0
- package/src/Map/ref.ts +147 -0
- package/src/Map/types/event.ts +104 -0
- package/src/Map/types/index.ts +545 -0
- package/src/Map/useTimelineManager.ts +215 -0
- package/src/Map/utils.test.ts +62 -0
- package/src/Map/utils.ts +71 -0
- package/src/Visualizer/DropHolder.tsx +41 -0
- package/src/Visualizer/Error.tsx +15 -0
- package/src/Visualizer/context.tsx +27 -0
- package/src/Visualizer/coreContext.tsx +47 -0
- package/src/Visualizer/engines.ts +7 -0
- package/src/Visualizer/featureFlags.ts +9 -0
- package/src/Visualizer/hooks.ts +403 -0
- package/src/Visualizer/index.stories.tsx +128 -0
- package/src/Visualizer/index.tsx +187 -0
- package/src/Visualizer/interactionMode.ts +25 -0
- package/src/Visualizer/useViewport.ts +74 -0
- package/src/e2eConfig.ts +20 -0
- package/src/engines/Cesium/Cluster.tsx +90 -0
- package/src/engines/Cesium/Event.tsx +15 -0
- package/src/engines/Cesium/Feature/Box/Edge.tsx +94 -0
- package/src/engines/Cesium/Feature/Box/ScalePoints.tsx +158 -0
- package/src/engines/Cesium/Feature/Box/Side.tsx +70 -0
- package/src/engines/Cesium/Feature/Box/constants.ts +63 -0
- package/src/engines/Cesium/Feature/Box/hooks/box.ts +375 -0
- package/src/engines/Cesium/Feature/Box/hooks/edge.ts +112 -0
- package/src/engines/Cesium/Feature/Box/hooks/scalePoint.ts +174 -0
- package/src/engines/Cesium/Feature/Box/hooks/side.ts +72 -0
- package/src/engines/Cesium/Feature/Box/index.tsx +156 -0
- package/src/engines/Cesium/Feature/Box/utils.ts +168 -0
- package/src/engines/Cesium/Feature/Ellipse/index.stories.tsx +48 -0
- package/src/engines/Cesium/Feature/Ellipse/index.tsx +91 -0
- package/src/engines/Cesium/Feature/Ellipsoid/index.tsx +84 -0
- package/src/engines/Cesium/Feature/Frustum/FrustumColorAppearance.ts +38 -0
- package/src/engines/Cesium/Feature/Frustum/getFieldOfView.ts +23 -0
- package/src/engines/Cesium/Feature/Frustum/index.stories.tsx +49 -0
- package/src/engines/Cesium/Feature/Frustum/index.tsx +163 -0
- package/src/engines/Cesium/Feature/Frustum/shaders/frustumAppearance.frag.glsl +31 -0
- package/src/engines/Cesium/Feature/Frustum/shaders/frustumAppearance.vert.glsl +29 -0
- package/src/engines/Cesium/Feature/HeatMap/HeatmapMesh.tsx +186 -0
- package/src/engines/Cesium/Feature/HeatMap/HeatmapMeshMaterial.ts +81 -0
- package/src/engines/Cesium/Feature/HeatMap/colorMap.ts +47 -0
- package/src/engines/Cesium/Feature/HeatMap/constants.ts +781 -0
- package/src/engines/Cesium/Feature/HeatMap/createMeshImageData.ts +108 -0
- package/src/engines/Cesium/Feature/HeatMap/index.tsx +169 -0
- package/src/engines/Cesium/Feature/HeatMap/shaders/heatmapMeshMaterial.glsl +78 -0
- package/src/engines/Cesium/Feature/HeatMap/shaders/makeContour.glsl +13 -0
- package/src/engines/Cesium/Feature/HeatMap/shaders/sampleBicubic.glsl +57 -0
- package/src/engines/Cesium/Feature/Marker/index.tsx +296 -0
- package/src/engines/Cesium/Feature/Marker/marker.svg +3 -0
- package/src/engines/Cesium/Feature/Model/index.stories.tsx +48 -0
- package/src/engines/Cesium/Feature/Model/index.tsx +223 -0
- package/src/engines/Cesium/Feature/PhotoOverlay/hooks.ts +98 -0
- package/src/engines/Cesium/Feature/PhotoOverlay/index.tsx +163 -0
- package/src/engines/Cesium/Feature/PhotoOverlay/primPhotoIcon.svg +3 -0
- package/src/engines/Cesium/Feature/Polygon/index.stories.tsx +174 -0
- package/src/engines/Cesium/Feature/Polygon/index.tsx +182 -0
- package/src/engines/Cesium/Feature/Polyline/index.tsx +98 -0
- package/src/engines/Cesium/Feature/Raster/hooks.ts +52 -0
- package/src/engines/Cesium/Feature/Raster/index.stories.tsx +77 -0
- package/src/engines/Cesium/Feature/Raster/index.tsx +37 -0
- package/src/engines/Cesium/Feature/Raster/mvt.ts +33 -0
- package/src/engines/Cesium/Feature/Raster/tiles.ts +27 -0
- package/src/engines/Cesium/Feature/Raster/tms.ts +31 -0
- package/src/engines/Cesium/Feature/Raster/types.ts +5 -0
- package/src/engines/Cesium/Feature/Raster/utils.test.ts +14 -0
- package/src/engines/Cesium/Feature/Raster/utils.ts +10 -0
- package/src/engines/Cesium/Feature/Raster/wms.ts +28 -0
- package/src/engines/Cesium/Feature/Resource/index.stories.tsx +46 -0
- package/src/engines/Cesium/Feature/Resource/index.tsx +218 -0
- package/src/engines/Cesium/Feature/Resource/utils.test.ts +69 -0
- package/src/engines/Cesium/Feature/Resource/utils.ts +377 -0
- package/src/engines/Cesium/Feature/Tileset/DrawClippingPolygon/index.tsx +77 -0
- package/src/engines/Cesium/Feature/Tileset/TilesetFeatureIndex.ts +46 -0
- package/src/engines/Cesium/Feature/Tileset/hooks.ts +793 -0
- package/src/engines/Cesium/Feature/Tileset/index.stories.tsx +41 -0
- package/src/engines/Cesium/Feature/Tileset/index.tsx +127 -0
- package/src/engines/Cesium/Feature/Tileset/types.ts +5 -0
- package/src/engines/Cesium/Feature/Tileset/useClippingBox.ts +457 -0
- package/src/engines/Cesium/Feature/Tileset/useDrawClipping.ts +200 -0
- package/src/engines/Cesium/Feature/context.ts +33 -0
- package/src/engines/Cesium/Feature/index.tsx +250 -0
- package/src/engines/Cesium/Feature/utils.test.tsx +30 -0
- package/src/engines/Cesium/Feature/utils.tsx +289 -0
- package/src/engines/Cesium/FeatureIndex.ts +15 -0
- package/src/engines/Cesium/JapanSeaLevelEllipsoid.ts +20 -0
- package/src/engines/Cesium/PostProcesses/README.md +1 -0
- package/src/engines/Cesium/PostProcesses/hbao/AmbientOcclusion.tsx +120 -0
- package/src/engines/Cesium/PostProcesses/hbao/AmbientOcclusionOutputType.ts +7 -0
- package/src/engines/Cesium/PostProcesses/hbao/README.md +3 -0
- package/src/engines/Cesium/PostProcesses/hbao/config.ts +29 -0
- package/src/engines/Cesium/PostProcesses/hbao/createAmbientOcclusionStage.ts +173 -0
- package/src/engines/Cesium/PostProcesses/hbao/createCrossBilateralFilterStage.ts +94 -0
- package/src/engines/Cesium/PostProcesses/hbao/index.ts +3 -0
- package/src/engines/Cesium/PostProcesses/hbao/shaders/ambientOcclusionGenerate.glsl +151 -0
- package/src/engines/Cesium/PostProcesses/hbao/shaders/ambientOcclusionModulate.glsl +46 -0
- package/src/engines/Cesium/PostProcesses/hbao/shaders/crossBilateralFilter.glsl +108 -0
- package/src/engines/Cesium/PostProcesses/hbao/shaders/depth.glsl +3 -0
- package/src/engines/Cesium/PostProcesses/hbao/shaders/globeDepth.glsl +15 -0
- package/src/engines/Cesium/PostProcesses/hbao/shaders/highPassRandom.glsl +28 -0
- package/src/engines/Cesium/PostProcesses/hbao/shaders/packing.glsl +7 -0
- package/src/engines/Cesium/PostProcesses/hbao/shaders/reconstructNormal.glsl +109 -0
- package/src/engines/Cesium/PostProcesses/hbao/shaders/reconstructPosition.glsl +10 -0
- package/src/engines/Cesium/PostProcesses/hbao/shaders/turboColorMap.glsl +20 -0
- package/src/engines/Cesium/PostProcesses/hbao/shaders/vogelDisk.glsl +13 -0
- package/src/engines/Cesium/Shaders/CustomShaders/NonPBRLightingShader.ts +66 -0
- package/src/engines/Cesium/Shaders/OverriddenShaders/GlobeFS/Definitions.glsl +5 -0
- package/src/engines/Cesium/Shaders/OverriddenShaders/GlobeFS/HeatmapForTerrain.glsl +13 -0
- package/src/engines/Cesium/Shaders/OverriddenShaders/GlobeFS/IBL.glsl +57 -0
- package/src/engines/Cesium/Shaders/OverriddenShaders/README.md +13 -0
- package/src/engines/Cesium/Sketch/ControlPoint.tsx +67 -0
- package/src/engines/Cesium/Sketch/Entity.tsx +43 -0
- package/src/engines/Cesium/Sketch/ExtrudedControlPoints.tsx +51 -0
- package/src/engines/Cesium/Sketch/ExtrudedMeasurement.tsx +70 -0
- package/src/engines/Cesium/Sketch/ExtrudedPolygonEntity.tsx +75 -0
- package/src/engines/Cesium/Sketch/MeasurementText.tsx +13 -0
- package/src/engines/Cesium/Sketch/PolygonEntity.tsx +48 -0
- package/src/engines/Cesium/Sketch/PolylineEntity.tsx +44 -0
- package/src/engines/Cesium/Sketch/ScreenSpaceElement.tsx +87 -0
- package/src/engines/Cesium/Sketch/SurfaceControlPoints.tsx +67 -0
- package/src/engines/Cesium/Sketch/SurfaceMeasurement.tsx +80 -0
- package/src/engines/Cesium/Sketch/createGeometry.ts +224 -0
- package/src/engines/Cesium/Sketch/index.tsx +119 -0
- package/src/engines/Cesium/Sketch/utils.ts +27 -0
- package/src/engines/Cesium/VertexTerrainElevationMaterial.ts +33 -0
- package/src/engines/Cesium/cameraLimiter.ts +256 -0
- package/src/engines/Cesium/common.test.ts +38 -0
- package/src/engines/Cesium/common.ts +901 -0
- package/src/engines/Cesium/constants.ts +25 -0
- package/src/engines/Cesium/core/Clock.tsx +58 -0
- package/src/engines/Cesium/core/Globe.tsx +136 -0
- package/src/engines/Cesium/core/Imagery.test.ts +102 -0
- package/src/engines/Cesium/core/Imagery.tsx +184 -0
- package/src/engines/Cesium/core/Indicator/Indicator.tsx +141 -0
- package/src/engines/Cesium/core/Indicator/crosshair.svg +3 -0
- package/src/engines/Cesium/core/labels/JapanGSIOptimalBVmapVectorMapLabel/JapanGSIOptimalBVmapLabelImagery.tsx +321 -0
- package/src/engines/Cesium/core/labels/JapanGSIOptimalBVmapVectorMapLabel/JapanGSIOptimalBVmapLabelImageryLayer.tsx +56 -0
- package/src/engines/Cesium/core/labels/JapanGSIOptimalBVmapVectorMapLabel/JapanGSIOptimalBVmapLabelImageryProvider.ts +146 -0
- package/src/engines/Cesium/core/labels/JapanGSIOptimalBVmapVectorMapLabel/JapanGSIOptimalBVmapVectorMapLabel.tsx +258 -0
- package/src/engines/Cesium/core/labels/JapanGSIOptimalBVmapVectorMapLabel/getAnnotationType.ts +117 -0
- package/src/engines/Cesium/core/labels/JapanGSIOptimalBVmapVectorMapLabel/helpers.ts +24 -0
- package/src/engines/Cesium/core/labels/JapanGSIOptimalBVmapVectorMapLabel/index.ts +3 -0
- package/src/engines/Cesium/core/labels/JapanGSIOptimalBVmapVectorMapLabel/types.ts +26 -0
- package/src/engines/Cesium/core/labels/LabelImageryLayers.tsx +39 -0
- package/src/engines/Cesium/core/presets.ts +95 -0
- package/src/engines/Cesium/helpers/createUniforms.ts +64 -0
- package/src/engines/Cesium/helpers/sphericalHaromic.test.ts +33 -0
- package/src/engines/Cesium/helpers/sphericalHaromic.ts +27 -0
- package/src/engines/Cesium/hooks/useInstance.ts +98 -0
- package/src/engines/Cesium/hooks/useLayerSelectWithRect.ts +157 -0
- package/src/engines/Cesium/hooks/useSceneEvent.ts +47 -0
- package/src/engines/Cesium/hooks.ts +1004 -0
- package/src/engines/Cesium/index.stories.tsx +42 -0
- package/src/engines/Cesium/index.tsx +285 -0
- package/src/engines/Cesium/pickMany.ts +310 -0
- package/src/engines/Cesium/type.d.ts +47 -0
- package/src/engines/Cesium/types.ts +24 -0
- package/src/engines/Cesium/useEngineRef.test.tsx +627 -0
- package/src/engines/Cesium/useEngineRef.ts +945 -0
- package/src/engines/Cesium/useOverrideGlobeShader.ts +322 -0
- package/src/engines/Cesium/utils/mouse.ts +16 -0
- package/src/engines/Cesium/utils/polygon.ts +48 -0
- package/src/engines/Cesium/utils/utils.ts +446 -0
- package/src/engines/Cesium/vertexTerrainElevationMaterial.glsl +25 -0
- package/src/engines/index.ts +37 -0
- package/src/env.d.ts +3 -0
- package/src/hooks/index.ts +2 -0
- package/src/hooks/useRefFunction.ts +10 -0
- package/src/hooks/useRefValue.ts +7 -0
- package/src/index.ts +4 -0
- package/src/mantle/README.md +7 -0
- package/src/mantle/atoms/cache.test.ts +61 -0
- package/src/mantle/atoms/cache.ts +55 -0
- package/src/mantle/atoms/compute.test.ts +794 -0
- package/src/mantle/atoms/compute.ts +344 -0
- package/src/mantle/atoms/data.test.ts +182 -0
- package/src/mantle/atoms/data.ts +114 -0
- package/src/mantle/atoms/index.ts +1 -0
- package/src/mantle/compat/backward.test.ts +368 -0
- package/src/mantle/compat/backward.ts +189 -0
- package/src/mantle/compat/forward.test.ts +688 -0
- package/src/mantle/compat/forward.ts +272 -0
- package/src/mantle/compat/index.ts +4 -0
- package/src/mantle/compat/types.ts +73 -0
- package/src/mantle/data/csv.test.ts +478 -0
- package/src/mantle/data/csv.ts +194 -0
- package/src/mantle/data/geojson.ts +72 -0
- package/src/mantle/data/georss.ts +172 -0
- package/src/mantle/data/gml.ts +244 -0
- package/src/mantle/data/gpx.test.ts +65 -0
- package/src/mantle/data/gpx.ts +551 -0
- package/src/mantle/data/gtfs.ts +116 -0
- package/src/mantle/data/gtfsReader.ts +454 -0
- package/src/mantle/data/index.test.ts +16 -0
- package/src/mantle/data/index.ts +73 -0
- package/src/mantle/data/shapefile.ts +232 -0
- package/src/mantle/data/utils.ts +21 -0
- package/src/mantle/evaluator/index.ts +40 -0
- package/src/mantle/evaluator/simple/conditionalExpression/index.ts +60 -0
- package/src/mantle/evaluator/simple/expression/constants.ts +204 -0
- package/src/mantle/evaluator/simple/expression/expression.test.ts +63 -0
- package/src/mantle/evaluator/simple/expression/expression.ts +116 -0
- package/src/mantle/evaluator/simple/expression/functions/binaryFunctions.ts +43 -0
- package/src/mantle/evaluator/simple/expression/functions/colors.ts +189 -0
- package/src/mantle/evaluator/simple/expression/functions/index.ts +3 -0
- package/src/mantle/evaluator/simple/expression/functions/unaryFunctions.ts +54 -0
- package/src/mantle/evaluator/simple/expression/index.ts +1 -0
- package/src/mantle/evaluator/simple/expression/node.ts +570 -0
- package/src/mantle/evaluator/simple/expression/runtime.ts +266 -0
- package/src/mantle/evaluator/simple/expression/variableReplacer.test.ts +54 -0
- package/src/mantle/evaluator/simple/expression/variableReplacer.ts +121 -0
- package/src/mantle/evaluator/simple/index.test.ts +656 -0
- package/src/mantle/evaluator/simple/index.ts +178 -0
- package/src/mantle/evaluator/simple/interval.test.ts +102 -0
- package/src/mantle/evaluator/simple/interval.ts +27 -0
- package/src/mantle/evaluator/simple/utils.test.ts +56 -0
- package/src/mantle/evaluator/simple/utils.ts +31 -0
- package/src/mantle/index.ts +6 -0
- package/src/mantle/types/appearance.ts +318 -0
- package/src/mantle/types/events.ts +16 -0
- package/src/mantle/types/expression.ts +9 -0
- package/src/mantle/types/index.ts +156 -0
- package/src/mantle/types/value.ts +153 -0
- package/src/mantle/utils.test.ts +74 -0
- package/src/mantle/utils.ts +53 -0
- package/src/reearthTypes.ts +64 -0
- package/src/setupTests.ts +1 -0
- package/src/test/setup.ts +40 -0
- package/src/test/utils.tsx +40 -0
- package/src/types.ts +66 -0
- package/src/utils/StringMatcher.test.ts +132 -0
- package/src/utils/StringMatcher.ts +104 -0
- package/src/utils/assertType.ts +1 -0
- package/src/utils/generate-random-string.ts +9 -0
- package/src/utils/idle.ts +22 -0
- package/src/utils/image.ts +35 -0
- package/src/utils/index.ts +11 -0
- package/src/utils/object.ts +70 -0
- package/src/utils/raf.ts +58 -0
- package/src/utils/time.ts +18 -0
- package/src/utils/use-delayed-count.test.ts +139 -0
- package/src/utils/use-delayed-count.ts +65 -0
- package/src/utils/use-dnd/drag.ts +34 -0
- package/src/utils/use-dnd/drop.ts +93 -0
- package/src/utils/use-dnd/index.tsx +20 -0
- package/src/utils/use-dnd/types.ts +47 -0
- package/src/utils/util.ts +81 -0
- package/src/utils/value.ts +260 -0
- package/src/vite-env.d.ts +1 -0
|
@@ -0,0 +1,551 @@
|
|
|
1
|
+
import type { LineString, Position, GeoJsonProperties } from "geojson";
|
|
2
|
+
|
|
3
|
+
import type { Data, DataRange, Feature } from "../types";
|
|
4
|
+
|
|
5
|
+
import { f, FetchOptions, generateRandomString } from "./utils";
|
|
6
|
+
|
|
7
|
+
export async function fetchGPXfile(
|
|
8
|
+
data: Data,
|
|
9
|
+
_range?: DataRange,
|
|
10
|
+
options?: FetchOptions,
|
|
11
|
+
): Promise<Feature[] | void> {
|
|
12
|
+
const xmlDataStr = data.url ? await (await f(data.url, options)).text() : data.value;
|
|
13
|
+
return handler(xmlDataStr);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const handler = (xmlDataStr: string) => {
|
|
17
|
+
const [featureList, error] = parseGPX(xmlDataStr);
|
|
18
|
+
// Or use a try catch to verify
|
|
19
|
+
if (error) throw error;
|
|
20
|
+
if (featureList instanceof Error) throw featureList;
|
|
21
|
+
return featureList || [];
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
const parseGPX = (gpxSource: string) => {
|
|
25
|
+
const parseMethod = (gpxSource: string): Document | null => {
|
|
26
|
+
// Verify that we are in a browser
|
|
27
|
+
if (typeof document == undefined) return null;
|
|
28
|
+
|
|
29
|
+
const domParser = new window.DOMParser();
|
|
30
|
+
return domParser.parseFromString(gpxSource, "text/xml");
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
return parseGPXWithCustomParser(gpxSource, parseMethod);
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
const parseGPXWithCustomParser = (
|
|
37
|
+
gpxSource: string,
|
|
38
|
+
parseGPXToXML: (gpxSource: string) => Document | null,
|
|
39
|
+
) => {
|
|
40
|
+
const parsedSource = parseGPXToXML(gpxSource);
|
|
41
|
+
|
|
42
|
+
if (parsedSource === null) return [null, new Error("Provided parsing method failed.")];
|
|
43
|
+
|
|
44
|
+
const output: ParsedGPXInputs = {
|
|
45
|
+
xml: parsedSource,
|
|
46
|
+
metadata: {
|
|
47
|
+
name: "",
|
|
48
|
+
description: "",
|
|
49
|
+
time: "",
|
|
50
|
+
author: null,
|
|
51
|
+
link: null,
|
|
52
|
+
},
|
|
53
|
+
waypoints: [],
|
|
54
|
+
tracks: [],
|
|
55
|
+
routes: [],
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
const metadata = output.xml.querySelector("metadata");
|
|
59
|
+
if (metadata !== null) {
|
|
60
|
+
output.metadata.name = getElementValue(metadata, "name");
|
|
61
|
+
output.metadata.description = getElementValue(metadata, "desc");
|
|
62
|
+
output.metadata.time = getElementValue(metadata, "time");
|
|
63
|
+
|
|
64
|
+
const authorElement = metadata.querySelector("author");
|
|
65
|
+
if (authorElement !== null) {
|
|
66
|
+
const emailElement = authorElement.querySelector("email");
|
|
67
|
+
const linkElement = authorElement.querySelector("link");
|
|
68
|
+
|
|
69
|
+
output.metadata.author = {
|
|
70
|
+
name: getElementValue(authorElement, "name"),
|
|
71
|
+
email:
|
|
72
|
+
emailElement !== null
|
|
73
|
+
? {
|
|
74
|
+
id: emailElement.getAttribute("id") ?? "",
|
|
75
|
+
domain: emailElement.getAttribute("domain") ?? "",
|
|
76
|
+
}
|
|
77
|
+
: null,
|
|
78
|
+
link:
|
|
79
|
+
linkElement !== null
|
|
80
|
+
? {
|
|
81
|
+
href: linkElement.getAttribute("href") ?? "",
|
|
82
|
+
text: getElementValue(linkElement, "text"),
|
|
83
|
+
type: getElementValue(linkElement, "type"),
|
|
84
|
+
}
|
|
85
|
+
: null,
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
const linkElement = queryDirectSelector(metadata, "link");
|
|
90
|
+
if (linkElement !== null) {
|
|
91
|
+
output.metadata.link = {
|
|
92
|
+
href: linkElement.getAttribute("href") ?? "",
|
|
93
|
+
text: getElementValue(linkElement, "text"),
|
|
94
|
+
type: getElementValue(linkElement, "type"),
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
const waypoints = Array.from(output.xml.querySelectorAll("wpt"));
|
|
100
|
+
for (const waypoint of waypoints) {
|
|
101
|
+
const point: Waypoint = {
|
|
102
|
+
name: getElementValue(waypoint, "name"),
|
|
103
|
+
symbol: getElementValue(waypoint, "sym"),
|
|
104
|
+
latitude: parseFloat(waypoint.getAttribute("lat") ?? "0"),
|
|
105
|
+
longitude: parseFloat(waypoint.getAttribute("lon") ?? "0"),
|
|
106
|
+
elevation: null,
|
|
107
|
+
comment: getElementValue(waypoint, "cmt"),
|
|
108
|
+
description: getElementValue(waypoint, "desc"),
|
|
109
|
+
time: null,
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
const rawElevation = parseFloat(getElementValue(waypoint, "ele")) || 0;
|
|
113
|
+
point.elevation = isNaN(rawElevation) ? null : rawElevation;
|
|
114
|
+
|
|
115
|
+
const rawTime = getElementValue(waypoint, "time");
|
|
116
|
+
point.time = rawTime == null ? null : new Date(rawTime);
|
|
117
|
+
|
|
118
|
+
output.waypoints.push(point);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
const routes = Array.from(output.xml.querySelectorAll("rte"));
|
|
122
|
+
for (const routeElement of routes) {
|
|
123
|
+
const route: Route = {
|
|
124
|
+
name: getElementValue(routeElement, "name"),
|
|
125
|
+
comment: getElementValue(routeElement, "cmt"),
|
|
126
|
+
description: getElementValue(routeElement, "desc"),
|
|
127
|
+
src: getElementValue(routeElement, "src"),
|
|
128
|
+
number: getElementValue(routeElement, "number"),
|
|
129
|
+
type: null,
|
|
130
|
+
link: null,
|
|
131
|
+
points: [],
|
|
132
|
+
distance: {
|
|
133
|
+
cumulative: [],
|
|
134
|
+
total: 0,
|
|
135
|
+
},
|
|
136
|
+
elevation: {
|
|
137
|
+
maximum: null,
|
|
138
|
+
minimum: null,
|
|
139
|
+
average: null,
|
|
140
|
+
positive: null,
|
|
141
|
+
negative: null,
|
|
142
|
+
},
|
|
143
|
+
slopes: [],
|
|
144
|
+
};
|
|
145
|
+
|
|
146
|
+
const type = queryDirectSelector(routeElement, "type");
|
|
147
|
+
route.type = type !== null ? type.innerHTML : null;
|
|
148
|
+
|
|
149
|
+
const linkElement = routeElement.querySelector("link");
|
|
150
|
+
if (linkElement !== null) {
|
|
151
|
+
route.link = {
|
|
152
|
+
href: linkElement.getAttribute("href") ?? "",
|
|
153
|
+
text: getElementValue(linkElement, "text"),
|
|
154
|
+
type: getElementValue(linkElement, "type"),
|
|
155
|
+
};
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
const routePoints = Array.from(routeElement.querySelectorAll("rtept"));
|
|
159
|
+
for (const routePoint of routePoints) {
|
|
160
|
+
const point: Point = {
|
|
161
|
+
latitude: parseFloat(routePoint.getAttribute("lat") ?? "0"),
|
|
162
|
+
longitude: parseFloat(routePoint.getAttribute("lon") ?? "0"),
|
|
163
|
+
elevation: null,
|
|
164
|
+
time: null,
|
|
165
|
+
extensions: null,
|
|
166
|
+
};
|
|
167
|
+
|
|
168
|
+
const rawElevation = parseFloat(getElementValue(routePoint, "ele") ?? "0");
|
|
169
|
+
point.elevation = isNaN(rawElevation) ? null : rawElevation;
|
|
170
|
+
|
|
171
|
+
const rawTime = getElementValue(routePoint, "time");
|
|
172
|
+
point.time = rawTime == null ? null : new Date(rawTime);
|
|
173
|
+
|
|
174
|
+
route.points.push(point);
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
route.distance = calculateDistance(route.points);
|
|
178
|
+
route.elevation = calculateElevation(route.points);
|
|
179
|
+
route.slopes = calculateSlopes(route.points, route.distance.cumulative);
|
|
180
|
+
|
|
181
|
+
output.routes.push(route);
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
const tracks = Array.from(output.xml.querySelectorAll("trk"));
|
|
185
|
+
for (const trackElement of tracks) {
|
|
186
|
+
const track: Track = {
|
|
187
|
+
name: getElementValue(trackElement, "name"),
|
|
188
|
+
comment: getElementValue(trackElement, "cmt"),
|
|
189
|
+
description: getElementValue(trackElement, "desc"),
|
|
190
|
+
src: getElementValue(trackElement, "src"),
|
|
191
|
+
number: getElementValue(trackElement, "number"),
|
|
192
|
+
type: null,
|
|
193
|
+
link: null,
|
|
194
|
+
points: [],
|
|
195
|
+
distance: {
|
|
196
|
+
cumulative: [],
|
|
197
|
+
total: 0,
|
|
198
|
+
},
|
|
199
|
+
elevation: {
|
|
200
|
+
maximum: null,
|
|
201
|
+
minimum: null,
|
|
202
|
+
average: null,
|
|
203
|
+
positive: null,
|
|
204
|
+
negative: null,
|
|
205
|
+
},
|
|
206
|
+
slopes: [],
|
|
207
|
+
};
|
|
208
|
+
|
|
209
|
+
const type = queryDirectSelector(trackElement, "type");
|
|
210
|
+
track.type = type !== null ? type.innerHTML : null;
|
|
211
|
+
|
|
212
|
+
// Parse and store the link and its associated data
|
|
213
|
+
const linkElement = trackElement.querySelector("link");
|
|
214
|
+
if (linkElement !== null) {
|
|
215
|
+
track.link = {
|
|
216
|
+
href: linkElement.getAttribute("href") ?? "",
|
|
217
|
+
text: getElementValue(linkElement, "text"),
|
|
218
|
+
type: getElementValue(linkElement, "type"),
|
|
219
|
+
};
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
// Parse and store all track points
|
|
223
|
+
const trackPoints = Array.from(trackElement.querySelectorAll("trkpt"));
|
|
224
|
+
for (const trackPoint of trackPoints) {
|
|
225
|
+
const point: Point = {
|
|
226
|
+
latitude: parseFloat(trackPoint.getAttribute("lat") ?? "0"),
|
|
227
|
+
longitude: parseFloat(trackPoint.getAttribute("lon") ?? "0"),
|
|
228
|
+
elevation: null,
|
|
229
|
+
time: null,
|
|
230
|
+
extensions: null,
|
|
231
|
+
};
|
|
232
|
+
|
|
233
|
+
// Parse any extensions and store them in an object
|
|
234
|
+
const extensionsElement = trackPoint.querySelector("extensions");
|
|
235
|
+
if (extensionsElement !== null) {
|
|
236
|
+
const extensions: any = {};
|
|
237
|
+
|
|
238
|
+
// Store all available extensions as numbers
|
|
239
|
+
for (const extension of Array.from(extensionsElement.childNodes)) {
|
|
240
|
+
const name = extension.nodeName;
|
|
241
|
+
|
|
242
|
+
// Parse the extension data with support for the browser or an xml parser
|
|
243
|
+
extensions[name] = parseFloat(
|
|
244
|
+
(extension as Element).innerHTML != undefined
|
|
245
|
+
? (extension as Element).innerHTML
|
|
246
|
+
: (extension as Element).childNodes[0].textContent ?? "",
|
|
247
|
+
);
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
point.extensions = extensions;
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
const rawElevation = parseFloat(getElementValue(trackPoint, "ele")) || 0;
|
|
254
|
+
point.elevation = isNaN(rawElevation) ? null : rawElevation;
|
|
255
|
+
|
|
256
|
+
const rawTime = getElementValue(trackPoint, "time");
|
|
257
|
+
point.time = rawTime == null ? null : new Date(rawTime);
|
|
258
|
+
|
|
259
|
+
track.points.push(point);
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
track.distance = calculateDistance(track.points);
|
|
263
|
+
track.elevation = calculateElevation(track.points);
|
|
264
|
+
track.slopes = calculateSlopes(track.points, track.distance.cumulative);
|
|
265
|
+
|
|
266
|
+
output.tracks.push(track);
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
return [listFeatureCollection(output), null];
|
|
270
|
+
};
|
|
271
|
+
|
|
272
|
+
const listFeatureCollection = (output: ParsedGPXInputs) => {
|
|
273
|
+
const result: Feature[] = [];
|
|
274
|
+
|
|
275
|
+
// Converts a track or route to a feature and adds it to the output object
|
|
276
|
+
const addFeature = (track: Track | Route) => {
|
|
277
|
+
const { name, comment, description, src, number, link, type, points } = track;
|
|
278
|
+
const coordinates: Position[] = [];
|
|
279
|
+
const properties: GeoJsonProperties = {
|
|
280
|
+
name,
|
|
281
|
+
comment,
|
|
282
|
+
description,
|
|
283
|
+
src,
|
|
284
|
+
number,
|
|
285
|
+
link,
|
|
286
|
+
type,
|
|
287
|
+
};
|
|
288
|
+
for (const point of points) {
|
|
289
|
+
const { longitude, latitude, elevation } = point;
|
|
290
|
+
const position: Position = [Number(longitude), Number(latitude), Number(elevation)];
|
|
291
|
+
coordinates.push(position);
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
result.push(getLineStringFeature(coordinates, properties));
|
|
295
|
+
};
|
|
296
|
+
|
|
297
|
+
for (const track of [...output.tracks, ...output.routes]) {
|
|
298
|
+
addFeature(track);
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
// Convert waypoints into features and add them to the output object
|
|
302
|
+
for (const waypoint of output.waypoints) {
|
|
303
|
+
const { name, symbol, comment, description, longitude, latitude, elevation } = waypoint;
|
|
304
|
+
|
|
305
|
+
const feature: Feature = {
|
|
306
|
+
type: "feature",
|
|
307
|
+
id: generateRandomString(12),
|
|
308
|
+
geometry: {
|
|
309
|
+
type: "Point",
|
|
310
|
+
coordinates: [longitude, latitude, elevation || 0],
|
|
311
|
+
},
|
|
312
|
+
properties: { name, symbol, comment, description },
|
|
313
|
+
};
|
|
314
|
+
|
|
315
|
+
result.push(feature);
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
return result;
|
|
319
|
+
};
|
|
320
|
+
|
|
321
|
+
const getElementValue = (parent: Element, tag: string): string => {
|
|
322
|
+
const element = parent.querySelector(tag);
|
|
323
|
+
|
|
324
|
+
// Extract and return the value within the parent element
|
|
325
|
+
if (element !== null) {
|
|
326
|
+
return element.innerHTML != undefined
|
|
327
|
+
? element.innerHTML
|
|
328
|
+
: element.childNodes[0].textContent ?? "";
|
|
329
|
+
} else return "";
|
|
330
|
+
};
|
|
331
|
+
|
|
332
|
+
const queryDirectSelector = (parent: Element, tag: string): Element | null => {
|
|
333
|
+
const elements = parent.querySelectorAll(tag);
|
|
334
|
+
|
|
335
|
+
// End immediately if there are no matching elements
|
|
336
|
+
if (elements.length === 0) return null;
|
|
337
|
+
|
|
338
|
+
let finalElem = elements[0];
|
|
339
|
+
|
|
340
|
+
// Find the last node that fits the given tag within the parent
|
|
341
|
+
if (elements.length > 1) {
|
|
342
|
+
const directChildren = parent.childNodes;
|
|
343
|
+
|
|
344
|
+
// Find all nodes that match the given tag within the parent
|
|
345
|
+
for (const child of Array.from(directChildren)) {
|
|
346
|
+
if ((child as Element).tagName === tag.toUpperCase()) {
|
|
347
|
+
finalElem = child as Element;
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
return finalElem;
|
|
353
|
+
};
|
|
354
|
+
|
|
355
|
+
const calculateDistance = (points: Point[]): Distance => {
|
|
356
|
+
const cumulativeDistance = [0];
|
|
357
|
+
|
|
358
|
+
// Incrementally calculate the distance between adjacent points until
|
|
359
|
+
// all of the distances have been accumulated
|
|
360
|
+
for (let i = 0; i < points.length - 1; i++) {
|
|
361
|
+
const currentTotalDistance =
|
|
362
|
+
cumulativeDistance[i] + haversineDistance(points[i], points[i + 1]);
|
|
363
|
+
cumulativeDistance.push(currentTotalDistance);
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
return {
|
|
367
|
+
cumulative: cumulativeDistance,
|
|
368
|
+
total: cumulativeDistance[cumulativeDistance.length - 1],
|
|
369
|
+
};
|
|
370
|
+
};
|
|
371
|
+
|
|
372
|
+
const haversineDistance = (point1: Point, point2: Point): number => {
|
|
373
|
+
const toRadians = (degrees: number) => (degrees * Math.PI) / 180;
|
|
374
|
+
|
|
375
|
+
const lat1Radians = toRadians(point1.latitude);
|
|
376
|
+
const lat2Radians = toRadians(point2.latitude);
|
|
377
|
+
const sinDeltaLatitude = Math.sin(toRadians(point2.latitude - point1.latitude) / 2);
|
|
378
|
+
const sinDeltaLongitude = Math.sin(toRadians(point2.longitude - point1.longitude) / 2);
|
|
379
|
+
const a =
|
|
380
|
+
sinDeltaLatitude ** 2 + Math.cos(lat1Radians) * Math.cos(lat2Radians) * sinDeltaLongitude ** 2;
|
|
381
|
+
const c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));
|
|
382
|
+
return 6371000 * c;
|
|
383
|
+
};
|
|
384
|
+
|
|
385
|
+
const calculateElevation = (points: Point[]): Elevation => {
|
|
386
|
+
let dp = 0;
|
|
387
|
+
let dn = 0;
|
|
388
|
+
const elevation = [];
|
|
389
|
+
let sum = 0;
|
|
390
|
+
|
|
391
|
+
// Calculate the positive and negative changes over the whole set of points
|
|
392
|
+
for (let i = 0; i < points.length - 1; i++) {
|
|
393
|
+
const nextElevation = points[i + 1]?.elevation;
|
|
394
|
+
const currentElevation = points[i]?.elevation;
|
|
395
|
+
|
|
396
|
+
if (nextElevation !== null && currentElevation !== null) {
|
|
397
|
+
const diff = nextElevation - currentElevation;
|
|
398
|
+
if (diff < 0) dn += diff;
|
|
399
|
+
else if (diff > 0) dp += diff;
|
|
400
|
+
}
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
// Store all elevations and calculate the sum of the elevations
|
|
404
|
+
for (const point of points) {
|
|
405
|
+
if (point.elevation !== null) {
|
|
406
|
+
elevation.push(point.elevation);
|
|
407
|
+
sum += point.elevation;
|
|
408
|
+
}
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
return {
|
|
412
|
+
maximum: elevation.length ? Math.max(...elevation) : null,
|
|
413
|
+
minimum: elevation.length ? Math.min(...elevation) : null,
|
|
414
|
+
positive: Math.abs(dp) || null,
|
|
415
|
+
negative: Math.abs(dn) || null,
|
|
416
|
+
average: elevation.length ? sum / elevation.length : null,
|
|
417
|
+
};
|
|
418
|
+
};
|
|
419
|
+
|
|
420
|
+
const calculateSlopes = (points: Point[], cumulativeDistance: number[]): number[] => {
|
|
421
|
+
const slopes = [];
|
|
422
|
+
|
|
423
|
+
for (let i = 0; i < points.length - 1; i++) {
|
|
424
|
+
const nextElevation = points[i + 1]?.elevation;
|
|
425
|
+
const currentElevation = points[i]?.elevation;
|
|
426
|
+
|
|
427
|
+
if (nextElevation !== null && currentElevation !== null) {
|
|
428
|
+
const elevationDifference = nextElevation - currentElevation;
|
|
429
|
+
const displacement = cumulativeDistance[i + 1] - cumulativeDistance[i];
|
|
430
|
+
|
|
431
|
+
// Calculate the elevation grade as a percentage
|
|
432
|
+
const slope = (elevationDifference * 100) / displacement;
|
|
433
|
+
slopes.push(slope);
|
|
434
|
+
}
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
return slopes;
|
|
438
|
+
};
|
|
439
|
+
|
|
440
|
+
const getLineStringFeature = (coordinates: Position[], properties?: GeoJsonProperties): Feature => {
|
|
441
|
+
if (coordinates.length < 2) {
|
|
442
|
+
throw new Error("coordinates must be an array of two or more positions");
|
|
443
|
+
}
|
|
444
|
+
const geom: LineString = {
|
|
445
|
+
type: "LineString",
|
|
446
|
+
coordinates,
|
|
447
|
+
};
|
|
448
|
+
return makeFeature(geom, properties);
|
|
449
|
+
};
|
|
450
|
+
|
|
451
|
+
const makeFeature = (geom: LineString, properties?: GeoJsonProperties): Feature => {
|
|
452
|
+
const feat: Feature = { type: "feature", id: generateRandomString(12) };
|
|
453
|
+
feat.properties = properties || {};
|
|
454
|
+
feat.geometry = geom;
|
|
455
|
+
return feat;
|
|
456
|
+
};
|
|
457
|
+
|
|
458
|
+
type MetaData = {
|
|
459
|
+
name: string;
|
|
460
|
+
description: string;
|
|
461
|
+
link: Link | null;
|
|
462
|
+
author: Author | null;
|
|
463
|
+
time: string;
|
|
464
|
+
};
|
|
465
|
+
|
|
466
|
+
type Waypoint = {
|
|
467
|
+
name: string;
|
|
468
|
+
symbol: string;
|
|
469
|
+
comment: string;
|
|
470
|
+
description: string;
|
|
471
|
+
latitude: number;
|
|
472
|
+
longitude: number;
|
|
473
|
+
elevation: number | null;
|
|
474
|
+
time: Date | null;
|
|
475
|
+
};
|
|
476
|
+
|
|
477
|
+
type Track = {
|
|
478
|
+
name: string;
|
|
479
|
+
comment: string;
|
|
480
|
+
description: string;
|
|
481
|
+
src: string;
|
|
482
|
+
number: string;
|
|
483
|
+
link: Link | null;
|
|
484
|
+
type: string | null;
|
|
485
|
+
points: Point[];
|
|
486
|
+
distance: Distance;
|
|
487
|
+
elevation: Elevation;
|
|
488
|
+
slopes: number[];
|
|
489
|
+
};
|
|
490
|
+
|
|
491
|
+
type Route = {
|
|
492
|
+
name: string;
|
|
493
|
+
comment: string;
|
|
494
|
+
description: string;
|
|
495
|
+
src: string;
|
|
496
|
+
number: string;
|
|
497
|
+
link: Link | null;
|
|
498
|
+
type: string | null;
|
|
499
|
+
points: Point[];
|
|
500
|
+
distance: Distance;
|
|
501
|
+
elevation: Elevation;
|
|
502
|
+
slopes: number[];
|
|
503
|
+
};
|
|
504
|
+
|
|
505
|
+
type Point = {
|
|
506
|
+
latitude: number;
|
|
507
|
+
longitude: number;
|
|
508
|
+
elevation: number | null;
|
|
509
|
+
time: Date | null;
|
|
510
|
+
extensions: {
|
|
511
|
+
[key: string]: number;
|
|
512
|
+
} | null;
|
|
513
|
+
};
|
|
514
|
+
|
|
515
|
+
type Distance = {
|
|
516
|
+
total: number;
|
|
517
|
+
cumulative: number[];
|
|
518
|
+
};
|
|
519
|
+
|
|
520
|
+
type Elevation = {
|
|
521
|
+
maximum: number | null;
|
|
522
|
+
minimum: number | null;
|
|
523
|
+
positive: number | null;
|
|
524
|
+
negative: number | null;
|
|
525
|
+
average: number | null;
|
|
526
|
+
};
|
|
527
|
+
|
|
528
|
+
type Author = {
|
|
529
|
+
name: string | null;
|
|
530
|
+
email: Email | null;
|
|
531
|
+
link: Link | null;
|
|
532
|
+
};
|
|
533
|
+
|
|
534
|
+
type Email = {
|
|
535
|
+
id: string | null;
|
|
536
|
+
domain: string | null;
|
|
537
|
+
};
|
|
538
|
+
|
|
539
|
+
type Link = {
|
|
540
|
+
href: string | null;
|
|
541
|
+
text: string | null;
|
|
542
|
+
type: string | null;
|
|
543
|
+
};
|
|
544
|
+
|
|
545
|
+
type ParsedGPXInputs = {
|
|
546
|
+
xml: Document;
|
|
547
|
+
metadata: MetaData;
|
|
548
|
+
waypoints: Waypoint[];
|
|
549
|
+
tracks: Track[];
|
|
550
|
+
routes: Route[];
|
|
551
|
+
};
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import Pbf from "pbf";
|
|
2
|
+
|
|
3
|
+
import type { Data, DataRange, Feature } from "../types";
|
|
4
|
+
|
|
5
|
+
import { Trips, Trip, GTFS, GTFSReader } from "./gtfsReader";
|
|
6
|
+
import { f, FetchOptions } from "./utils";
|
|
7
|
+
|
|
8
|
+
let gtfs: GTFS = {};
|
|
9
|
+
let current: Trips = {};
|
|
10
|
+
let previous: Trips = {};
|
|
11
|
+
let tripsData: Trips = {};
|
|
12
|
+
|
|
13
|
+
export async function fetchGTFS(
|
|
14
|
+
data: Data,
|
|
15
|
+
range?: DataRange,
|
|
16
|
+
options?: FetchOptions,
|
|
17
|
+
): Promise<Feature[] | void> {
|
|
18
|
+
const fetchData = async () => {
|
|
19
|
+
try {
|
|
20
|
+
const arrayBuffer = data.url ? await (await f(data.url, options)).arrayBuffer() : data.value;
|
|
21
|
+
const pbfBuffer = new Pbf(new Uint8Array(arrayBuffer));
|
|
22
|
+
gtfs = new GTFSReader().read(pbfBuffer);
|
|
23
|
+
} catch (err) {
|
|
24
|
+
throw new Error(`failed to fetch gtfs: ${err}`);
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
await fetchData();
|
|
28
|
+
|
|
29
|
+
return processGTFS(gtfs, range);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export function processGTFS(gtfs?: GTFS, _range?: DataRange): Feature[] | void {
|
|
33
|
+
if (gtfs) {
|
|
34
|
+
if (current) {
|
|
35
|
+
previous = current;
|
|
36
|
+
const currentTrips = GTFStoTrips(gtfs);
|
|
37
|
+
current = currentTrips;
|
|
38
|
+
const merged = mergeTrips(currentTrips, previous);
|
|
39
|
+
|
|
40
|
+
tripsData = merged;
|
|
41
|
+
} else {
|
|
42
|
+
const currentTrips = GTFStoTrips(gtfs);
|
|
43
|
+
current = currentTrips;
|
|
44
|
+
tripsData = currentTrips;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
return tripsData?.trips
|
|
49
|
+
?.filter(f => !!f.properties.position)
|
|
50
|
+
.map(f => {
|
|
51
|
+
return {
|
|
52
|
+
type: "feature",
|
|
53
|
+
id: f.id,
|
|
54
|
+
geometry: {
|
|
55
|
+
type: "Point",
|
|
56
|
+
coordinates: [
|
|
57
|
+
f.properties.position?.longitude || 0,
|
|
58
|
+
f.properties.position?.latitude || 0,
|
|
59
|
+
],
|
|
60
|
+
},
|
|
61
|
+
properties: f.properties,
|
|
62
|
+
};
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export const GTFStoTrips = (gtfs: GTFS): Trips => {
|
|
67
|
+
const trips = gtfs.entities?.map(entity => ({
|
|
68
|
+
id: entity.id,
|
|
69
|
+
properties: entity.vehicle,
|
|
70
|
+
path: [[entity.vehicle?.position?.longitude, entity.vehicle?.position?.latitude]],
|
|
71
|
+
timestamps: [entity.vehicle?.timestamp],
|
|
72
|
+
}));
|
|
73
|
+
return {
|
|
74
|
+
timestamp: gtfs.header?.timestamp,
|
|
75
|
+
trips: trips as Trip[],
|
|
76
|
+
};
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
export const mergeTrips = (current: Trips, prev?: Trips) => {
|
|
80
|
+
if (prev) {
|
|
81
|
+
const prevMap = new Map();
|
|
82
|
+
prev?.trips?.forEach(trip => {
|
|
83
|
+
prevMap.set(trip.id, trip);
|
|
84
|
+
});
|
|
85
|
+
const mergedMap = new Map();
|
|
86
|
+
const newIds: string[] = [];
|
|
87
|
+
current?.trips?.forEach(entity => {
|
|
88
|
+
const previousEntity = prevMap.get(entity.id);
|
|
89
|
+
if (previousEntity) {
|
|
90
|
+
const previousPath = previousEntity.path;
|
|
91
|
+
const previousTimestamps = previousEntity.timestamps;
|
|
92
|
+
const trip = {
|
|
93
|
+
id: entity.id,
|
|
94
|
+
properties: entity.properties,
|
|
95
|
+
path: [...previousPath, ...entity.path],
|
|
96
|
+
timestamps: [...previousTimestamps, ...entity.timestamps],
|
|
97
|
+
};
|
|
98
|
+
mergedMap.set(entity.id, trip);
|
|
99
|
+
} else {
|
|
100
|
+
mergedMap.set(entity.id, entity);
|
|
101
|
+
newIds.push(entity.id);
|
|
102
|
+
}
|
|
103
|
+
});
|
|
104
|
+
const trips = Object.fromEntries(mergedMap);
|
|
105
|
+
const mergedTrips = Object.values(trips).filter(
|
|
106
|
+
entity =>
|
|
107
|
+
newIds.includes((entity as Trip).id) ||
|
|
108
|
+
(entity as Trip).path.length > prevMap.get((entity as Trip).id).path.length,
|
|
109
|
+
);
|
|
110
|
+
return {
|
|
111
|
+
timestamp: current.timestamp,
|
|
112
|
+
trips: mergedTrips as Trip[],
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
return current;
|
|
116
|
+
};
|