Skip to content

Commit

Permalink
fix exports and naming conventions
Browse files Browse the repository at this point in the history
  • Loading branch information
Mr Martian committed Oct 3, 2024
1 parent da3609b commit dfde675
Show file tree
Hide file tree
Showing 77 changed files with 113 additions and 434 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
[npm-url]: https://npmjs.org/package/s2-tools
[crate-image]: https://img.shields.io/crates/v/s2-tools.svg?logo=rust&logoColor=white
[crate-url]: https://crates.io/crates/s2-tools
[bundle-image]: https://img.shields.io/bundlejs/size/s2-tools?exports=s2-tools
[bundle-image]: https://img.shields.io/bundlejs/size/s2-tools
[bundle-url]: https://bundlejs.com/?q=s2-tools&treeshake=%5B%7B+s2-tools+%7D%5D
[downloads-image]: https://img.shields.io/npm/dm/s2-tools.svg
[downloads-url]: https://www.npmjs.com/package/s2-tools
Expand Down
4 changes: 2 additions & 2 deletions assets/code-coverage.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions assets/doc-coverage.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "s2-tools",
"version": "0.1.1",
"version": "0.1.2",
"description": "A collection of geospatial tools primarily designed for WGS84, Web Mercator, and S2.",
"type": "module",
"keywords": [
Expand Down
2 changes: 1 addition & 1 deletion src/converters/toJSON/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { convert } from '../../geometry/convert';
import { mergeBBoxes } from '../../geometry';

import type { FeatureIterator } from 's2-tools/readers';
import type { FeatureIterator } from '../../readers';
import type { Writer } from '../../writers';
import type { BBOX, Projection, VectorFeatures } from '../../geometry';

Expand Down
2 changes: 1 addition & 1 deletion src/dataStructures/pointCluster.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Tile } from '../dataStructures';
import { convert } from '../geometry/convert';
import { fromS2Points } from 's2-tools/geometry/s1/chordAngle';
import { fromS2Points } from '../geometry/s1/chordAngle';
import { PointShape as Point, PointIndex } from './pointIndex';
import {
addMut,
Expand Down
6 changes: 3 additions & 3 deletions src/proj4/datum.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ import {
SRS_WGS84_SEMIMINOR,
} from './constants';

import type { DatumParams } from 's2-tools/readers/wkt';
import type { NadSubGrid } from 's2-tools/readers/nadgrid';
import type { VectorPoint } from 's2-tools/geometry';
import type { DatumParams } from '../readers/wkt';
import type { NadSubGrid } from '../readers/nadgrid';
import type { VectorPoint } from '../geometry';
import type { ProjectionParams, ProjectionTransform, Transformer } from '.';

const { abs, sin, cos, sqrt, atan2, atan, PI, floor } = Math;
Expand Down
4 changes: 2 additions & 2 deletions src/proj4/parseCode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import {
deriveEccentricity,
deriveSphere,
} from './constants';
import { isWKTProjection, parseWKTProjection } from 's2-tools/readers/wkt';
import { isWKTProjection, parseWKTProjection } from '../readers/wkt';

import type { DatumParams } from 's2-tools/readers/wkt';
import type { DatumParams } from '../readers/wkt';
import type { ProjectionParams } from './projections';
import type { Transformer } from './transformer';

Expand Down
2 changes: 1 addition & 1 deletion src/proj4/projections/aea.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { EPSLN } from '../constants';
import { ProjectionBase } from './base';
import { adjustLon, asinz, msfnz, qsfnz } from '../common';

import type { VectorPoint } from 's2-tools/geometry';
import type { VectorPoint } from '../../geometry';
import type { ProjectionParams, ProjectionTransform } from '.';

const { abs, pow, sin, cos, sqrt, atan2, asin, log } = Math;
Expand Down
2 changes: 1 addition & 1 deletion src/proj4/projections/aeqd.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { ProjectionBase } from './base';
import { EPSLN, HALF_PI } from '../constants';
import { adjustLon, asinz, e0fn, e1fn, e2fn, e3fn, gN, imlfn, mlfn } from '../common';

import type { VectorPoint } from 's2-tools/geometry';
import type { VectorPoint } from '../../geometry';
import type { ProjectionParams, ProjectionTransform } from '.';

const { abs, pow, sin, cos, sqrt, atan2, asin, acos, PI, tan, atan } = Math;
Expand Down
6 changes: 3 additions & 3 deletions src/proj4/projections/base.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { D2R, PJD_NODATUM, R2D } from '../constants';

import type { DatumParams } from 's2-tools/readers/wkt';
import type { GridDefinition } from 's2-tools/readers/nadgrid';
import type { DatumParams } from '../../readers/wkt';
import type { GridDefinition } from '../../readers/nadgrid';
import type { ProjectionTransform } from '.';
import type { VectorPoint } from 's2-tools/geometry';
import type { VectorPoint } from '../../geometry';

/** Define the projection with all it's variable components */
export interface ProjectionParams {
Expand Down
2 changes: 1 addition & 1 deletion src/proj4/projections/bonne.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { ProjectionBase } from './base';
import { adjustLat, adjustLon, hypot, pjEnfn, pjInvMlfn, pjMlfn } from '../common';

import type { En } from '../common';
import type { VectorPoint } from 's2-tools/geometry';
import type { VectorPoint } from '../../geometry';
import type { ProjectionParams, ProjectionTransform } from '.';

const EPS10 = 1e-10;
Expand Down
2 changes: 1 addition & 1 deletion src/proj4/projections/cass.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { ProjectionBase } from './base';
import { EPSLN, HALF_PI } from '../constants';
import { adjustLat, adjustLon, e0fn, e1fn, e2fn, e3fn, gN, imlfn, mlfn } from '../common';

import type { VectorPoint } from 's2-tools/geometry';
import type { VectorPoint } from '../../geometry';
import type { ProjectionParams, ProjectionTransform } from '.';

const { abs, sin, cos, asin, atan2, tan, pow } = Math;
Expand Down
2 changes: 1 addition & 1 deletion src/proj4/projections/cea.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { ProjectionBase } from './base';
import { adjustLon, iqsfnz, msfnz, qsfnz } from '../common';

import type { VectorPoint } from 's2-tools/geometry';
import type { VectorPoint } from '../../geometry';
import type { ProjectionParams, ProjectionTransform } from '.';

const { sin, cos, asin } = Math;
Expand Down
2 changes: 1 addition & 1 deletion src/proj4/projections/eqc.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { ProjectionBase } from '.';
import { adjustLat, adjustLon } from '../common';

import type { VectorPoint } from 's2-tools/geometry';
import type { VectorPoint } from '../../geometry';
import type { ProjectionParams, ProjectionTransform } from '.';

/**
Expand Down
2 changes: 1 addition & 1 deletion src/proj4/projections/eqdc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { EPSLN } from '../constants';
import { ProjectionBase } from '.';
import { adjustLat, adjustLon, e0fn, e1fn, e2fn, e3fn, imlfn, mlfn, msfnz } from '../common';

import type { VectorPoint } from 's2-tools/geometry';
import type { VectorPoint } from '../../geometry';
import type { ProjectionParams, ProjectionTransform } from '.';

const { abs, sin, cos, sqrt, atan2 } = Math;
Expand Down
2 changes: 1 addition & 1 deletion src/proj4/projections/eqearth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
import { ProjectionBase } from '.';
import { adjustLon } from '../common';

import type { VectorPoint } from 's2-tools/geometry';
import type { VectorPoint } from '../../geometry';
import type { ProjectionParams, ProjectionTransform } from '.';

const { abs, sin, cos, sqrt, asin } = Math;
Expand Down
2 changes: 1 addition & 1 deletion src/proj4/projections/equi.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { ProjectionBase } from '.';
import { adjustLon } from '../common';

import type { VectorPoint } from 's2-tools/geometry';
import type { VectorPoint } from '../../geometry';
import type { ProjectionParams, ProjectionTransform } from '.';

/**
Expand Down
2 changes: 1 addition & 1 deletion src/proj4/projections/etmerc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import { TransverseMercator } from './tmerc';
import { adjustLon, asinhy, clens, clensCmplx, gatg, hypot, sinh } from '../common';

import type { VectorPoint } from 's2-tools/geometry';
import type { VectorPoint } from '../../geometry';
import type { ProjectionParams, ProjectionTransform } from '.';

const { abs, pow, sin, cos, sqrt, atan2, tan, atan } = Math;
Expand Down
2 changes: 1 addition & 1 deletion src/proj4/projections/gauss.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { ProjectionBase } from '.';
import { srat } from '../common';
import { HALF_PI, QUART_PI } from '../constants';

import type { VectorPoint } from 's2-tools/geometry';
import type { VectorPoint } from '../../geometry';
import type { ProjectionParams, ProjectionTransform } from '.';

const { abs, pow, sin, cos, sqrt, asin, tan, atan } = Math;
Expand Down
2 changes: 1 addition & 1 deletion src/proj4/projections/geocent.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { ProjectionBase } from '.';
import { geocentricToGeodetic, geodeticToGeocentric } from '../datum';

import type { VectorPoint } from 's2-tools/geometry';
import type { VectorPoint } from '../../geometry';
import type { ProjectionParams, ProjectionTransform } from '.';

/** Geocentric Projection */
Expand Down
2 changes: 1 addition & 1 deletion src/proj4/projections/geos.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { ProjectionBase } from '.';
import { hypot } from '../common';

import type { VectorPoint } from 's2-tools/geometry';
import type { VectorPoint } from '../../geometry';
import type { ProjectionParams, ProjectionTransform } from '.';

const { sin, cos, sqrt, tan, atan, atan2 } = Math;
Expand Down
2 changes: 1 addition & 1 deletion src/proj4/projections/gnom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { EPSLN } from '../constants';
import { ProjectionBase } from '.';
import { adjustLon, asinz } from '../common';

import type { VectorPoint } from 's2-tools/geometry';
import type { VectorPoint } from '../../geometry';
import type { ProjectionParams, ProjectionTransform } from '.';

const { abs, sin, cos, sqrt, atan2 } = Math;
Expand Down
2 changes: 1 addition & 1 deletion src/proj4/projections/gstmerc.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { ProjectionBase } from '.';
import { cosh, invlatiso, latiso, sinh } from '../common';

import type { VectorPoint } from 's2-tools/geometry';
import type { VectorPoint } from '../../geometry';
import type { ProjectionParams, ProjectionTransform } from '.';

const { pow, sin, cos, sqrt, atan, asin } = Math;
Expand Down
4 changes: 2 additions & 2 deletions src/proj4/projections/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ import { VanDerGrinten } from './vandg';

import { ProjectionBase } from './base';

import type { DatumParams } from 's2-tools/readers/wkt';
import type { GridDefinition } from 's2-tools/readers/nadgrid';
import type { DatumParams } from '../../readers/wkt';
import type { GridDefinition } from '../../readers/nadgrid';
import type { VectorPoint } from 's2json-spec';

export * from './aea';
Expand Down
2 changes: 1 addition & 1 deletion src/proj4/projections/krovak.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { ProjectionBase } from '.';
import { adjustLon } from '../common';

import type { VectorPoint } from 's2-tools/geometry';
import type { VectorPoint } from '../../geometry';
import type { ProjectionParams, ProjectionTransform } from '.';

const { abs, pow, sin, cos, sqrt, atan2, asin, tan, atan } = Math;
Expand Down
2 changes: 1 addition & 1 deletion src/proj4/projections/laea.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { ProjectionBase } from '.';
import { EPSLN, HALF_PI, QUART_PI } from '../constants';
import { adjustLon, qsfnz } from '../common';

import type { VectorPoint } from 's2-tools/geometry';
import type { VectorPoint } from '../../geometry';
import type { ProjectionParams, ProjectionTransform } from '.';

export const S_POLE = 1;
Expand Down
2 changes: 1 addition & 1 deletion src/proj4/projections/lcc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { ProjectionBase } from '.';
import { EPSLN, HALF_PI } from '../constants';
import { adjustLon, msfnz, phi2z, sign, tsfnz } from '../common';

import type { VectorPoint } from 's2-tools/geometry';
import type { VectorPoint } from '../../geometry';
import type { ProjectionParams, ProjectionTransform } from '.';

const { abs, pow, sin, cos, sqrt, atan2, log, PI } = Math;
Expand Down
2 changes: 1 addition & 1 deletion src/proj4/projections/merc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { ProjectionBase } from './base';
import { EPSLN, HALF_PI, QUART_PI } from '../constants';
import { adjustLon, msfnz, phi2z, tsfnz } from '../common';

import type { VectorPoint } from 's2-tools/geometry';
import type { VectorPoint } from '../../geometry';
import type { ProjectionParams, ProjectionTransform } from '.';

const { abs, sin, cos, sqrt, log, tan, atan, exp } = Math;
Expand Down
2 changes: 1 addition & 1 deletion src/proj4/projections/mill.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { ProjectionBase } from '.';
import { adjustLon } from '../common';

import type { VectorPoint } from 's2-tools/geometry';
import type { VectorPoint } from '../../geometry';
import type { ProjectionParams, ProjectionTransform } from '.';

const { tan, atan, PI, log, exp } = Math;
Expand Down
2 changes: 1 addition & 1 deletion src/proj4/projections/moll.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { EPSLN } from '../constants';
import { ProjectionBase } from '.';
import { adjustLon } from '../common';

import type { VectorPoint } from 's2-tools/geometry';
import type { VectorPoint } from '../../geometry';
import type { ProjectionParams, ProjectionTransform } from '.';

const { abs, PI, sin, cos, asin } = Math;
Expand Down
2 changes: 1 addition & 1 deletion src/proj4/projections/nzmg.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { ProjectionBase } from '.';
import { SEC_TO_RAD } from '../constants';

import type { VectorPoint } from 's2-tools/geometry';
import type { VectorPoint } from '../../geometry';
import type { ProjectionParams, ProjectionTransform } from '.';

/**
Expand Down
2 changes: 1 addition & 1 deletion src/proj4/projections/omerc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { ProjectionBase } from '.';
import { D2R, EPSLN, HALF_PI, QUART_PI, TWO_PI } from '../constants';
import { adjustLon, phi2z, tsfnz } from '../common';

import type { VectorPoint } from 's2-tools/geometry';
import type { VectorPoint } from '../../geometry';
import type { ProjectionParams, ProjectionTransform } from '.';

const { abs, pow, sin, cos, sqrt, atan2, asin, log, atan, PI, tan, exp } = Math;
Expand Down
2 changes: 1 addition & 1 deletion src/proj4/projections/ortho.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { ProjectionBase } from '.';
import { EPSLN, HALF_PI } from '../constants';
import { adjustLon, asinz } from '../common';

import type { VectorPoint } from 's2-tools/geometry';
import type { VectorPoint } from '../../geometry';
import type { ProjectionParams, ProjectionTransform } from '.';

const { abs, sin, cos, sqrt, atan2 } = Math;
Expand Down
2 changes: 1 addition & 1 deletion src/proj4/projections/poly.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { EPSLN } from '../constants';
import { ProjectionBase } from '.';
import { adjustLat, adjustLon, e0fn, e1fn, e2fn, e3fn, gN, mlfn } from '../common';

import type { VectorPoint } from 's2-tools/geometry';
import type { VectorPoint } from '../../geometry';
import type { ProjectionParams, ProjectionTransform } from '.';

const { abs, pow, sin, cos, sqrt, asin, tan } = Math;
Expand Down
2 changes: 1 addition & 1 deletion src/proj4/projections/qsc.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { ProjectionBase } from '.';
import { EPSLN, HALF_PI, QUART_PI, SPI, TWO_PI } from '../constants';

import type { VectorPoint } from 's2-tools/geometry';
import type { VectorPoint } from '../../geometry';
import type { ProjectionParams, ProjectionTransform } from '.';

const { abs, sin, cos, sqrt, atan2, atan, tan, acos } = Math;
Expand Down
2 changes: 1 addition & 1 deletion src/proj4/projections/robin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { ProjectionBase } from '.';
import { adjustLon } from '../common';
import { D2R, EPSLN, HALF_PI, R2D } from '../constants';

import type { VectorPoint } from 's2-tools/geometry';
import type { VectorPoint } from '../../geometry';
import type { ProjectionParams, ProjectionTransform } from '.';

const { abs, floor } = Math;
Expand Down
2 changes: 1 addition & 1 deletion src/proj4/projections/sinu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { EPSLN, HALF_PI } from '../constants';
import { adjustLat, adjustLon, asinz, pjEnfn, pjInvMlfn, pjMlfn } from '../common';

import type { En } from '../common';
import type { VectorPoint } from 's2-tools/geometry';
import type { VectorPoint } from '../../geometry';
import type { ProjectionParams, ProjectionTransform } from '.';

const { abs, sin, cos, sqrt, asin } = Math;
Expand Down
2 changes: 1 addition & 1 deletion src/proj4/projections/somerc.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ProjectionBase } from '.';

import type { VectorPoint } from 's2-tools/geometry';
import type { VectorPoint } from '../../geometry';
import type { ProjectionParams, ProjectionTransform } from '.';

const { abs, pow, sin, cos, sqrt, asin, atan, exp, log, tan, PI } = Math;
Expand Down
2 changes: 1 addition & 1 deletion src/proj4/projections/stere.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { ProjectionBase } from '.';
import { EPSLN, HALF_PI } from '../constants';
import { adjustLon, msfnz, phi2z, sign, tsfnz } from '../common';

import type { VectorPoint } from 's2-tools/geometry';
import type { VectorPoint } from '../../geometry';
import type { ProjectionParams, ProjectionTransform } from '.';

const { abs, pow, sin, cos, sqrt, atan2, asin, tan, atan, PI } = Math;
Expand Down
2 changes: 1 addition & 1 deletion src/proj4/projections/sterea.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { GaussKruger } from './gauss';
import { adjustLon, hypot } from '../common';

import type { VectorPoint } from 's2-tools/geometry';
import type { VectorPoint } from '../../geometry';
import type { ProjectionParams, ProjectionTransform } from '.';

const { sin, cos, atan2, asin } = Math;
Expand Down
2 changes: 1 addition & 1 deletion src/proj4/projections/tmerc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { EPSLN, HALF_PI } from '../constants';
import { adjustLon, pjEnfn, pjInvMlfn, pjMlfn, sign } from '../common';

import type { En } from '../common';
import type { VectorPoint } from 's2-tools/geometry';
import type { VectorPoint } from '../../geometry';
import type { ProjectionParams, ProjectionTransform } from '.';

const { abs, pow, sin, cos, sqrt, atan2, asin, log, tan, acos, exp } = Math;
Expand Down
Loading

0 comments on commit dfde675

Please sign in to comment.