{"_id":"@bloc-in-bloc/geographic","name":"@bloc-in-bloc/geographic","dist-tags":{"next":"2.46.1-next.72","latest":"2.46.1-next.72"},"versions":{"2.46.1-next.72":{"name":"@bloc-in-bloc/geographic","version":"2.46.1-next.72","description":"Proj4-based three.js geodesy toolkit","type":"module","main":"lib/index.js","exports":{"types":"./lib/index.d.ts","default":"./lib/index.js"},"types":"./lib/index.d.ts","scripts":{"build":"","transpile":"tsc && cross-env BABEL_DISABLE_CACHE=1 babel src --out-dir lib --extensions .js,.ts","test-unit":"npm run base-test-unit test/unit","base-test-unit":"cross-env BABEL_DISABLE_CACHE=1 NODE_OPTIONS=--no-experimental-strip-types mocha --import=../../config/babel-register/register.mjs","test-with-coverage":"c8 -n src -r html cross-env npm run test-unit","test-with-coverage_lcov":"c8 -n src --reporter=lcov cross-env npm run test-unit","watch":"npm run transpile -- --watch","publish-latest":"npm publish --access public --tag=latest --provenance","publish-next":"npm publish --access public --tag=next --provenance"},"repository":{"type":"git","url":"git+https://github.com/iTowns/itowns.git"},"license":"(CECILL-B OR MIT)","bugs":{"url":"https://github.com/itowns/itowns/issues"},"peerDependencies":{"proj4":">=2.20.0","three":">=0.182.0"},"homepage":"https://itowns.github.io/","gitHead":"c9ee7668a64ace807a8164e8daa9f9db27a262d5","_id":"@bloc-in-bloc/geographic@2.46.1-next.72","_nodeVersion":"26.7.0","_npmVersion":"11.19.0","dist":{"integrity":"sha512-qdNCF5UG4lyTigAXMXpynwQJuFomNa84DdzRAaRtAS2jcRL+Bj8F+cBl6vH7Gldf1+AesyqJx3YdcGfmMGLjPw==","shasum":"a68edff590591cbe3d9e0ccd34ef5e5ba0162b53","tarball":"https://registry.npmjs.org/@bloc-in-bloc/geographic/-/geographic-2.46.1-next.72.tgz","fileCount":26,"unpackedSize":167649,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDyCxgbc4J1kBZH6vwvSgvzsfN4lsgl34H4aey0mofXmwIhAJpbU4wKNn4cFAZAmRXvSL3Y+seuVYKhZrwNZnNo+cQh"}]},"_npmUser":{"name":"kevinetourneau","email":"kevin@blocinbloc.com"},"directories":{},"maintainers":[{"name":"kevinetourneau","email":"kevin@blocinbloc.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/geographic_2.46.1-next.72_1788421643225_0.06014516274292636"},"_hasShrinkwrap":false}},"time":{"created":"2026-09-03T07:47:23.085Z","2.46.1-next.72":"2026-09-03T07:47:23.368Z","modified":"2026-09-03T07:47:23.585Z"},"maintainers":[{"name":"kevinetourneau","email":"kevin@blocinbloc.com"}],"description":"Proj4-based three.js geodesy toolkit","homepage":"https://itowns.github.io/","repository":{"type":"git","url":"git+https://github.com/iTowns/itowns.git"},"bugs":{"url":"https://github.com/itowns/itowns/issues"},"license":"(CECILL-B OR MIT)","readme":"## iTowns Geographic\n\nThe geographic package provides utilities for handling coordinates, ellipsoids, extents and rotations across different coordinate systems.\n\n* [Coordinates](http://www.itowns-project.org/itowns/docs/#api/Geographic/Coordinates) : A Coordinates object (geodetic datum), defined by a [crs] and three values.\n* [Coordinates stars] : get sun position, azimuth, ascention, ecliptic longitude and declination from date.\n* [Coordinate Reference System](http://www.itowns-project.org/itowns/docs/#api/Geographic/CRS) : This module provides basic methods to manipulate a CRS (as a string). to explore available coordinates systems and use their **proj4js** definition to define them in itowns with `proj4.defs(crs, proj4def)`.\n* Ellipsoid : A representation of an [ellipsoid](https://en.wikipedia.org/wiki/Ellipsoid) and useful computation methods (geodetic normal, etc.)\n* Ellipsoid Size: The length of the earth ellispoid semi-axes.\n* [Extent](http://www.itowns-project.org/itowns/docs/#api/Geographic/Extent) : Extent is geographical bounding rectangle defined by a crs and 4 limits: west, east, south and north .\n* [OrientationUtils](http://www.itowns-project.org/itowns/docs/#api/Geographic/OrientationUtils) : utilities to compute a rotation quaternion from various rotation conventions, including between different crs.\n\n# Install\n\n`npm install --save @itowns/geographic`\n\n# Getting started\n\n```js\nimport { Coordinates, Extent, CRS } from '@itowns/geographic';\n\nconst coordinates = new Coordinates('EPSG:4326', 88.002445, 50.336522, 120.32201);\nconst extent = new Extent('EPSG:4326', 88.002445, 50.336522, 22.021, 50.302548);\n\n// change projection system to pseudo mercator\n\ncoordinates.as('EPSG:3857');\nextent.as('EPSG:3857');\n\n// change projection system to EPSG:2154\n\n// defs EPSG:2154 crs (visit epsg.io to get the proj4js definition of a crs)\nCRS.defs('EPSG:2154','+proj=lcc +lat_0=46.5 +lon_0=3 +lat_1=49 +lat_2=44 +x_0=700000 +y_0=6600000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs +type=crs');\n\ncoordinates.as('EPSG:2154');\n\n```\n\n## OrientationUtils example \n\nIn geodesy, attitude refers to the orientation of a geodetic instrument or platform in three-dimensional space. It is defined by the angles that describe how an instrument or a vehicle (like a satellite or aircraft) is positioned relative to a reference coordinate system, typically the Earth's surface or a local tangent plane.\n\n```js\n// Compute the rotation around the point of origin from a frame aligned with Lambert93 axes (epsg:2154),\n// to the geocentric frame (epsg:4978)\n\nquat_crs2crs = OrientationUtils.quaternionFromCRSToCRS(\"EPSG:2154\", \"EPSG:4978\")(origin);\n\n// Compute the rotation of a sensor platform defined by its attitude\n\nconst attitude = {\n\t// Rotation around the longitudinal axis of the object (front-to-back axis), tilting the object sideways.\n\tRoll: 0.0,\n\t// Rotation around the lateral axis (side-to-side axis), moving the nose or front up or down.\n\tPitch: Math.PI * 0.2,\n\t// Rotation around the vertical axis (top-to-bottom axis), changing the direction the object is facing horizontally.\n\tYaw: Math.PI * 0.5,\n}\n\nquat_attitude = OrientationUtils.quaternionFromAttitude(attitude);\n\n// Compute the rotation from the sensor platform frame to the geocentric frame\n\nquat = quat_crs2crs.multiply(quat_attitude);\n```\n\nVisit the iTowns [documentation](http://www.itowns-project.org/itowns/docs/#home) for more information.\n","readmeFilename":"README.md","_rev":"1-965f4d3a8ba89ec59c87027086ddfd8c"}