Import your data

The import wizard turns data you already have into Spatibase entries in a few steps, and can even create the type and its elements (fields) from your columns. The data can be a file, a Google Sheet, a Google My Maps map or a table in a PostGIS database. This page is for editors who import in the web app. Developers who want to import through the API should read the Import API reference.

What can I import?

Spatibase imports up to 10,000 rows (or features) at a time, from up to 45 MB of data. Owners and Editors can import; Developers cannot.

Source What it needs
CSV or TSV (.csv, .tsv, .txt) The first row must hold the column names. To put entries on the map you need latitude and longitude columns, or an address column.
Excel (.xlsx) Like a CSV: the first visible sheet with data is read, its first row holds the column names. Older .xls files and password-protected workbooks must be saved as .xlsx or CSV first.
GeoJSON (.geojson, .json) Each feature becomes one entry, and its shape becomes the entry’s location on the map. Feature properties are read like spreadsheet columns. A file in Web Mercator (EPSG:3857, as QGIS sometimes exports) is converted to longitude and latitude.
KML or KMZ (Google Earth, Google My Maps) Each place, line or area becomes one entry; its name and description and its extended data become columns. The folder it sits in becomes a folder column. Image overlays and network links are skipped.
GPX (GPS tracks, routes and waypoints) Each track, route and waypoint becomes one entry with its shape.
Shapefile A .zip with the .shp, .dbf and .prj files, or those files picked together. Its coordinates are converted to longitude and latitude using the .prj. Several layers in one zip are imported together, with a folder column naming the layer.
GeoParquet (.parquet, .geoparquet) Each row becomes one entry, with its shape from the file’s geometry column (WKB, the default of GDAL, QGIS, GeoPandas and DuckDB) and the other columns as fields. Shapes in Web Mercator are converted; other coordinate systems must be exported as WGS 84 first. A Parquet file without shapes is read like a CSV, with latitude and longitude columns. Columns of raw bytes (images, for example) are left out, and Spatibase names them. A file with more than 10,000 rows brings its first 10,000, and Spatibase says so.
Google Sheets A link to the sheet, shared as “Anyone with the link”. See Import a Google Sheet.
Google My Maps A link to the map, shared with “Anyone with this link can view”. See Import a Google My Maps map.
PostGIS A connection string to a PostgreSQL database with PostGIS that can be reached from the internet. See Import a PostGIS table.

Every imported entry arrives as a draft, so nothing goes live until you mark them ready and publish. Data with more than 10,000 rows, or larger than 45 MB, cannot be imported in one go: split it into smaller parts and import them one by one. A GeoJSON file that won’t import can be checked in the free GeoJSON validator: it uses the same geometry rules as the import, says which features would be skipped and why, and fixes the common mistakes in one click.

Start an import

There are two ways in:

  • In a new project. Click New project, choose File (or Online source for a Google Sheet, a Google My Maps map or a PostGIS table) and pick your data there. Spatibase names the project after it and opens the import wizard as soon as the project is created. See Create a project from your data.
  • In a project you have. Open Entries, click New above the list and choose Import data…. On an empty project, Owners also get Import your data instead on the Entries screen.

At the top, choose where your data is: File, Google Sheets, My Maps or PostGIS. For a file, drag it into the box or click the box to choose it. Spatibase reads files in your browser and shows how many rows and columns it found, with a note when it converted or left something out. Then it takes you to the settings for the import.

Import a Google Sheet

  1. In Google Sheets, click Share and set General access to Anyone with the link (Viewer).
  2. Open the tab you want to import and copy the address from your browser.
  3. In Spatibase, choose Google Sheets, paste the address under Sheet link and click Load sheet.

The tab the link points to is imported, and its first row holds the column names, as in a CSV. A link from File → Share → Publish to the web works too. Spatibase reads the sheet once: later changes in the sheet don’t reach Spatibase, so import it again (with Match existing entries by, see Update existing entries instead of creating duplicates) to bring them in. If the sheet isn’t shared, Spatibase says how to share it.

Import a Google My Maps map

  1. In My Maps, open your map, click Share and turn on Anyone with this link can view (or make the map public).
  2. Copy the map’s address from your browser. It looks like https://www.google.com/maps/d/edit?mid=…; the viewer and embed links work too.
  3. In Spatibase, choose My Maps, paste the address under Map link and click Load map.

Spatibase reads the map the way My Maps’ own Export to KML/KMZ does. Every place, line and area becomes one entry with its name, description and the columns of the layer’s data table; the layer it sits in goes into a folder column, so you can turn it into a choice field and filter by it. Photos stay links (Google keeps the files). Areas and lines made of several parts, such as a country with islands, become one shape. The map is read once: later changes in My Maps don’t reach Spatibase.

Links from the Google Maps app (maps.app.goo.gl) and saved lists in Google Maps are not My Maps maps and can’t be imported. A map that is only shared with certain people can’t be read either: share it with a link first.

Import a PostGIS table

  1. Copy your database’s connection string, for example postgresql://user:password@host:5432/database. Hosts such as Supabase, Neon or AWS RDS show it in their dashboard. Add ?sslmode=require when your host asks for an encrypted connection.
  2. In Spatibase, choose PostGIS, paste it under Connection string (it shows as dots, because it holds your password; the eye button shows it) and click Connect.
  3. Spatibase lists every table and view with a map column (geometry or geography), with the kind of shapes and about how many rows it holds. Pick one and click Load table (or double-click it, or press Enter).

Each row becomes one entry, with the map column as its location and the other columns as fields; other map columns of the same table are left out. Shapes in another coordinate system are converted to longitude and latitude. A table with more than 10,000 rows is imported up to its first 10,000 rows, and Spatibase says so; import the rest from a view.

Spatibase reads the table once over a read-only connection and does not keep your connection string. A database user that can only read is best. The database must accept connections from the internet: Spatibase cannot reach localhost or a private network address. If your database or its firewall only accepts listed addresses (an IP allow list, common on Supabase, AWS RDS and company networks), add Spatibase’s server: 2.31.147.202. If that isn’t possible, export the table as GeoJSON or a shapefile (in QGIS, or with ogr2ogr) and import the file instead. If Spatibase can’t connect, check the host, the port and the allow list. Reading a table may take up to a minute; a slower read is stopped, so import a smaller view instead.

Choose where the entries go

Under Where should these entries go? you choose between two options:

  • A new type made from this file (or sheet, map or table): Spatibase suggests a field for each column and creates the type and its fields when you import. Use this when you start from an existing dataset and have not set up a content model for it yet.
  • A type you already have: you pick the type under Import as and match the file’s columns to its fields.

If none of the file’s columns match the selected type, Spatibase preselects the new type for you. You can always switch.

Only Owners can create a type, so Editors don’t see this choice: they import into a type the project already has. If the project has no types yet, an Owner has to create one (or import the file) first.

Tip: Creating a type from a file is the fastest way to get started with existing data. You can rename fields, change their settings or add more later in the content model. See Types.

Set the title and the location

Title comes from picks the column that becomes each entry’s title. Spatibase guesses a column such as “name” or “title”. Choose No title (Untitled) if your file has none.

Location on the map decides where each entry is placed:

  • GeoJSON, KML, GPX, Shapefile, GeoParquet, My Maps and PostGIS: the shapes come from the data. A feature made of several parts of one kind (islands, for example) is joined into one shape, and Spatibase says how many it joined. Spatibase shows how many points, lines and areas it found. Features that hold different kinds of shape together (a GeometryCollection of, say, a point and a line, from a KML MultiGeometry) are counted as “mixed shapes, skipped” and are not imported. Features with a shape that the type does not allow (for example a point in a type that only allows lines) are skipped. Features without a shape are skipped when the type requires a location, and imported without one otherwise.
  • CSV, TSV, Excel, Parquet without shapes and Google Sheets: choose Latitude & longitude columns and pick the Latitude column and Longitude column, or choose Address column and pick the column that holds the addresses. For a new type you can also choose No location (a table without a map position). Rows without usable coordinates are skipped when the type requires a location, and imported without a location otherwise.

Coordinates with a decimal comma, such as 41,3787, work too.

Match columns to fields

The Fields section controls which columns become field values. It works a little differently for the two options.

When you create a new type

Each ticked column becomes a field of the new type. For every column you see a few sample values, a field name you can edit and a field type that Spatibase guessed from your data:

Field type Typical column
Text (one line) names, short labels
Text (several lines) descriptions, notes
Structured data (JSON) nested values in GeoJSON properties
Number capacity, length, price
Yes / No yes/no, true/false
Date, Date and time 2024-05-01
Choice from a list a few values that repeat, such as “Tent” and “RV”
Web link addresses starting with https://
Color #00aa00
Phone number a column named “phone” with phone numbers
ID / slug a column such as “code” or “sku” with a unique value in every row

Change any guess that looks wrong. Untick a column to leave it out; empty columns start unticked. The columns you chose for the title and the location cannot also become fields. When you pick Choice from a list, the different values in the column become the options.

Name of the new type is taken from the file, sheet, map or table name (campsites.csv becomes “Campsites”). Change it before you import if you like.

When you import into an existing type

Each field of the type has a drop-down where you pick the column that fills it. Spatibase matches columns automatically when a column has the same name as the field or its identifier. Choose Don’t import to leave a field empty.

Images, files, extra map shapes and coordinate location fields cannot be filled from a file. Add those to each entry afterwards.

What happens to values that don’t fit?

A value that does not fit its field is left empty, and the import still creates the entry. The final screen lists these values as warnings, so you can fix them by hand or correct the file and import again.

Spatibase is forgiving with common spellings:

  • Numbers: 1.6, 1,6 and 1,234 all work. A comma before exactly three digits is a thousands separator (1,234 is 1234), a comma before one or two digits is a decimal comma (12,5). Anything else (1,2345, 1.234,5) is left empty with a warning, so write decimals with a dot. In latitude and longitude a comma is always the decimal point (41,3874).
  • Yes / No: yes, no, true, false, y, n, 1, 0, on, off and x, in any case.
  • Dates and times: 2024-05-01 and May 1, 2024 both become a date. Times such as 9:30, 7:30 pm or 9am work.
  • Choices: the option’s name or its value, in any case. For fields that allow several options, separate them with ,, ; or |. An unknown option leaves the whole value empty.
  • Links: must start with http:// or https://.
  • Colors: #0a0 or #00aa00. Color names such as “teal” are not read.
  • Links to other entries: the title of an existing entry of the right type. Entries created by the same import cannot be linked yet, so import the targets first.

Date ranges cannot be read from a text cell.

Update existing entries instead of creating duplicates

Match existing entries by lets an import update entries you already have. It appears when you import into an existing type that has an ID field (an identifier such as a code or a slug).

  1. Map the column that holds the ID to its field under Fields.
  2. Choose that field under Match existing entries by.
  3. Import as usual.

Rows whose ID matches an existing entry of the type (or of one of its subtypes) update that entry’s draft instead of creating a new one. Rows with a new ID create new entries.

  • Only the values in the file change. Other fields keep their values, and an entry keeps its title and location when the row has none.
  • An updated entry that was already published shows “Unpublished changes” until you mark it ready and publish again.
  • If two rows in the file match the same entry, the second one is skipped.

Without Match existing entries by, importing the same file again creates every entry a second time.

Import translations

If your project has languages, a file can carry the translations too. Add a column per language and field, named after the field with the language code: title_de, description_de, or description:de. When you import into an existing type, Spatibase reads these columns as the German title and text of each entry and leaves empty cells alone. The wizard does not list these columns in its preview, so check an entry afterwards.

To translate entries you already have, match them by an ID field and import a file that holds only the ID and the translated columns. Anything bigger is easier with an AI assistant: see Translate your content.

Look up addresses

When you choose Address column, Spatibase looks up each address on the map with OpenStreetMap and places the entry there.

  • Looking up takes about one second per row, so 250 addresses take about four minutes. Keep the window open until the import finishes.
  • Each different address is looked up once, so repeated addresses cost nothing extra. At most 250 different addresses can be looked up per import. For larger files, add latitude and longitude columns or import the rest in a separate file.
  • When an address cannot be found, the row is skipped if the type requires a location. Otherwise the entry is created without a location, and you can place it on the map later.

Add imported entries to groups

Add to groups (shown when the project has groups) adds every created or updated entry to the groups you tick. See Curate groups of entries.

Check the preview and import

The Preview shows the first five entries as they will be created, with their title, location and the first few fields.

  1. Check the preview.
  2. Click Import (or Create type and import for a new type). The button shows how many entries will be imported.
  3. Wait for the import to finish. Large files and address lookups take a while.

If the button is greyed out, the text next to it says what is missing, for example Choose the latitude and longitude columns. If you close the window or click Choose other data after changing settings, Spatibase asks first, because those settings are lost.

Read the results and warnings

When the import is done, the final screen shows:

  • how many entries were created as drafts, and in which type;
  • for a new type, how many fields it got (you can adjust them under Content model);
  • how many existing entries were updated;
  • how many rows were skipped (not written at all, for example a row without a required location);
  • a list of warnings, grouped by reason, each naming the rows it affects.

A warning about a value that was left empty does not mean the row was skipped: the entry was still created. Check the new entries in the list, then mark them ready and publish when they are good to go. See Drafts and publishing.

Note: If Spatibase created a new type but the import itself failed, the type stays. Fix the problem and import again: the wizard then imports into the type it already created.

Each import is recorded in Activity. Tick Hide imported entries there to keep a large import from filling the list. See Activity and trash.

Save from a free tool

The free tools that open or convert a file, such as the KML & KMZ viewer, the Shapefile viewer, the GeoJSON validator and Map from Excel or CSV, have a Save to Spatibase (free) button. It sends Spatibase the same GeoJSON that Download GeoJSON gives you, so you don’t have to download the file and import it by hand.

  1. In the tool, click Save to Spatibase (free). Spatibase opens in a new tab and says Getting your file.
  2. If you are not signed in, Spatibase asks you to create your free account or log in, and tells you that your file is waiting in this browser. Type the 6-digit code from the email, or open the email’s link in the same browser.
  3. Under Where should “…” go?, choose New project (named after the file; you can change the name) or one of your projects, then click Continue. If there is no project you can add the file to, for example on a new account, Spatibase creates a new project without asking. Discard this file throws the file away.
  4. The import wizard opens with your file already read. Check the settings and click Import (or Create type and import).
  5. In a project that was created for your file, click Publish N entries. Spatibase marks them ready, publishes the project as one version and shows the address where they are live as GeoJSON, with a Copy button and, when the project’s API is public, an Open button. In a project you already had, nothing is published for you: the final screen shows the address the entries will have once you publish them.

Your file stays in your browser until you click Import: nothing is uploaded before that. It waits in that browser for 24 hours, and is removed when the import is done, when you close the import wizard, when you click Discard this file and when you sign out. If you open the sign-in email on another device, Spatibase says Your file isn’t in this browser: go back to the browser where you used the tool.

The tool tells you when the file could not be sent: your browser blocked the new tab, Spatibase did not answer within 20 seconds, the tab was closed, or the file is larger than 45 MB or has more than 10,000 features. Each of these messages offers Download GeoJSON, so you can import the file yourself. Pages that only draw shapes on a map (the radius map and the bounding box finder) have no Save button.

If the project’s API is private, apps need a key to read the live address. The final screen links to Manage access and keys; see Access and keys.

Updated

Docs support

How can we help?

A person on our team reads every message. We include the page you are on, so you don't have to explain where.

Or write to hello@spatibase.com. For outages, check System status.

Talk to us

Not sure it’s a fit? Let’s find out

Tell us about your use case and what you need, from data model to security and deployment. In 30 minutes we’ll look at it together and tell you honestly if we can help.

Or write to hello@spatibase.com.