How to use the proj4/lib/Proj function in proj4

To help you get started, we’ve selected a few proj4 examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github bokeh / bokeh / bokehjs / src / lib / core / util / projections.ts View on Github external
import proj4 from "proj4/lib/core"
import Projection from "proj4/lib/Proj"

import {LatLon} from "../enums"

const mercator = new Projection('GOOGLE')
const wgs84    = new Projection('WGS84')

export const wgs84_mercator = proj4(wgs84, mercator)

const mercator_bounds = {
  lon: [-20026376.39, 20026376.39],
  lat: [-20048966.10, 20048966.10],
}

const latlon_bounds = {
  lon: [-180, 180],
  lat: [-85.06, 85.06],
}

export function clip_mercator(low: number, high: number, dimension: LatLon): [number, number] {
  const [min, max] = mercator_bounds[dimension]
  return [Math.max(low, min), Math.min(high, max)]
github bokeh / bokeh / bokehjs / src / lib / core / util / projections.ts View on Github external
import proj4 from "proj4/lib/core"
import Projection from "proj4/lib/Proj"

import {LatLon} from "../enums"

const mercator = new Projection('GOOGLE')
const wgs84    = new Projection('WGS84')

export const wgs84_mercator = proj4(wgs84, mercator)

const mercator_bounds = {
  lon: [-20026376.39, 20026376.39],
  lat: [-20048966.10, 20048966.10],
}

const latlon_bounds = {
  lon: [-180, 180],
  lat: [-85.06, 85.06],
}

export function clip_mercator(low: number, high: number, dimension: LatLon): [number, number] {
  const [min, max] = mercator_bounds[dimension]

proj4

Proj4js is a JavaScript library to transform point coordinates from one coordinate system to another, including datum transformations.

MIT
Latest version published 25 days ago

Package Health Score

89 / 100
Full package analysis

Similar packages