GeoLens

v1.35.0
io.github.geolens-io/geolens Checked 3 hours ago Published 2 days ago

Search a self-hosted GeoLens catalog and, with a map_author API key, create and style maps.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

search_datasets

Search the GeoLens catalog for datasets by free text. Matches title, description, and keywords (semantic ranking is used automatically when the instance has it enabled). Returns a compact FeatureCollection (`numberMatched`, `numberReturned`, `features`) where each feature is a trimmed dataset record: `id`, `bbox`, and properties `title`, `description` (cut at 300 characters), `record_type`, `geometry_type`, `feature_count`, `crs`, `keywords` and `updated`. Use the feature `id` as the dataset_id for the other tools; `get_dataset_schema` has the full detail. Each…

ParameterTypeDescription
query *string
limitinteger
offsetinteger

get_dataset_schema

Get a dataset's schema and source trust metadata. Returns columns (name/type/role), geometry type, CRS/SRID, feature count, spatial extent, and the safe `source_origin`. `source_health` is healthy, missing, inaccessible, or unknown: inaccessible means GeoLens could not determine whether the source still exists, while unknown means it was never probed or cannot be probed. `source_health_detail` is a fixed GeoLens reason code, not provider text. `last_checked_at` records the latest probe attempt; `last_refreshed_at` records only the latest successful committed refres…

ParameterTypeDescription
dataset_id *string

get_features

Get GeoJSON features for a dataset (bounded). Returns an OGC-API FeatureCollection. Raster datasets have no features and will error. Results are capped by `limit`; page with `offset`. Only the arguments listed below are supported; anything else is rejected. Args: dataset_id: Dataset id. limit: Max features (1-200, default 10). offset: Feature offset for paging. bbox: Optional bounding box filter "minx,miny,maxx,maxy" (WGS84).

ParameterTypeDescription
dataset_id *string
bbox
limitinteger
offsetinteger

list_maps

List saved maps (read-only metadata: id, name, visibility, layer count). Args: search: Optional text filter on map name/description. limit: Max results (1-200, default 50). offset: Result offset for paging.

ParameterTypeDescription
limitinteger
offsetinteger
search

get_map

Get a summary of one saved map: name, description, visibility, view state (center, zoom, bearing, pitch), basemap, terrain configuration and layer list. Each layer has `id`, `dataset_id`, `dataset_name`, `dataset_table_name`, `dataset_geometry_type`, `display_name`, `visible`, `layer_type` and `filter`. Styling, popups, labels, column info and sample values are not included. `dashboard_widget_count` is the number of dashboard widgets (0 for none). Args: map_id: Map id (e.g. from list_maps).

ParameterTypeDescription
map_id *string

list_stories

List published stories you can read (read-only metadata: id, title, summary, visibility, chapter count). Drafts are never listed. Args: search: Optional text filter on story title/summary. limit: Max results (1-200, default 50). offset: Result offset for paging. `total` and paging reflect the server's answer.

ParameterTypeDescription
limitinteger
offsetinteger
search

get_story

Get one story's published version: title, summary, visibility and the document with its chapters. Each chapter has a title, blocks and a scene (`map_id`, `camera`, `layer_visibility`); a chapter on a map you can't read comes back without its scene and with `scene_hidden` true. Never returns the draft. `document` is null until the story is published, and a story you can't read answers 404. Args: story_id: Story id (e.g. from list_stories).

ParameterTypeDescription
story_id *string

aggregate

Compute an exact aggregate over a dataset's rows: counts, summaries and breakdowns without writing SQL. Use `query` for anything else. `request` is the JSON body of the aggregate route, chosen by `op`. Every op takes an optional CQL2-JSON `filter` and an optional `bbox` `[west, south, east, north]` in WGS 84. Unknown keys are refused. - `{"op": "count"}` - `{"op": "stats", "column", "stats": [count|sum|avg|min|max, ...]}` - `{"op": "value_counts", "column", "limit"}` (limit 1-50, default 10) - `{"op": "histogram", "column", "bins"}` (bins 1-50, default 10)…

ParameterTypeDescription
dataset_id *string
request *object

query

Run one read-only SQL SELECT against accessible datasets. Executes through the server's hardened SQL sandbox: a single SELECT over `data.*` tables, an allowlisted function set (aggregates, math, string, date, JSON), and a strict server-side budget (a 5 s statement timeout, a repetition cap on self-joins, and `row_limit` rows, at most 1000). For counts, statistics, histograms and group-by summaries prefer `aggregate`, which needs no SQL. Returns `{columns, rows, row_count, truncated}` with rows as lists in column order. Geometry columns come back as hex EWKB; select…

ParameterTypeDescription
restrict_tables *array
sql *string
row_limitinteger

create_map

Create a private map and return its `id`, view, `basemap_style` and app `url`. Add data with `add_layer` and frame it with `set_camera`. Needs a `map_author` API key, which can change only the maps it created; a 401 or 403 means the server runs without one. Args: name: Map name. description: Optional short description. basemap: Optional basemap id from the instance's basemap list, or "blank" for none.

ParameterTypeDescription
name *string
basemap
description

add_layer

Add a dataset to a map as a new layer, optionally styled. Each new layer is drawn beneath the map's existing layers and can't be reordered, so add the layer you want on top first. Returns the new `layer_id`, the style written (with category values or class breaks and their colours) and the map's `url`. `style` is one of: - `{"type": "single", "color": "#3388ff"}` - `{"type": "categories", "column", "colors"}`: a colour per distinct value of a text, boolean or integer column (at most 100 values). - `{"type": "classes", "column", "method", "count", "colors"}`: a colour per range of a numeric…

ParameterTypeDescription
dataset_id *string
map_id *string
popup_fields
style

update_layer_style

Restyle a layer or change its popup fields. Give `style`, `popup_fields` or both. `style` is one of: - `{"type": "single", "color": "#3388ff"}` - `{"type": "categories", "column", "colors"}`: a colour per distinct value of a text, boolean or integer column (at most 100 values). - `{"type": "classes", "column", "method", "count", "colors"}`: a colour per range of a numeric column. `method` is equal_interval (default), quantile (always five classes, no `count`), jenks or std_dev; `count` is 3-9 (default 5). Or give `"breaks": [10, 50, 100]` instead of `method` and `count`. `colors` is…

ParameterTypeDescription
layer_id *string
map_id *string
popup_fields
style

set_camera

Set the view a map opens at. Only the arguments given change. Needs a `map_author` API key, which can change only the maps it created; a 401 or 403 means the server runs without one. Args: map_id: A map this key created. center: [longitude, latitude] in WGS 84. zoom: Zoom level, 0-24. pitch: Tilt in degrees, 0-85. bearing: Rotation in degrees, -180 to 180.

ParameterTypeDescription
map_id *string
bearing
center
pitch
zoom

set_basemap

Change a map's basemap. Needs a `map_author` API key, which can change only the maps it created; a 401 or 403 means the server runs without one. Args: map_id: A map this key created. basemap: Basemap id from the instance's basemap list, or "blank".

ParameterTypeDescription
basemap *string
map_id *string