UNPKG

s2-tools

Version:

A collection of geospatial tools primarily designed for WGS84, Web Mercator, and S2.

150 lines 5.43 kB
import { ProjectionBase } from '.'; import type { VectorPoint } from '../../geometry'; import type { ProjectionParams, ProjectionTransform } from '.'; /** Face enum */ declare enum FACE_ENUM { FRONT = 1, RIGHT = 2, BACK = 3, LEFT = 4, TOP = 5, BOTTOM = 6 } /** Area enum */ declare enum AREA_ENUM { AREA_0 = 1, AREA_1 = 2, AREA_2 = 3, AREA_3 = 4 } /** * # Quadrilateralized Spherical Cube * * The purpose of the Quadrilateralized Spherical Cube (QSC) projection is to project * a sphere surface onto the six sides of a cube: * * **Classification**: Azimuthal * * **Available forms**: Forward and inverse, ellipsoidal * * **Defined area**: Global * * **Alias**: qsc * * **Domain**: 2D * * **Input type**: Geodetic coordinates * * **Output type**: Projected coordinates * * ## Projection String * ``` * +proj=qsc * ``` * * For this purpose, other alternatives can be used, notably `gnom` or * `healpix`. However, QSC projection has the following favorable properties: * * It is an equal-area projection, and at the same time introduces only limited angular * distortions. It treats all cube sides equally, i.e. it does not use different * projections for polar areas and equatorial areas. These properties make QSC * projection a good choice for planetary-scale terrain rendering. Map data can be * organized in quadtree structures for each cube side. See `LambersKolb2012` for an example. * * The QSC projection was introduced by `ONeilLaubscher1976`, * building on previous work by `ChanONeil1975`. For clarity: The * earlier QSC variant described in `ChanONeil1975` became known as the COBE QSC since it * was used by the NASA Cosmic Background Explorer (COBE) project; it is an approximately * equal-area projection and is not the same as the QSC projection. * See also `CalabrettaGreisen2002` Sec. 5.6.2 and 5.6.3 for a description of both and * some analysis. * * In this implementation, the QSC projection projects onto one side of a circumscribed * cube. The cube side is selected by choosing one of the following six projection centers: * * `+lat_0=0 +lon_0=0` | front cube side | * * `+lat_0=0 +lon_0=90` | right cube side | * * `+lat_0=0 +lon_0=180` | back cube side | * * `+lat_0=0 +lon_0=-90` | left cube side | * * `+lat_0=90` | top cube side | * * `+lat_0=-90` | bottom cube side | * * ## Required Parameters * - `+lat_0=<value>`: Latitude of the projection center. * - `+lon_0=<value>`: Longitude of the projection center. * * ## Optional Parameters * - `+ellps=<value>`: Ellipsoid parameters (default: `WGS84`). * - `+x_0=<value>`: False easting. * - `+y_0=<value>`: False northing. * * ## Usage Example * ``` * gdalwarp -t_srs "+wktext +proj=qsc +units=m +ellps=WGS84 +lat_0=0 +lon_0=0" \ * -wo SOURCE_EXTRA=100 -wo SAMPLE_GRID=YES -te -6378137 -6378137 6378137 6378137 \ * worldmap.tiff frontside.tiff * * gdalwarp -t_srs "+wktext +proj=qsc +units=m +ellps=WGS84 +lat_0=0 +lon_0=90" \ * -wo SOURCE_EXTRA=100 -wo SAMPLE_GRID=YES -te -6378137 -6378137 6378137 6378137 \ * worldmap.tiff rightside.tiff * * gdalwarp -t_srs "+wktext +proj=qsc +units=m +ellps=WGS84 +lat_0=0 +lon_0=180" \ * -wo SOURCE_EXTRA=100 -wo SAMPLE_GRID=YES -te -6378137 -6378137 6378137 6378137 \ * worldmap.tiff backside.tiff * * gdalwarp -t_srs "+wktext +proj=qsc +units=m +ellps=WGS84 +lat_0=0 +lon_0=-90" \ * -wo SOURCE_EXTRA=100 -wo SAMPLE_GRID=YES -te -6378137 -6378137 6378137 6378137 \ * worldmap.tiff leftside.tiff * * gdalwarp -t_srs "+wktext +proj=qsc +units=m +ellps=WGS84 +lat_0=90 +lon_0=0" \ * -wo SOURCE_EXTRA=100 -wo SAMPLE_GRID=YES -te -6378137 -6378137 6378137 6378137 \ * worldmap.tiff topside.tiff * * gdalwarp -t_srs "+wktext +proj=qsc +units=m +ellps=WGS84 +lat_0=-90 +lon_0=0" \ * -wo SOURCE_EXTRA=100 -wo SAMPLE_GRID=YES -te -6378137 -6378137 6378137 6378137 \ * worldmap.tiff bottomside.tiff * ``` * * ## Further Reading * - [Wikipedia](https://en.wikipedia.org/wiki/Quadrilateralized_spherical_cube) * - [NASA](https://lambda.gsfc.nasa.gov/product/cobe/skymap_info_new.cfm) * * ![Quadrilateralized Spherical Cube](https://github.com/Open-S2/s2-tools/blob/master/assets/proj4/projections/images/qsc.png?raw=true) */ export declare class QuadrilateralizedSphericalCube extends ProjectionBase implements ProjectionTransform { name: string; static names: string[]; x0: number; y0: number; lat0: number; long0: number; latTs: number; oneMinusF: number; oneMinusFSquared: number; face: FACE_ENUM; area: AREA_ENUM; /** * Preps an QuadrilateralizedSphericalCube projection * QSC projection rewritten from the original PROJ4 * https://github.com/OSGeo/proj.4/blob/master/src/PJ_qsc.c * @param params - projection specific parameters */ constructor(params?: ProjectionParams); /** * QuadrilateralizedSphericalCube forward equations--mapping lon-lat to x-y * @param p - lon-lat WGS84 point */ forward(p: VectorPoint): void; /** * QuadrilateralizedSphericalCube inverse equations--mapping x-y to lon-lat * @param p - QuadrilateralizedSphericalCube point */ inverse(p: VectorPoint): void; } export {}; //# sourceMappingURL=qsc.d.ts.map