ErrorsReads and writes · rule
query.geometry_field
A map-layer query's geometry: names a field whose type isn't the shape the layer's result type says each feature holds.
Area 6, Reads and writes; not declinable; the next step is usually the agent's.
Why Jadpo refuses it
A query that returns a FeatureCollection<G, P> gives a map layer: one
feature per record, each with a geometry of type G. geometry: names
the stored field that becomes that geometry, and the stored value goes
into the layer as it is, with nothing built from it.
Here the layer holds Points, and delivery_area is a Polygon. A
client reading the layer expects each feature to be a point, so a polygon
would break it.
What it looks like
main.jadpo:
type BakeryName = Text { max_length: 80}entity Bakery { id: Uuid name: BakeryName spot: Point delivery_area: Polygon}type BakeryPin = Object { id: Bakery.id name: BakeryName}query bakery_map() -> FeatureCollection<Point, BakeryPin> { from: Bakery geometry: Bakery.delivery_area order: [Bakery.name asc] limit: 500}
error Bakery.delivery_area isn't a Point, so it can't be each feature's geometry
--> main.jadpo:19:15
|19 | geometry: Bakery.delivery_area | ^^^^^^^^^^^^^^^^^^^^ a `Polygon`
- reason
FeatureCollection<Point, BakeryPin>'s features each hold aPoint, and a stored value goes into the layer as it is, sogeometry:names a field of that type.- next
- Use
Bakery.spot(agent) - rule
- query.
geometry_ field - help
- https://jadpo.
dev/docs/errors/query. geometry_ field
(agent) at the end of the next: line means your coding agent can make
the fix itself.
How to fix it
If the map shows each bakery as a point, name the Point field:
geometry: Bakery.spotEach feature in the layer is a bakery's spot, with its id and name
as properties.
If the map shows each bakery's delivery area, make the layer one of
Polygons:
query delivery_map() -> FeatureCollection<Polygon, BakeryPin> { from: Bakery geometry: Bakery.delivery_area ...}
Each feature is now a bakery's delivery area, drawn as a polygon, so clients of the query get polygons where they used to expect points.
Related
Markdown for agents: /docs/errors/query.geometry_field.md.Built from Jadpo main at aee2e8f.