liveBook · Manning

Longitude

As explained in D3.js in Action, Third Edition

Longitude is the angular coordinate specifying an east–west position relative to a reference meridian on Earth.

Longitude is the angular coordinate for an east–west position, measured from the Greenwich meridian. It pairs with latitude, which measures north–south position. section 13.1.1

In a D3 map, longitude is supplied with latitude to a projection, which converts the geographic pair into an x–y position inside an SVG container. section 13.2.4 section 13.7

Plotting a city

A city record can store latitude and longitude alongside its name and related data. Passing [longitude, latitude] to an Equal Earth projection returns the coordinates used to position its SVG circle. section 13.2.4

const projection = d3.geoEqualEarth();

[x, y] = projection([longitude, latitude]);

Use the projection call to transform a geographic coordinate pair into drawable [x, y] coordinates. section 13.7

How D3.js in Action, Third Edition covers it

How deep it goes
Defines east–west measurement and demonstrates projection-based placement, but does not develop geographic measurement beyond mapping coordinates.
Examples
Uses Nobel laureates’ birth cities and GeoJSON polygon coordinates to demonstrate longitude in geographic data.
What it assumes
Learns longitude and latitude as coordinate concepts before using projections to render geographic points.
What you can do after
Apply it via D3 projections to place geographic points within an SVG map.
How it connects
Connects longitude to latitude, geographic projections, GeoJSON, D3, and SVG map rendering.

Also explained in

Compare how 2 books explain longitude →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of D3.js in Action, Third Edition. The section links point to the parts of the book it draws on.