Source code for geonode.harvesting.resourcedescriptor

#########################################################################
#
# 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()
[docs] class RecordDescriptionContact:
[docs] role: str
[docs] name: typing.Optional[str] = ""
[docs] organization: typing.Optional[str] = ""
[docs] position: typing.Optional[str] = ""
[docs] phone_voice: typing.Optional[str] = ""
[docs] phone_facsimile: typing.Optional[str] = ""
[docs] address_delivery_point: typing.Optional[str] = ""
[docs] address_city: typing.Optional[str] = ""
[docs] address_administrative_area: typing.Optional[str] = ""
[docs] address_postal_code: typing.Optional[str] = ""
[docs] address_country: typing.Optional[str] = ""
[docs] address_email: typing.Optional[str] = ""
@dataclasses.dataclass()
[docs] class RecordIdentification:
[docs] name: str
[docs] title: str
[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] native_format: typing.Optional[str] = None
[docs] other_constraints: typing.Optional[str] = ""
[docs] topic_category: typing.Optional[str] = None
[docs] supplemental_information: typing.Optional[str] = ""
[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] 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] uuid: uuid.UUID
[docs] identification: RecordIdentification
[docs] distribution: RecordDistribution
[docs] point_of_contact: typing.Optional[RecordDescriptionContact] = None
[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