← All help

Field calculator & SQL

Compute and update columns with the field calculator, and run full SQL — including spatial functions — in the SQL console.

DropMaps runs DuckDB in your browser, so you can compute new columns and query your data with real SQL — no server, nothing uploaded.

Field calculator

A new value_per_m2 column, computed from two others.

Open Field calc from the attribute table. It fills or updates a column from an expression.

  • Target — update an Existing field, or create a New column (with a name and type).
  • Scope — apply to All features, or just the current Selected features.
  • Expression — reference columns with {field} tokens, e.g. {area} / 10000 for hectares. Show SQL reveals the full UPDATE statement being run.
  • Function buttons insert ready-made functions grouped by Text (UPPER, TRIM, CONCAT, SUBSTR…), Math (ROUND, ABS, POWER…), Logic (CASE WHEN, COALESCE…), Convert (CAST), Date (CURRENT_DATE, strftime…), and Spatial (geo_area, geo_length, ST_Centroid, ST_X/Y…).
  • Preview shows sample before/after values; Calculate applies the change.

SQL console

Summarise a layer with GROUP BY, then turn a filter into a new layer.

For anything beyond a single column, open Tools ▸ SQL console in the left nav for full read/write SQL across all your layers and tables.

Schema & snippets

A sidebar lists each layer/table and its columns — click to insert names into the editor. Every spatial layer exposes a geom column (lon/lat) and geom_m (metres) for distance/area work.

Accurate measurements

  • geo_area(geom), geo_length(geom) and geo_perimeter(geom) give exact geodesic square metres / metres on the WGS84 ellipsoid — the same values as the area_m2, length_m and perimeter_m fields. geo_distance(a.geom, b.geom) measures between two points.
  • geom_m is projected into a local metric CRS chosen from your layers’ extent (the UTM zone for a local area, an equal-area projection for continent-wide data), so ST_Buffer, ST_Distance and friends work in true ground metres. local_crs() returns that CRS — use it to turn a result back into lon/lat: ST_Transform(ST_Buffer(geom_m, 100), local_crs(), 'EPSG:4326', true).

Snippets drop in starting points: Preview a layer, Join two layers, Spatial overlay → layer, Buffer → layer, Dissolve → layer, Count by category, Points in polygons, and more.

Run & create layers

  • Run executes a read query and shows the results.
  • If a result has a geom column, name it and select Create layer to drop the query straight onto the map as a new, styleable, exportable layer.
  • Write statements (UPDATE / DELETE / DDL) run under Run (writes) — flagged as a danger action because they can’t be undone.

Function reference

A built-in, expandable reference covers text, math, logic, conversion, date, aggregate and window functions, plus the spatial set: ST_Intersection, ST_Intersects, ST_Contains, ST_Within, ST_Buffer, ST_Union_Agg, ST_Centroid, geo_area, geo_length, ST_Distance, ST_X/Y, ST_AsGeoJSON and more.

Everything runs client-side — your data never leaves the browser.

Next steps