Skip to content

Data

Map

The map shows a whole query result or table in its own tab. DBCode reads your columns to work out where each row goes, from coordinates and shapes to countries, cities and postcodes, and places the rows for you.

Draw to filter, playback, hexagons, Ask AI and Save to Library are Pro features. Without Pro they show a lock and offer a trial. On the sample database, everything except Ask AI works for free. Ask AI needs Pro, even on the sample database. See Pricing for details.

The Flights sample on the map, with lines colored by airline, the side panel and the legend

  • From the data grid: Click the globe icon in the grid toolbar on any query result or table data.
  • From the DB Explorer: Right-click a table and select Open on Map.
  • From Explore: Click the globe icon (Open on Map). The map opens on Explore’s current filtered rows.
  • From the Inspector: In Map view, click Open on Map.

The map runs its own query and uses the same row limit as the grid. When the limit cuts the result short, a badge under the map offers more rows, and loading them keeps your view and settings. Click the refresh icon on the rows panel’s header, under the map, to run the query again.

The rows panel’s header shows how many rows are plotted, how many are not placed and how many the legend hides.

Samples, at the bottom of the map’s side panel, lists ready-made maps that each show a map feature on real data, and it is there even when nothing in your result can be placed. Click a sample to open it in a new tab on the sample database, using your saved Sample - SQLite connection, or a Sample - SQLite connection added for the session that is gone after a reload. A sample works like any other map: Refresh, SQL, Save and Export all work, and you can draw to filter on the samples that store coordinates: Courier deliveries, Earthquakes and Flights. The Pro features are free there as on any map of the sample database, except Ask AI, which needs Pro.

  • Courier deliveries: a day of deliveries in Midtown Manhattan, seen tilted among the 3D buildings, with each courier’s path building up along the streets and avenues as playback runs.
  • Earthquakes: a heat map of large earthquakes since 2000, weighted by magnitude. Quakes flash up as playback runs through the years. Switch Draw as to Clusters or Hexagons to group them.
  • Flights: lines joining each flight’s origin and destination, colored by airline.
  • Delivery zones: 34 zones covering Manhattan from the Battery to Inwood, from a GeoJSON column, shaded by orders.
  • Countries: countries shaded by GDP per person. Change Value to population or GDP to recolor the map.
  • Places by name: stores placed from their city and state alone. Two are not found, and Not placed shows why.

Click the chevron on Samples to collapse it, and later maps open with it collapsed.

The Samples list in the map's side panel

DBCode chooses how to place the rows when the map opens, and Place rows by shows the columns it found. Click Change to pick another way or other columns.

Place rows byWhat it reads
Latitude + longitude columnsA pair of number columns. To latitude and To longitude set where Lines end
One “lat, lng” text columnText holding both values, in the order you choose
Geometry or GeoJSON columnGeometry and geography columns, and GeoJSON values
Geohash columnGeohash strings
Country codes or namesISO country codes or English country names, drawn as country outlines
City nameA city with a country, and an optional state to narrow the match
PostcodeA postcode with a country
State or provinceState or province codes or names with a country, drawn as outlines

Where a country is needed, choose a column that holds it, or pick one country for every row.

Cities, postcodes, states and provinces use place-name data that you download once. The first time a map needs it, Place-name data needed appears with the download size. Click Download, or click Not now to leave it for later. The download comes back when you click Change and apply a placement, or when you open the map again.

The Place-name data needed prompt in the side panel

The data is about 24 MB, stays on your computer through DBCode and VS Code updates, and place names are looked up on your computer. It comes from GeoNames under CC BY 4.0, and the map credits GeoNames whenever place names are in use.

A row goes on the map only when DBCode can place it with confidence. Every other row is listed under Not placed with its reason, such as NULL value, Out of range or Ambiguous. Click the not placed count under the map to see those rows and their reasons in the rows panel.

The Places by name sample with two rows not placed, listed with their reasons in the rows panel

A city name can fit several places. DBCode picks one when it is far larger than the others, so Paris in France places. Springfield in the United States is reported as ambiguous until you add a State column.

Choose a style under Draw as. Its options appear below it, with shared options such as Opacity under Style.

StyleWhat it draws
PointsOne mark per row. Use Size by and Color by to show values, and Label to name each mark
ClustersNearby rows grouped into a count. Click a cluster to zoom into it
PathRows joined in Order by order, with one path per value of One path per, such as one per vehicle. S and E mark each path’s start and end
LinesA line from each row’s location to its destination, straight or curved
RegionsCountries, states and polygon shapes shaded by row count or by a number column, using sum, avg, min or max
Heat mapWhere rows are densest. Set Radius and Intensity, and use Weight by to count a number column instead of rows
HexagonsRows grouped into hexagon cells, shaded the same way as Regions

The Earthquakes sample drawn as a heat map weighted by magnitude

Rows placed by a shape, such as a polygon or a country outline, draw as that shape.

DBCode picks a Color by column for you when the result has a good one, and a note says so.

With no Color by, rows draw in the connection’s color until you pick a Color. A saved map keeps only a color you picked, so it follows the connection it opens on.

Hexagons is a Pro feature. Cell size follows the zoom, and Cell size sets one by hand.

The legend on the map explains the colors. It lists the top values with their row counts, or shows a color ramp labeled with the real lowest and highest values.

The Countries sample drawn as regions shaded by GDP per person, with a color ramp legend

Click a value to hide it. It is struck through, its rows leave the map, and the count under the map shows how many are hidden. Click it again to bring the rows back.

Hover a mark to see its Tooltip title, which you set under Hover. Hovering a region or hexagon shows its row count, along with its value when it is shaded by one.

Hovering a cluster shows how many rows it holds, and hovering a heat map shows the row under the cursor.

Click a point, a shape, a line drawn by Lines or a row on a heat map to see the whole row, as a list or as JSON. The popup can copy the row, and Show in table opens it in the rows panel.

Click a region drawn by Regions to see its rows. A region with one row opens that row’s popup. A region with several rows opens the rows panel with only its rows, headed with the region’s name and row count.

The rows panel sits under the map. Click its header to expand or collapse it, and drag the handle above it to make it taller or shorter. It shows:

  • Every row on the map, when opened from its header
  • One row, from Show in table
  • The not placed rows with a reason column, from the not placed count
  • The rows inside a drawn area, from Open rows
  • The rows of a region, from clicking the region

Click SQL on the rows panel’s header to see the query behind the map. Change it and click Run, and the map updates in place with your view and settings. Settings that name a column the new query no longer returns are dropped. If the query fails, its error shows and the map stays as it was.

Any query runs as it would in a SQL editor, and your connection’s role applies. Only a query that reads data replaces the map’s query, which Refresh and the row limit run again. Any other query, such as an UPDATE, leaves the map as it was and says what it ran, with how many rows changed for a write to rows.

Draw on the map to filter the rows in the database. Draw to filter is a Pro feature.

  1. Pick the rectangle, circle or lasso tool on the map. The lasso closes itself back to where you started.
  2. Press, drag and release around an area.

DBCode adds the area to the map’s query and runs it, and Inside drawn area appears on the map. Click its close icon to clear the area and run the query without it.

A panel on the map shows how many rows are inside, with totals and averages for number columns and a count of distinct cities or countries. From there:

  • Open rows shows those rows in the rows panel.
  • Open as SQL opens the query with the area filter in a SQL editor.

A rectangle drawn on the Earthquakes sample, with the panel showing the rows inside

Drawing needs coordinates stored in the database, so it works on rows placed by latitude and longitude or geometry columns, where supported. For a circle or lasso on latitude and longitude columns, the SQL filters by the shape’s bounding box and the map trims the rows to the exact shape. Open rows shows the exact rows, and a comment in Open as SQL says the SQL uses the box.

Click Playback to watch the rows appear over time. Playback is a Pro feature.

A slider with play, pause and speed controls appears on the map. When the result has several date or time columns, choose one under Playback in the side panel. Choose how much to show:

  • All so far shows every row up to the current time.
  • Only the last shows a moving window of the minutes, hours or days you set.

Playback works with every style, and paths and lines grow as time passes. It plays the rows that are loaded, and says so when the row limit cut them short.

The Courier deliveries sample partway through playback, with each courier's path growing

Click Ask AI and describe the map you want in plain words, such as rentals by city colored by store, as a heat map. DBCode changes the map’s settings in one step and lists what changed. Click Undo to put them back.

The AI works from the column list, the map’s settings and a short summary of the map. Ask AI is a Pro feature.

Click Save to keep the map in your Library, Personal or Project. Save to Library is a Pro feature.

A saved map holds its query, placement, styles, hidden legend values, playback settings, drawn area and view. Opening it runs the query again and restores all of them. Click Save again to update it.

A saved map whose query does more than read shows the query and asks before it runs, and asks again on every Refresh.

Click Export on the map, choose a format, then choose where to save it:

  • PNG image: the map as drawn, with its legend and credits.
  • GeoJSON: the placed rows as features, with each row’s values as properties. Rows hidden by the legend are left out.

The basemap button under the zoom buttons moves between Match VS Code theme, Light and Dark, and DBCode remembers your choice for the next map. On a dark basemap, Regions and Hexagons reverse their colors so that more is always the stronger contrast.

The basemap loads from OpenFreeMap over the internet.