Someone with more math/spherical trigonometry/surveying experience please correct me
It seems like the API does not automatically calculate or return the area of the polygon, and it has to be calculated externally
The url of the explore tab lists the ne and sw bounding coordinates for the area selected, from those to you can extrapolate to all 4 coordinates of the polygon.
take this example url:
” https://www.inaturalist.org/observations?nelat=48.11&nelng=-121.77&subview=map&swlat=46.91&swlng=-123.66”
the 4 corners of this polygon in counterclockwise rotation are:
p1(48.11, -123.66) p2(46.91, -123.66) p3(46.91, -121.77) p4(48.11, -121.77)
Something to do with the Spherical Excess…
Area = R^2 × (Σ [ (λᵢ₋₁ - λᵢ₊₁) × sin(φᵢ) ] ) ÷ 2
-
R: Earth’s radius ( 6,378,137 for WGS84)
-
φᵢ: Latitude of vertex i in radians
-
λᵢ: Longitude of vertex i in radians
-
n: Number of vertices
-
i: Current vertex index (1 to n)
(λᵢ₋₁ - λᵢ₊₁) is a Cycling Index
When i=1: λᵢ₋₁ = λₙ (last vertex’s longitude)
When i=n: λᵢ₊₁ = λ₁ (first vertex’s longitude)
points need to be ordered counter-clockwise around the polygon
p1(48.11, -123.66) NW corner
p4(48.11, -121.77) NE corner
p3(46.91, -121.77) SE corner
p2(46.91, -123.66) SW corner
First step is to convert coordinate degrees to radians, Radians = Degrees × π / 180
p1: Lat/Long = 48.11°, -123.66° = 0.8396, 2.1582 rad
p2: Lat/Long= 46.91°, -123.66° = 0.8187, 2.1582 rad
p3: Lat/Long= 46.91°, -121.77° = 0.8187, 2.1251 rad
p4: Lat/Long= 48.11°, 121.77° = 0.8396, 2.1251 rad
p1: φ₁ = 0.8396, λ₁ = -2.1582
p4: φ₄ = 0.8396, λ₄ = -2.1251
p3: φ₃ = 0.8187, λ₃ = -2.1251
p2: φ₂ = 0.8187, λ₂ = -2.158
Calculate Each Term
Term 1 = (λ₄ - λ₂) × sin(φ₁)
= (-2.1251 - (-2.1582)) × sin(0.8396)
= (0.0331) × 0.7441 = 0.02463
Term 2 = (λ₁ - λ₃) × sin(φ₂)
= (-2.1582 - (-2.1251)) × sin(0.8187)
= (-0.0331) × 0.7293 = -0.02414
Term 3 = (λ₂ - λ₄) × sin(φ₃)
= (-2.1582 - (-2.1251)) × sin(0.8187)
= (-0.0331) × 0.7293 = -0.02414
Term 4 = (λ₃ - λ₁) × sin(φ₄)
= (-2.1251 - (-2.1582)) × sin(0.8396)
= (0.0331) × 0.7441 = 0.02463
Since this polygon is a rectangle the value of terms repeat due to symmetry
Sum of terms (Σ,sum) = 0.02463 - 0.02414 - 0.02414 + 0.02463 = 0.00098
Area = R² × Sum ÷ 2
= (6378137)² × 0.00098 ÷ 2
= 1.993 × 10^10 m² = 19,930 km²
As far as I understand the formula calculates each latitude slices contribution to the total area: sin(φᵢ) gives the radius of the latitude circle at that point, (λᵢ₋₁ - λᵢ₊₁) represents the angular width that this latitude contributes, The cyclic indexing ensures all edges are properly accounted for
Since you don’t want to calculate by hand, vibe coded a Java Script to run in your browser console on an open explore tab:
// Automatically extract and calculate area from iNaturalist explore URL
function calculateINatAreaFromURL() {
// Get current URL parameters
const urlParams = new URLSearchParams(window.location.search);
// Extract bounding box coordinates
const nelat = parseFloat(urlParams.get('nelat'));
const nelng = parseFloat(urlParams.get('nelng'));
const swlat = parseFloat(urlParams.get('swlat'));
const swlng = parseFloat(urlParams.get('swlng'));
// Check if we have all required coordinates
if (!nelat || !nelng || !swlat || !swlng) {
console.log('❌ No bounding box coordinates found in URL');
console.log('Make sure you have nelat, nelng, swlat, swlng parameters');
return null;
}
console.log('📍 Extracted coordinates:');
console.log(` NE: (${nelat}, ${nelng})`);
console.log(` SW: (${swlat}, ${swlng})`);
// Calculate area
const R = 6378137; // Earth radius in meters
const toRad = deg => deg * Math.PI / 180;
const dLng = Math.abs(toRad(nelng) - toRad(swlng));
const dSinLat = Math.sin(toRad(nelat)) - Math.sin(toRad(swlat));
const areaM2 = R * R * dLng * Math.abs(dSinLat);
const areaKm2 = areaM2 / 1000000;
const areaMi2 = areaKm2 * 0.386102;
return {
km2: areaKm2,
mi2: areaMi2,
coordinates: { nelat, nelng, swlat, swlng }
};
}
// Run the calculation and display results
function displayAreaResults() {
const result = calculateINatAreaFromURL();
if (result) {
console.log('📐 CALCULATED AREA:');
console.log(` ${result.km2.toLocaleString('en-US', {maximumFractionDigits: 0})} km²`);
console.log(` ${result.mi2.toLocaleString('en-US', {maximumFractionDigits: 0})} mi²`);
console.log('---');
console.log('ℹ️ This is the approximate surface area of your search polygon');
// Optional: Create a visual alert
alert(`Search Area: ${result.km2.toLocaleString('en-US', {maximumFractionDigits: 0})} km²\n(${result.mi2.toLocaleString('en-US', {maximumFractionDigits: 0})} mi²)`);
}
}
// One-click function to run everything
function iNatArea() {
console.clear();
console.log('🌍 iNaturalist Area Calculator');
console.log('===============================');
displayAreaResults();
}
// Run it automatically when pasted
iNatArea();
// Also make it available as a function you can call later
console.log('\n💡 Type iNatArea() to run this again');