nga_feature_style) is an NGA community extension that stores visual rendering hints inside a GeoPackage. Styles and icons are stored in dedicated attribute tables and linked to feature rows via the Related Tables Extension, so any client that reads them can render features consistently without external style sheets.
This is an NGA community extension. It builds on top of the Related Tables Extension and the Contents ID extension.
Architecture
The extension maintains four relationship types per feature table:| Relationship | Purpose |
|---|---|
| Style | Row-level stroke styles (color, opacity, width) |
| Table Style | Default stroke style for the entire table |
| Icon | Row-level point icon images |
| Table Icon | Default icon image for the entire table |
StyleTable (an attributes table). Icons are rows in an IconTable (a media table). Mapping tables join feature row IDs to style/icon row IDs.
Key Classes
FeatureStyleExtension
Low-level extension class. Creates and queries style and icon relationships.
FeatureTableStyles (recommended)
High-level facade scoped to a single feature table. Manages all four relationship types and caches the table-level defaults.
StyleRow Properties
A StyleRow represents a single stroke/fill style definition.
Human-readable label for this style.
Optional description.
Hex color string for the stroke (e.g.
#FF0000). Use setHexColor() / getHexColor().Stroke opacity from
0.0 (transparent) to 1.0 (opaque). Defaults to 1.0.Hex color for polygon fill. Use
setFillHexColor() / getFillHexColor().Fill opacity from
0.0 to 1.0. Defaults to 1.0.Stroke width in pixels. Must be
>= 0.0.IconRow Properties
An IconRow is a media row that stores a raster icon image for point features.
Human-readable label.
Raw image bytes. Use
setData() / getData().MIME type of the image (e.g.
image/png). Use setContentType() / getContentType().Display width of the icon in pixels.
Display height of the icon in pixels.
Horizontal anchor point from
0.0 (left) to 1.0 (right). Default 0.5 (center).Vertical anchor point from
0.0 (top) to 1.0 (bottom). Default 1.0 (bottom, typical map pin).Setting Up Styles
Setting Up Icons
Getting Styles for Rendering
When rendering features, retrieve the effective style or icon (row-level overrides table-level defaults):Geometry-Type-Specific Styles
Styles can be assigned per geometry type using theGeometryType enum: