FieldLayers .magpkg Contribution Format

Status: v1.1 schema for synthetic fixture testing and local exporter preparation. Public intake is not open.

The .magpkg format is an offline file contract for future contribution packages. A package contains anonymous aggregated magnetic grid-cell summaries generated on the contributor's device. It does not contain a route, exact sample timestamps, account identity, device identity, payment identity, or personal contact fields.

The v0.9 pipeline tests this format only with deterministic synthetic packages. No live people, phones, robots, or upload endpoint are involved.

Package Boundary

A contribution package may contain:

A contribution package must not contain:

The schema uses additionalProperties: false at every object level. A package with an email field is rejected before aggregation.

Cell Grid

The grid encoding is fieldlayers_latlon_v1.

Formula:

cell_id = fl_<lat_index>_<lon_index>
lat_index = floor((lat + 90) / cell_size_deg)
lon_index = floor((lon + 180) / cell_size_deg)
cell_center_lat = lat_index * cell_size_deg - 90 + cell_size_deg / 2
cell_center_lon = lon_index * cell_size_deg - 180 + cell_size_deg / 2

The current synthetic fixtures use cell_size_deg = 0.01 in EPSG:4326.

Altitude v1.1

.magpkg schema 1.1 adds optional per-cell altitude summaries. These fields are

summary evidence, not a route:

cell, sanity-bounded to -500..9000 meters.

For phone logger packages, gps means the phone's location altitude. It is not

barometric altitude, not corrected sensor height, and not a guarantee that every

sample in the cell was recorded at a single physical height. Packages without

altitude fields remain valid for backward compatibility.

.magpkg packages do not compute terrain-aware voxel bins. Future merge code

uses DEM context and vertical datum correction to derive ground_elevation_m,

height_agl_m, and vertical_bin in the canonical store. If DEM/geoid context

is missing, the merge pipeline must leave those fields null rather than deriving

vertical bins from GPS altitude alone. See VERTICAL_GRID_POLICY.md.

Validation Stages

The validator returns a structured report with package-level reasons and per-cell reasons. Schema-valid packages may be partially accepted: accepted cells can continue to aggregation while rejected cells are cut and reported.

Reason codeLevelMeaning
schema_invalidpackageJSON Schema failed or an identity/raw-route field was found.
physics_implausiblecellA value, sample count, or confidence field is outside hard sanity bounds.
physics_extreme_warningcell warningmedian_nt is outside the warning range but inside the hard reject range.
geo_invalidcellcell_id cannot be decoded into a valid EPSG:4326 cell center.
geo_ocean_or_unmappedcellStreet-level cell falls in the coarse fixture landmask's ocean/unmapped area.
jurisdiction_not_allowedcellCell center is outside configured allowlist regions.
region_restrictedcellCell center intersects a configured restricted region.
partial_acceptpackageAt least one cell was accepted and at least one was rejected.
no_accepted_cellspackageNo cells survived validation.

The v0.9 landmask and jurisdiction files are test mechanisms, not a public intake policy.

Aggregation Semantics

The synthetic aggregation step groups accepted cells by cell_id.

The output fixture layer is crowd_street_synthetic. It is not added to the public catalog or viewer because it is synthetic and not a real data product.

Current Boundary

Intake is not open. This document is published so early adopters can prepare compatible local exporters, but FieldLayers does not currently accept uploads, accounts, forms, API submissions, or live contribution streams.