Skip to main content
100%

EPSG:2163 Coordinates

✓ Published0🌍 Public
Mmbostock
Last edited Feb 9, 2016
Created on Feb 27, 2013

This interactive map displays the United States using the EPSG:2163 U.S. National Atlas projection, rendered as SVG paths with d3.geo.azimuthalEqualArea and topojson. A red brush overlay lets users select a geographic extent, with the corresponding xmin ymin xmax ymax coordinates in projection meters displayed live. The code computes these bounds by translating between pixel space and EPSG:2163 coordinates using the projection’s scale and the predefined Earth radius of 6,370,997 meters. The example demonstrates how to generate target extents for tools like gdalwarp.

AI-generated description

Use the brush to select extent coordinates interactively.

The gdalwarp utility can crop the warped output image using the -te argument, which specifies a geographic extent as xmin ymin xmax ymax coordinates in the target projection. For example, the extent -2030000 -1250000 -1300000 -40400 shown above encompasses California when using EPSG:2163, the U.S. National Atlas projection.

The trick to computing these coordinates is to know the scale of the underlying Lambert azimuthal equal-area projection: 6,370,997 meters, as shown in the human-readable projection definition. From there, it is possible to translate between pixel space and EPSG:2163 coordinates.

function te(projection) {
  var radius = 6370997,
      scale = projection.scale(),
      rotate = projection.rotate(),
      translate = projection.translate(),
      offset = projection.rotate([0, 0]).translate([0, 0])([0, 0]);

  projection.rotate(rotate).translate(translate);

  return [
    Math.round((-offset[0] - translate[0]) / scale * radius),
    Math.round((offset[1] + translate[1] - height) / scale * radius),
    Math.round((-offset[0] - translate[0] + width) / scale * radius),
    Math.round((offset[1] + translate[1]) / scale * radius)
  ];
}
gpl-3.0 Licensed

Similar vizzes