SigMF icon indicating copy to clipboard operation
SigMF copied to clipboard

Cannot add `core:geolocation` field (GeoJSON validation)

Open volgy opened this issue 2 years ago • 2 comments

The following example fails in sigmf.validate.match_type():

import sigmf
from sigmf import SigMFFile

meta = SigMFFile(
    global_info = {
        SigMFFile.DATATYPE_KEY: "cf32_le",
        SigMFFile.VERSION_KEY: sigmf.__version__,
        SigMFFile.GEOLOCATION_KEY: {
            "type": "Point",
            "coordinates": [-107.6183682, 34.0787916, 2120.0]
        }
    }
)

It seems that the current schema validation code is not prepared to handle GeoJSON objects. Or, I misunderstand how these objects should be provided (unfortunately, I did not find any complete example or test code).

volgy avatar May 26 '22 15:05 volgy

The issue is the former, though its not exactly clear why.

@Teque5 any idea why this does not parse? https://github.com/gnuradio/SigMF/blob/sigmf-v1.x/sigmf/schema-meta.json#L89-L105

jacobagilbert avatar May 31 '22 16:05 jacobagilbert

Yes this does not parse because in sigmf/validate.py within match_type there is no valid type for dict. If we ever merge #224 then this will get resolved.

#224 allows list and dict types to be validated correctly.

We can close this issue or mark 224 as blocking.

Teque5 avatar Aug 14 '22 17:08 Teque5