ForHosting KIT · Developer Utilities

Hammer projection calculator

The Hammer projection calculator converts a geographic latitude and longitude into planar x and y coordinates for a full-world, equal-area map.

● BetaFree · in your browser
Use it from WebAPIEmailTelegramApp soon

It implements the classic elliptical modification of the Lambert azimuthal equal-area projection and supports a configurable central meridian, scale radius, and output precision. Use it to check cartographic calculations, prepare normalized coordinates for a visualization, or teach how a global projection trades shape for area preservation. Every result is deterministic, computed locally without network access, and accompanied by the effective wrapped longitude difference so the transformation is easy to audit.

How the Hammer projection transforms a coordinate

The Hammer projection maps the spherical world into an ellipse while preserving relative area. The calculator first converts latitude and the longitude difference from degrees to radians. It halves that longitude difference, then evaluates the shared denominator formed from latitude cosine and half-longitude cosine. The horizontal coordinate uses the latitude cosine and half-longitude sine, while the vertical coordinate uses the latitude sine. Fixed square-root-of-two factors establish the familiar Hammer outline. This is a forward spherical projection: it accepts a geographic coordinate and returns a point on the map plane. It does not claim that angles, distances, or local shapes remain unchanged. Those properties necessarily distort as the map approaches its outer edge. The returned projection name, original coordinate, central meridian, wrapped longitude difference, and radius make the calculation explicit. Coordinates are calculated at full JavaScript numeric precision and rounded only once, at the end, according to the requested decimal count. That ordering avoids accumulating rounding error inside the trigonometric formula.

Choose the central meridian, scale, and precision

Latitude must be between -90 and 90 degrees, including the poles. Longitude and the central meridian may be any finite degree values because the calculator wraps their difference onto the world-map interval. This means longitudes separated by complete rotations land on the same projected point. The central meridian controls which longitude appears at the center of the map: leave it at zero for a Greenwich-centered world, or set it near the region you want displayed away from the seam. The radius is a positive scale factor rather than an Earth datum. With radius one, the output is normalized and convenient for later conversion into pixels; multiplying the radius proportionally scales both coordinates. The decimals option accepts an integer from zero through twelve and defaults to six. Choose only the precision your downstream display or comparison needs. More digits do not make the spherical model more geographically accurate. All supplied numbers must be finite, so omitted required fields, numeric strings, infinities, and invalid ranges return a typed input error instead of an ambiguous coordinate.

Use equal-area output correctly

Hammer is a strong choice for thematic world maps where comparing the apparent size of regions matters. Choropleth maps, global density surfaces, educational atlases, and broad distribution diagrams benefit from its equal-area property and compact elliptical boundary. The returned x and y values can feed a graphics pipeline after you define a viewport transformation. A common approach is to find the Hammer map bounds for the chosen radius, translate the origin to the canvas center, scale both axes uniformly, and invert the y screen direction if the rendering system increases y downward. Keep the same central meridian for every point in one dataset or features will not align. Pay special attention to lines and polygons that cross the wrapped longitude seam: individual vertices project correctly, but a renderer may draw an unwanted segment across the map unless geometry is split at that seam first. Do not use these coordinates as if they were distances in meters, and do not mix them with Web Mercator tiles. Hammer preserves area globally, not bearings, straight routes, local angles, or a standard projected coordinate reference system tied to an ellipsoid.

Prepare thematic world-map points

Convert geographic observations into normalized equal-area coordinates before scaling them into a custom SVG, canvas, or chart viewport.

Verify a cartographic implementation

Compare known coordinates against deterministic Hammer results while testing projection code, central-meridian handling, or map rendering.

Demonstrate projection distortion

Generate sample points for lessons that compare Hammer area preservation with the shapes, angles, and extreme latitudes shown by other world projections.

What does one API request cost?

The base price is $0.002 per projected coordinate. The browser calculator can also run this deterministic capability locally.

Does Hammer preserve distances or angles?

No. It preserves area on the sphere, but distances, directions, angles, and shapes can be distorted, especially toward the edge.

What units are x and y in?

They use the same arbitrary units as the radius input. Use radius one for normalized coordinates, then apply your own display scale.

Why is longitude wrapped?

A world map contains one complete turn around the sphere. Wrapping places equivalent longitudes together and locates the seam opposite the selected central meridian.

Can I change which region is centered?

Yes. Set central_meridian_deg to the longitude that should run through the middle of the Hammer map.

Does this use an ellipsoidal Earth datum?

No. This is the standard spherical Hammer formula with a configurable scale radius, not a datum transformation or ellipsoidal coordinate reference system.

Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.

POSThttps://api.kit.forhosting.com/geo/hammer-project

Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.

curl -X POST https://api.kit.forhosting.com/geo/hammer-project \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"lat_deg":40.7128,"lon_deg":-74.006}'
{
  "lat_deg": 40.7128,
  "lon_deg": -74.006
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "geo.hammer_project",
  "status": "queued",
  "_links": {
    "result": "/tasks/tsk_…/result"
  }
}

The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.

Per request$0.002

Published price — no tokens, no invented credits. A failed task is never charged.

HTTPCodeMeaning
401unauthorizedMissing or invalid API key.
402insufficient_balanceYour balance doesn't cover the task price.
404unknown_typeThat task type doesn't exist.
429rate_limitedToo many requests. Use the webhook instead of polling.

Read the full KIT documentation →