@quartic/bokehjs
Version:
Interactive, novel data visualization
25 lines (18 loc) • 775 B
text/coffeescript
import {proj4, mercator, wgs84} from "core/util/proj4"
export class ProjectionUtils
constructor: () ->
= 2 * Math.PI * 6378137 / 2.0
geographic_to_meters: (xLon, yLat) ->
return proj4(wgs84, mercator, [xLon, yLat])
meters_to_geographic: (mx, my) ->
return proj4(mercator, wgs84, [mx, my])
geographic_extent_to_meters: (extent) ->
[xmin, ymin, xmax, ymax] = extent
[xmin, ymin] =
[xmax, ymax] =
return [xmin, ymin, xmax, ymax]
meters_extent_to_geographic: (extent) ->
[xmin, ymin, xmax, ymax] = extent
[xmin, ymin] =
[xmax, ymax] =
return [xmin, ymin, xmax, ymax]