Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions meta/object-model.json
Original file line number Diff line number Diff line change
Expand Up @@ -911,6 +911,16 @@
"conditional": "RASTER",
"doc": "A georeferenced raster of one or more bands, the value every raster accessor, clip, warp and polygonization takes. MEOS registers it in no enum, so it names no temptype."
},
"BandStats": {
"kind": "leaf",
"parent": "Value",
"prefixes": [
"bandstats"
],
"temptype": null,
"conditional": "RASTER",
"doc": "What a raster band's pixels amount to, taken in one pass: how many pixels hold a value and their sum, mean, standard deviation, least and greatest, the record PostGIS's ST_SummaryStats states. Raster.summaryStats answers one and the summaryStats aggregate gathers one over rasters; MEOS registers it in no enum, so it names no temptype."
},
"Pcschema": {
"kind": "leaf",
"parent": "Value",
Expand Down
17 changes: 15 additions & 2 deletions tests/test_object_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -447,6 +447,19 @@ def test_a_member_of_a_leafs_box_is_named_with_its_value_type(self):
"tbigintbox_expand": "expandBigint"})
self.assertEqual(om["functionToClass"]["tintbox_expand"]["class"], "TBox")

def test_the_statistics_of_a_band_are_a_class_of_their_own(self):
# As #test_the_ever_and_always_forms_of_a_member_stand_beside_it: the record
# raster_summary_stats answers is the class BandStats, whose accessors are
# its members named by what they read.
idl = attach_object_model({"functions": [
self._fn("bandstats_count", "const BandStats *"),
self._fn("bandstats_mean", "const BandStats *", "double *"),
]}, MODEL, None)
om = idl["objectModel"]
names = {m["function"]: m["ooName"] for m in om["classes"]["BandStats"]["methods"]}
self.assertEqual(names, {"bandstats_count": "count", "bandstats_mean": "mean"})
self.assertEqual(om["functionToClass"]["bandstats_mean"]["class"], "BandStats")

def test_the_ever_and_always_forms_of_a_member_stand_beside_it(self):
# As #test_a_member_of_a_leafs_box_is_named_with_its_value_type, for the
# e<prefix> and a<prefix> forms #_candidates derives: eraster_value is the
Expand Down Expand Up @@ -743,8 +756,8 @@ def test_a_type_meos_registers_in_no_enum_still_gets_a_class(self):
unregistered = {n for n, s in nodes.items()
if s["kind"] == "leaf" and s["temptype"] is None}
self.assertEqual(unregistered,
{"Pcschema", "Raster", "RTree", "RTreeNNCursor", "SPTree",
"SPNNCursor", "MeosArray", "SkipList"})
{"Pcschema", "Raster", "BandStats", "RTree", "RTreeNNCursor",
"SPTree", "SPNNCursor", "MeosArray", "SkipList"})

def test_the_aggregate_state_is_a_class_and_numeric_is_none(self):
# A SkipList is what every temporal aggregate's transition function
Expand Down
Loading