Skip to content

Kepler.gl is a powerful open source geospatial analysis tool for large-scale data sets.

5.6 KB
Raw Blame

Draw on Map

Draw on Map lets you sketch points, lines, polygons, rectangles, and circles on the map. Sketches stay on the map until you delete them, convert them to a layer, or use a polygon, rectangle, or circle as a spatial filter.

Open the drawing tools

Click the Draw on Map button in the map controls (top right of the map). A menu of drawing tools appears.

Press Escape while a draw tool is active to return to Select.

Drawing tools

Tool How to draw Notes
Select Click a sketch to select it Move and edit existing sketches
Point Click the map Stays in point mode so you can add several points
Line Click to add vertices, double-click or press Enter to finish Stays in line mode so you can draw several lines. A length label appears at the cursor while you draw
Polygon Click to add vertices, click the first vertex (or double-click) to close Sketch only until you apply it as a filter
Rectangle Click and drag, or click two opposite corners Applied as a polygon filter when you finish drawing
Circle Click the center, then click or drag to set the radius Tessellated polygon. A radius label appears at the rim while you draw. Sketch only until you apply it as a filter or convert it to a layer

Select, move, and edit

  1. Choose Select, then click a sketch.
  2. Drag a point to move it.
  3. Drag the body of a line to move the whole line. Drag a vertex to reshape it. Click the line to insert a vertex.
  4. Drag the interior of a polygon, rectangle, or circle to move it. Drag a vertex to reshape it.

Right-click a selected sketch for Edit Properties, Copy Geometry, and Delete. Filter Layers and Extract data appear only for polygons, rectangles, and circles.

Edit properties

Right-click a sketch and choose Edit Properties to add, change, or remove name/value pairs. These are stored as GeoJSON properties and become columns when you convert sketches to a layer.

Filter layers

Polygons, rectangles, and circles can filter other layers so that only features inside the shape remain visible.

  • Rectangle becomes a filter as soon as you finish drawing it.
  • Polygon and Circle stay a sketch until you right-click and choose Filter Layers, then pick the layers to filter.

Filtered shapes use a dashed outline. A filter icon appears on the shape; click it to select the filter.

Points and lines cannot be used as filters.

If you turn off every filtered layer, the polygon returns to a sketch.

Extract data

Polygons, rectangles, and circles can copy in-memory rows that fall inside the drawing into a new dataset. This is independent of Convert to Layer, which turns the drawing itself into GeoJSON.

  1. Draw a polygon, rectangle, or circle.
  2. Right-click the shape and choose Extract data.
  3. Pick the layer to extract from. Only layers that can be spatially clipped (the same types as Filter Layers, plus vector tiles) are listed.

kepler.gl keeps currently filtered rows (range, select, time) and then clips them to the drawing. The new dataset is named Extracted plus the source dataset label, and a layer is created automatically.

Vector tiles: extract copies GeoJSON features from tiles that are already loaded in the current view (current zoom). It is a snapshot, not a download of the whole tileset. Features that intersect the drawing are included, including lines that cross it and polygons that contain it. Features split across tiles are deduped when they share an id. Raster, WMS, and 3D tiles cannot be extracted.

The original dataset and the drawing stay on the map.

Copy and convert to a layer

The drawing menu also includes:

  • Copy all — copies every sketch as a GeoJSON FeatureCollection.
  • Convert to Layer — turns the sketches into a GeoJSON dataset and layer named Drawn Geometry plus a number, then clears the sketches.

Disable sketch tools

Point, Line, Copy all, Convert to Layer, and Edit Properties are enabled by default. Polygon, rectangle, and circle drawing stay available if you turn the extra tools off:

import {initApplicationConfig} from '@kepler.gl/utils';

initApplicationConfig({enableDrawOnMapSketches: false});

Back to table of contents