# Radius map

> Search a place or click the map, set a distance, and see the area within that radius. Add several circles, in kilometres or miles, then share a link or download them. Free, no account needed.

Open the tool: https://spatibase.com/tools/radius-map/

The Spatibase radius map draws a circle of a set distance around any place, in your web browser. Each circle is geodesic: every point of its edge lies at the true distance from the centre over the Earth’s surface, so it covers exactly the ground within the radius, even where the map makes it look stretched. Add several circles with names, in metres, kilometres, miles, feet or nautical miles, see each one’s area, and download them as GeoJSON, KML or CSV, or share them as a link. It’s free with no account. Everything you draw stays in your browser; a place search is sent to OpenStreetMap’s Nominatim.

What sets it apart from a quick circle on a map:

- **True distance.** The edge is measured over the ground, not in degrees or screen pixels, which both go wrong away from the equator.
- **Several circles at once.** Each with its own radius, unit, name and colour, such as two shops’ delivery zones.
- **Files other software opens.** GeoJSON for code and GIS, KML for Google Earth and Google My Maps, and a CSV of the centres for a spreadsheet.
- **As the crow flies.** A radius is a straight line, not drive or walk time: 5 km across a river can be a long way round.

## What it does
- Search a place or click the map to add a circle
- Several circles, each with a name, colour and radius
- Units: metres, kilometres, miles, feet, nautical miles
- Geodesic circles: the true distance over the Earth
- Drag a centre to move its circle
- Area and circumference of every circle
- Download GeoJSON, KML or a CSV of the centres
- Copy a link that reopens the same circles

## How to draw a radius on a map
Pick a centre, set the distance, then take the result with you.

1. Search for a place, or click the map where the centre should be. No place in mind? Open the sample: two circles in Barcelona.
2. Type the radius and pick its unit: metres, kilometres, miles, feet or nautical miles.
3. Name the circle, and drag its centre to move it.
4. Add more circles the same way, each with its own radius and unit.
5. Press Copy link to share the map, or download the circles as GeoJSON, KML or CSV.

## Input, output and limits
- **Input:** a place search (OpenStreetMap Nominatim) or a click on the map for each centre; a radius in metres, kilometres, miles, feet or nautical miles per circle.
- **Limits:** up to 50 circles, each with a radius up to 5,000 km.
- **Circles:** geodesic, 128 points each, every point at the radius from the centre on the WGS 84 ellipsoid (Vincenty’s formula). A circle across the 180° meridian is cut there into a MultiPolygon (RFC 7946); a circle around a pole runs to the pole’s edge of the map. Area and circumference are within 0.01% up to 5,000 km.
- **GeoJSON:** a Polygon (or MultiPolygon) per circle with the properties `name`, `radius_m`, `radius`, `unit`, `center_lng` and `center_lat`, then a Point for each centre; coordinates to 7 decimals.
- **KML:** a placemark per circle and per centre, with the same properties, for Google Earth and Google My Maps.
- **CSV:** one row per centre: `name`, `latitude`, `longitude`, `radius`, `unit`, `radius_m`.
- **Shareable link:** the circles live in the page address (`?c=lat,lng,2km,name|…`, latitude first), so a link reopens them, for example https://spatibase.com/tools/radius-map/?c=41.387,2.17,2km,Pla%C3%A7a+de+Catalunya|41.4036,2.1744,1km,Sagrada+Fam%C3%ADlia
- **Privacy:** what you draw stays in your browser; a place search is sent to OpenStreetMap’s Nominatim.
- Try it with the sample (two circles in Barcelona): https://spatibase.com/tools/radius-map/?sample=1

## Why a circle on a map isn’t round
**The map is bent, not the circle.** Web maps use the Web Mercator projection, which stretches distances more the farther you go from the equator: 1.3 times at Barcelona, twice at Oslo, 60° north.

**Small circles look round, big ones like eggs.** Over a few kilometres the stretch hardly changes, so a circle stays round. A 1,000 km circle spans so much latitude that its poleward half is drawn larger: taller than wide, wider toward the pole.

The quick ways to draw a circle each miss in their own way:

- **A radius in degrees.** A degree of latitude is about 111 km everywhere, but a degree of longitude shrinks with the latitude: 83 km at Barcelona, 56 km at Oslo. A circle of 0.1° is an oval on the ground.
- **A circle in screen pixels.** Round on the Mercator map, it reaches too little ground toward the pole and too much toward the equator.
- **A geodesic circle,** what this tool draws, places each of its 128 edge points at the true distance from the centre, so it covers the same ground as a database search with that radius.

## Draw a radius circle in code
Turf’s circle function builds the same kind of polygon in JavaScript, and the Spatibase Content Delivery API finds your own places within a radius, nearest first.

```js
import * as turf from '@turf/turf'

// a 2 km circle around Plaça de Catalunya, Barcelona: [longitude, latitude]
const center = [2.17, 41.387]
const zone = turf.circle(center, 2, { steps: 128, units: 'kilometers' })
console.log(JSON.stringify(zone)) // a GeoJSON Feature with a Polygon

// your published places within 2 km, nearest first (Spatibase Content Delivery API)
const url = `https://api.spatibase.com/delivery/v1/projects/${PROJECT_ID}/entries?near=${center.join(',')}&radius=2000&sort=distance`
const { data } = await (await fetch(url)).json()
for (const entry of data) console.log(entry.title, Math.round(entry.distance), 'm')
```

**Longitude first.** Turf and the API both take `[lng, lat]` and `near=lng,lat`, while the link this page makes starts with the latitude, the way Google Maps writes places.

**Turf’s circle** measures on a sphere and uses 64 points unless you set `steps`; units include `meters`, `miles` and `nauticalmiles`.

**The Delivery API** takes the radius in metres (default 10,000), measures on the spheroid and adds `distance` to each entry. A public project needs no key.

## Frequently asked questions
### How do I draw a radius on Google Maps?
Google Maps has no circle tool; it can only measure the distance between points. Draw the circle here, download it as KML, then import the file into a Google My Maps map (Add layer, then Import) or open it in Google Earth.

### Can I set the radius in miles instead of kilometres?
Yes. Each circle has its own unit: metres, kilometres, miles, feet or nautical miles. A mile is 1,609.344 m and a nautical mile 1,852 m; the downloads also give every radius in metres, so other software reads it the same way.

### How accurate is the radius?
Each edge point is computed on the WGS 84 ellipsoid, the model GPS uses, so its distance from the centre is exact to well under a metre. Between the 128 points the edge is a straight line, which cuts inside the curve by at most 0.03% of the radius.

### Can I draw several circles on one map?
Yes, up to 50, each with its own centre, radius, unit, name and colour, and a radius of up to 5,000 km. Overlapping circles show where two areas meet.

### How do I share a radius map?
Press Copy link and send it. The circles are written into the link itself, so whoever opens it sees the same map; nothing is saved on a server and nobody needs an account.

### Why does my circle look like an oval or an egg?
The map stretches everything toward the poles, so a large circle that is round on the ground is drawn taller than wide. Every point of its edge is still the radius you set from the centre.

### Does a radius map show travel time?
No. A radius is straight-line distance, as the crow flies. Travel time follows roads and needs a routing service that draws an isochrone, which this tool doesn’t do.

## Next step
Keep your own places in one place and query them by radius: create a free Spatibase project (https://app.spatibase.com/signup), then ask the Content Delivery API for `near=lng,lat&radius=metres` (https://spatibase.com/docs/reference/delivery-api/).
