layer.symbology: manual graduated breaks refused on a layer read in place ("has no numeric values")

Open
#2,497 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
52/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
rust
Domain
backend, data

Research direction

Start by tracing layer.symbology for graduated renderers and how it obtains numeric values from layers read in place; compare that path with style.add and style.apply, which the issue says work. Then inspect how remote GeoParquet statistics are exposed for a field maximum and how view features are classified. Done means manual breaks produce the stated classes, and quantile classification uses the current view as described.

Written by the indexing model from the issue text.

Description

What happens

layer.symbology with "type": "graduated" and "method": "manual" is refused on a layer read in place (a remote GeoParquet or FlatGeobuf, read a view at a time): 'height' has no numeric values. Manual breaks don't need the field's values, but the command looks for them in the features held, and a layer read in place holds none.

The same classes, written as a style and applied with style.add and style.apply, draw correctly on that layer. So the renderer works; only the command refuses.

Steps to reproduce (RustGIS 0.7.0, code unchanged on main def3c292)

GlobalBuildingAtlas on Source Cooperative: a GeoParquet of 1.09 GB, 13.6 M buildings, with a numeric height field (Double):

layer.addUrl {"url": "https://data.source.coop/tge-labs/globalbuildingatlas-lod1/w045_s20_w040_s25.parquet", "name": "gba"}
map.goToXY {"lon": -42.8825, "lat": -20.754, "scale": 8000}
layer.symbology {"layer": "gba", "type": "graduated", "field": "height", "method": "manual", "breaks": [4, 7, 10, 15, 25]}
  • Result: layer.symbology: 'height' has no numeric values. Exporting the map first, so the view's features are read, gives the same answer.
  • Expected: the six classes, with upper bounds 4, 7, 10, 15 and 25. The last class would be closed by a large bound, since the field's largest value isn't known.
Choices in this proposal
  • Manual breaks: accepted without reading values. The last class is closed by the field's statistics when the file has them (GeoParquet column statistics give a max), else left open (+∞), and the legend says "more than 25".
  • Other methods (natural breaks, quantile…) on a layer read in place: classify the features the current view holds. The answer then says the classes come from the view.
  • Unique values: the same, values from the view.
  • Tests:
    • manual breaks on a remote GeoParquet layer give a Graduated renderer;
    • quantiles on it come from the view and say so.
Context

This came up in the BrasilData plugin, which colours GlobalBuildingAtlas buildings by height. The plugin now writes the classes as a style (style.add), which works around this.

Dominant language
Rust
Stars
1.9k
Forks
268
Avg merge
11h 1m
Merged PRs (30d)
942

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from opengeos/RustGIS

All issues in opengeos/RustGIS

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.