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.

  • 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.

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 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.

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

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.

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.

Click a point, a shape or a line drawn by Lines 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.

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

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.

Edit query runs queries that return rows. Run changes to data from a SQL editor.

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.

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.

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.

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.