Skip to content

Commit

Permalink
Add some missing documentation in Python interfaces and add a first p…
Browse files Browse the repository at this point in the history
…roposal of Metadata.reference_system_info specification.

The question about what should be MD_ReferenceSystem type is discussed in #57
  • Loading branch information
desruisseaux committed Nov 25, 2019
1 parent 33d6fd7 commit 7b3b70e
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 3 deletions.
28 changes: 27 additions & 1 deletion geoapi/src/main/python/opengis/metadata/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ class Metadata(ABC):

@property
def metadata_identifier(self) -> Identifier:
"""Unique identifier for this metadata record."""
return None

@property
Expand All @@ -69,6 +70,7 @@ def parent_metadata(self) -> Citation:

@property
def metadata_scope(self) -> Sequence[MetadataScope]:
"""The scope or type of resource for which metadata is provided."""
return None

@property
Expand All @@ -80,7 +82,7 @@ def contact(self) -> Sequence[Responsibility]:
@property
@abstractmethod
def date_info(self) -> Sequence[Date]:
"""Date(s) other than creation dateEG: expiry date."""
"""Date(s) other than creation date. Example: expiry date."""
pass

@property
Expand All @@ -90,6 +92,7 @@ def metadata_standard(self) -> Sequence[Citation]:

@property
def metadata_profile(self) -> Sequence[Citation]:
"""Citation(s) for the profile(s) of the metadata standard to which the metadata conform."""
return None

@property
Expand All @@ -104,53 +107,76 @@ def metadata_linkage(self) -> Sequence[OnlineResource]:

@property
def spatial_representation_info(self) -> Sequence[SpatialRepresentation]:
"""Digital representation of spatial information in the dataset."""
return None

@property
def reference_system_info(self) -> Sequence[ReferenceSystem]:
"""
Description of the spatial and temporal reference systems used in the dataset.
The reference system may be:
* An ISO 19111 object such as ``CoordinateReferenceSystem``.
* A ``ReferenceSystem`` with the ``identifier`` property (from ISO 19111) sets to a list of ``Identifier`` values such as ``["EPSG::4326"]``.
* An object with the ``referenceSystemIdentifier`` property (from ISO 19115) sets to a single ``Identifier`` value such as ``"EPSG::4326"``,
optionally with a ``referenceSystemType`` property sets to a value such as ``geodeticGeographic2D`` or ``compoundProjectedTemporal``.
:rtype: Sequence[ReferenceSystem]
"""
return None

@property
def metadata_extension_info(self) -> Sequence[MetadataExtensionInformation]:
"""Information describing metadata extensions."""
return None

@property
@abstractmethod
def identification_info(self) -> Sequence[Identification]:
"""Basic information about the resource(s) to which the metadata applies."""
pass

@property
def content_info(self) -> Sequence[ContentInformation]:
"""Information about the feature and coverage characteristics."""
return None

@property
def distribution_info(self) -> Sequence[Distribution]:
"""Information about the distributor of and options for obtaining the resource(s)."""
return None

@property
def data_quality_info(self) -> Sequence[DataQuality]:
"""Overall assessment of quality of a resource(s)."""
return None

@property
def resource_lineage(self) -> Sequence[Lineage]:
"""Information about the provenance, sources and/or the production processes applied to the resource."""
return None

@property
def portrayal_catalogue_info(self) -> Sequence[PortrayalCatalogueReference]:
"""Information about the catalogue of rules defined for the portrayal of a resource(s)."""
return None

@property
def metadata_constraints(self) -> Sequence[Constraints]:
"""Restrictions on the access and use of metadata."""
return None

@property
def application_schema_info(self) -> Sequence[ApplicationSchemaInformation]:
"""Information about the conceptual schema of a dataset."""
return None

@property
def metadata_maintenance(self) -> MaintenanceInformation:
"""Information about the frequency of metadata updates, and the scope of those updates."""
return None

@property
def acquisition_information(self) -> Sequence[AcquisitionInformation]:
"""Information about the acquisition of the data."""
return None
2 changes: 2 additions & 0 deletions geoapi/src/main/python/opengis/metadata/lineage.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ def source_spatial_resolution(self) -> Resolution:
@property
def source_reference_system(self):
"""Spatial reference system used by the source resource."""
# See https://github.com/opengeospatial/geoapi/issues/57
return None

@property
Expand All @@ -65,6 +66,7 @@ def scope(self) -> Scope:

@property
def source_step(self) -> Sequence['ProcessStep']:
"""Information about process steps in which this source was used."""
return None

@property
Expand Down
5 changes: 5 additions & 0 deletions geoapi/src/main/python/opengis/metadata/representation.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,21 +164,26 @@ class GCPCollection(GeolocationInformation):
@property
@abstractmethod
def gcp(self) -> Sequence[GCP]:
"""Ground control point(s) used in the collection."""
pass

@property
@abstractmethod
def collection_identification(self) -> int:
"""Identifier of the GCP collection."""
pass

@property
@abstractmethod
def collection_name(self) -> str:
"""Name of the GCP collection."""
pass

@property
@abstractmethod
def coordinate_reference_system(self):
"""Coordinate system in which the ground control points are defined."""
# See https://github.com/opengeospatial/geoapi/issues/57
pass


Expand Down
13 changes: 11 additions & 2 deletions geoapi/src/test/java/org/opengis/tools/export/PythonTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,8 @@ private boolean isMatch(final String expected, final String actual) {
/*
* Skip comparison of "Copyright (C) year" line because the year varies.
*/
if (actual.startsWith(COPYRIGHT) && expected.startsWith(COPYRIGHT)) {
return true;
if (expected.startsWith(COPYRIGHT)) {
return actual.startsWith(COPYRIGHT);
}
/*
* If the actual line contains a type but the expected line did not, then
Expand All @@ -194,6 +194,15 @@ private boolean isMatch(final String expected, final String actual) {
}
}
}
/*
* Relax comparison for the """Date(s) other than creation dateEG: expiry date.""" sentence,
* which we rewrote as """Date(s) other than creation date. Example: expiry date.""".
*/
int s = expected.indexOf("EG:");
if (s >= 30) {
final String reduced = expected.substring(0, s);
return actual.startsWith(reduced);
}
return false;
}
}

0 comments on commit 7b3b70e

Please sign in to comment.