Skip to content

Enhance JSONL endpoint with tile metadata and error information #135

@MisterGC

Description

@MisterGC

Motivation

The current GeoJSON/JSONL endpoint (POST /tiles with Accept: application/jsonl) returns only basic GeoJSON FeatureCollections without tile-level metadata. This limits automated processing capabilities:

  • Cannot determine which mapget tile a JSONL line belongs to
  • No error information for automated retry logic
  • Missing timestamp/TTL for cache validation

Proposed Changes

Enhance the JSONL response format to include additional metadata per tile:

Field Type Description
mapgetTileId integer The mapget tile ID (64-bit decimal)
mapgetLayerId string Layer identifier within the map
mapId string Map identifier
idPrefix object Common ID parts shared by all features (optional)
timestamp string ISO 8601 timestamp when tile was created
ttl integer Time-to-live in milliseconds (optional)
error object Error info if tile creation failed (optional)
error.code integer Numeric error code (HTTP status, DB error, etc.)
error.message string Human-readable error message

Note: Using mapgetTileId and mapgetLayerId prefixes to avoid confusion with map format-specific terms.

Implementation

  • Add errorCode field to TileLayer class
  • Enhance TileFeatureLayer::toJson() to include all metadata
  • Update Python bindings
  • Update documentation
  • Add unit tests

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions