Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
89 changes: 89 additions & 0 deletions src/routes/blog/post/announcing-spatial-columns/+page.markdoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
---
layout: post
title: "Announcing API for spatial columns: Build scalable location-aware apps with ease"
description: Handle maps, geofencing, routing, and compliance zones natively in Appwrite
date: 2025-09-18
cover: /images/blog/announcing-spatial-columns/cover.png
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Cover path likely missing.

cover: /images/blog/announcing-spatial-columns/cover.png is referenced, but no such file was added. See image comment to add the asset or update the path.

🤖 Prompt for AI Agents
In src/routes/blog/post/announcing-spatial-columns/+page.markdoc around line 6,
the frontmatter references cover:
/images/blog/announcing-spatial-columns/cover.png but that file was not added;
either add the image asset at that exact path in the repository (e.g., place the
file at static/images/blog/announcing-spatial-columns/cover.png or your repo's
public/static image folder so the URL resolves) or update the cover value to
point to an existing image path; commit the added image or update the path in
the markdoc file accordingly.

timeToRead: 5
author: jake-barnby
category: announcement
featured: false
---
Working with geographic data has always been tricky. If you’ve ever tried building “find nearby” or geofencing features, you’ve probably ended up storing coordinates as generic arrays or strings and then writing custom logic in your app to filter, compare, and compute relationships between locations.

It works at first, but as your data grows, you start to feel the pain: queries get slow, results become imprecise, and maintaining it all gets expensive.

That’s why we’re introducing **Spatial columns and queries**. Now, you can store points, lines, and polygons directly in Appwrite Database, index them efficiently, and query how they interact with each other. No hacks or workarounds required.

# Store and query geo data directly in your database

Appwrite now gives you **first-class geo primitives and queries.**

Here’s what you get:

**New attribute types**
- `point`: Perfect for things like bus stops, delivery drop-offs, or user check-ins.
- `line`: Ideal for routes, bike paths, or utility lines.
- `polygon`: → Great for delivery zones, property boundaries, or compliance regions.

**New index type**
- `spatial`: Built to keep geo queries lightning fast, even when your dataset grows into the millions.

**12 new geo query operators**
- `crosses`
- `notCrosses`
- `distanceEqual`
- `distanceNotEqual`
- `distanceGreaterThan`
- `distanceLessThan`
- `intersects`
- `notIntersects`
- `overlaps`
- `notOverlaps`
- `touches`
- `notTouches`

# Practical applications

With these new capabilities, you can go far beyond simple “find nearby” queries and start answering richer spatial questions in your applications.

For example, you could

- Check which delivery routes (lines) intersect with a flood zone (polygon).
- Identify all customers (points) who fall outside of a service area (polygon).
- Find every bike trail (line) that touches the boundary of a city park (polygon).

And of course, you can still keep it simple, like using a point attribute to store bus stop locations and running a `distanceLessThan` query to instantly find all bus stops within 200 meters of a user’s house.

# Immediate benefits

Spatial columns don’t just make things easier; they open the door to entirely new workflows and capabilities:

- **Accurate geo logic**: Built-in support for predicates like intersects, overlaps, and touches.
- **Fast lookups**: Queries are powered by spatial indexes designed for scale.
- **Cleaner code**: No more geometry libraries in your application layer.
- **Real-world workflows**: Geofencing, delivery radii, route coverage, region lookups, property boundaries, and compliance zones. All handled natively.

# What you need to know before using it

Before you dive in, here are a few important things about Spatial columns:

- Use spatial indexes: Queries without a spatial index will work, but won’t perform well at scale.
- Choose the right type:
- `point` → single locations (shops, vehicles, users)
- `line` → paths and routes
- `polygon` → service areas, regions, or geofences
- Composability: Spatial queries can be combined with other filters for powerful workflows.

# Availability

Spatial columns and queries are now available on **Appwrite Cloud** and will arrive self-hosted in the next release.

If you’re building maps, logistics, travel, mobility, real estate, or safety and compliance features, this unlocks the geo foundation you’ve been waiting for. From search-nearby to geofencing, from routing coverage to compliance zones, you can now handle it all natively inside Appwrite.

Define your spatial columns, add a spatial index, and start building location-aware apps that scale without workarounds.

# More resources
- [Read the documentation to get started](/docs/products/databases/geo-queries)
- [Announcing inversion queries: Exclusion rules made simple](/blog/post/announcing-inversion-queries)
- [Announcing an improved Appwrite Databases experience: A completely new look and feel](/blog/post/announcing-appwrite-databases-new-ui)
21 changes: 21 additions & 0 deletions src/routes/changelog/(entries)/2025-09-18.markdoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
layout: changelog
title: "Announcing API for spatial columns: Build scalable location-aware apps with ease"
date: 2025-09-18
cover: /images/blog/announcing-spatial-columns/cover.png
---
Announcing: API for spatial columns

Working with geo data usually means storing raw coordinates and writing custom logic that slows down as your dataset grows.

But now, you can build scalable geo workflows right out of the box.

With this new API, you can now store `point`, `line`, and `polygon` data as first-class attributes, index them with a spatial index, and run 12 new geo operators natively. No extra geometry libraries, no workarounds.

If you’re building maps, logistics, travel, mobility, real estate, or safety and compliance features, this can be the geo foundation you’ve been waiting for.

Now available on Appwrite Cloud and will arrive self-hosted in the next release.

{% arrow_link href="/blog/post/announcing-spatial-columns" %}
Read the announcement to learn more
{% /arrow_link %}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading