#########################################################################
#
# Copyright (C) 2021 OSGeo
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
#########################################################################
import dataclasses
import datetime as dt
import typing
import uuid
from django.contrib.gis import geos
@dataclasses.dataclass()
@dataclasses.dataclass()
[docs]
class RecordIdentification:
[docs]
date: typing.Optional[dt.datetime] = None
[docs]
date_type: typing.Optional[str] = None
[docs]
originator: typing.Optional[RecordDescriptionContact] = None
[docs]
place_keywords: typing.Optional[typing.List[str]] = None
[docs]
other_keywords: typing.Optional[typing.Iterable] = None
[docs]
license: typing.Optional[typing.List[str]] = None
[docs]
abstract: typing.Optional[str] = ""
[docs]
purpose: typing.Optional[str] = ""
[docs]
status: typing.Optional[str] = ""
[docs]
other_constraints: typing.Optional[str] = ""
[docs]
topic_category: typing.Optional[str] = None
[docs]
spatial_extent: typing.Optional[geos.Polygon] = None
[docs]
lonlat_extent: typing.Optional[geos.Polygon] = None
[docs]
temporal_extent: typing.Optional[typing.Tuple[dt.datetime, dt.datetime]] = None
@dataclasses.dataclass()
[docs]
class RecordDistribution:
[docs]
link_url: typing.Optional[str] = None
[docs]
wms_url: typing.Optional[str] = None
[docs]
wfs_url: typing.Optional[str] = None
[docs]
wcs_url: typing.Optional[str] = None
[docs]
thumbnail_url: typing.Optional[str] = None
[docs]
download_url: typing.Optional[str] = None
[docs]
embed_url: typing.Optional[str] = None
@dataclasses.dataclass()
[docs]
class MapDescriptorParameters:
[docs]
last_modified: dt.datetime
@dataclasses.dataclass()
[docs]
class RecordDescription:
[docs]
identification: RecordIdentification
[docs]
distribution: RecordDistribution
[docs]
author: typing.Optional[RecordDescriptionContact] = None
[docs]
date_stamp: typing.Optional[dt.datetime] = None
[docs]
reference_systems: typing.Optional[typing.List[str]] = None
[docs]
data_quality: typing.Optional[str] = None
[docs]
additional_parameters: typing.Optional[typing.Dict] = dataclasses.field(default_factory=dict)
[docs]
language: typing.Optional[str] = None
[docs]
character_set: typing.Optional[str] = None