Skip to content

Cannot create an item with epsg code set to "null" #308

@mmiller8878

Description

@mmiller8878

Ive got a geotiff in a custom CRS that does not have and epsg code. According to the docs on the projection extension, I should be able to set proj:epsg to null if I supply a wkt instead (which is what I'm doing) However, I'm getting an error when callingpystac.Catalog.validate_all().

I think the correct way to do this should be to set pystac.Item.ext.projection.epsg to None, however this does not actually set it to None, it unsets the property completely because it calls this function:

def _set_property(self, key, value, asset):

So that obviously fails the validator because proj:epsg is required.

I've also tried setting it directly to the json representation of a null value ("null"), but then the validator fails because apparently 'null' ...is not 'null':

jsonschema.exceptions.ValidationError: 'null' is not of type 'integer', 'null'


Failed validating 'type' in schema['allOf'][1]['properties']['properties']['properties']['proj:epsg']:
    {'title': 'EPSG code', 'type': ['integer', 'null']}


On instance['properties']['proj:epsg']:
    'null'

Am I missing something here/is there a better way of doing this? I can for example set the epsg code to 0 but that obviously feels wrong. I'm new to STAC so apologies if I've missed something!

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