pygplates.ResolvedTopologicalBoundary

class pygplates.ResolvedTopologicalBoundary

Bases: ReconstructionGeometry

The geometry of a topological boundary feature resolved to a geological time.

TopologicalModel, TopologicalSnapshot or resolve_topologies() can be used to generate ResolvedTopologicalBoundary instances.

__init__()

Raises an exception This class cannot be instantiated from Python

Methods

__init__

Raises an exception This class cannot be instantiated from Python

get_boundary_sub_segments()

Returns the sub-segments that make up the boundary of this resolved topological boundary.

get_feature()

Returns the feature associated with this ResolvedTopologicalBoundary.

get_geometry_sub_segments()

Same as get_boundary_sub_segments().

get_point_location(point)

Determines whether the specified point lies within this resolved topological boundary.

get_point_strain_rate(point)

Returns zero strain rate (if the specified point lies within this resolved topological boundary).

get_point_velocity(point, ...)

Returns the velocity of the specified point (if it lies within this resolved topological boundary).

get_property()

Returns the feature property containing the topological boundary property associated with this ResolvedTopologicalBoundary.

get_reconstruction_time()

Returns the reconstruction time that this instance was created at.

get_resolved_boundary()

Returns the resolved boundary geometry.

get_resolved_feature()

Returns a feature containing the resolved boundary geometry.

get_resolved_geometry()

Same as get_resolved_boundary().

get_resolved_geometry_point_velocities(...)

Returns the velocities of the resolved geometry points.

get_resolved_geometry_points()

Returns the points of the resolved geometry.

reconstruct_point(point, reconstruction_time)

Incrementally reconstruct the specified point (if it lies within this resolved topological boundary) to the specified reconstruction time.

get_boundary_sub_segments()

Returns the sub-segments that make up the boundary of this resolved topological boundary.

Return type:

list of ResolvedTopologicalSubSegment

To get a list of the unreversed boundary sub-segment geometries:

sub_segment_geometries = []
for sub_segment in resolved_topological_boundary.get_boundary_sub_segments():
    sub_segment_geometries.append(sub_segment.get_resolved_geometry())

To get a list of sub-segment geometries with points in the same order as this topological boundary:

sub_segment_geometries = []
for sub_segment in resolved_topological_boundary.get_boundary_sub_segments():
    sub_segment_geometry = sub_segment.get_resolved_geometry()
    if sub_segment.was_geometry_reversed_in_topology():
        # Create a new sub-segment polyline with points in reverse order.
        sub_segment_geometry = pygplates.PolylineOnSphere(sub_segment_geometry[::-1])
    sub_segment_geometries.append(sub_segment_geometry)

The following is essentially equivalent to get_resolved_boundary() (except rubber banding points, if any, between adjacent sub-segments are included below but not in get_resolved_boundary()):

def get_resolved_boundary(resolved_topological_boundary):

    resolved_boundary_points = []
    for sub_segment in resolved_topological_boundary.get_boundary_sub_segments():
        sub_segment_points = sub_segment.get_resolved_geometry().get_points()
        if sub_segment.was_geometry_reversed_in_topology():
            # Reverse the sub-segment points.
            sub_segment_points = sub_segment_points[::-1]
        resolved_boundary_points.extend(sub_segment_points)

    return pygplates.PolygonOnSphere(resolved_boundary_points)
get_feature()

Returns the feature associated with this ResolvedTopologicalBoundary.

Return type:

Feature

Note

The returned feature is what was used to generate this ResolvedTopologicalBoundary via TopologicalModel, TopologicalSnapshot or resolve_topologies().

get_geometry_sub_segments()

Same as get_boundary_sub_segments().

get_point_location(point)

Determines whether the specified point lies within this resolved topological boundary.

Parameters:

point (PointOnSphere or LatLonPoint or tuple (latitude,longitude), in degrees, or tuple (x,y,z)) – the point to be tested

Return type:

TopologyPointLocation

If the point lies within this resolved topological boundary then TopologyPointLocation.located_in_resolved_boundary() will return this resolved topological boundary, otherwise it will return None (in addition to TopologyPointLocation.not_located_in_resolved_topology() returning True).

To test if a (latitude, longitude) point is inside a resolved topological boundary:

if resolved_topological_boundary.get_point_location((latitude, longitude)).located_in_resolved_boundary():
  ...

Note

TopologyPointLocation.located_in_resolved_network() will always return None since this is a rigid plate (not a network). TopologyPointLocation is just returned for consistency with ResolvedTopologicalNetwork.get_point_location().

This method is essentially equivalent to:

def get_point_location(resolved_topological_boundary, point):
    # See if point is located within the resolved topological boundary polygon.
    if resolved_topological_boundary.get_resolved_boundary().is_point_in_polygon(point):
        return resolved_topological_boundary

    # Point is *not* located in the resolved topological boundary.
    return None

Added in version 0.49.

get_point_strain_rate(point)

Returns zero strain rate (if the specified point lies within this resolved topological boundary).

Parameters:

point (PointOnSphere or LatLonPoint or tuple (latitude,longitude), in degrees, or tuple (x,y,z)) – the point to calculate strain rate at

Return type:

StrainRate or None

If the point lies within this resolved topological boundary then pygplates.StrainRate.zero will be returned (since this is a rigid plate), otherwise None will be returned (to indicate the point is outside this resolved topological boundary).

Note

This method is only provided for consistency with ResolvedTopologicalNetwork.get_point_strain_rate().

This method is essentially equivalent to:

def get_point_strain_rate(resolved_topological_boundary, point):
    # See if point is located within the resolved topological boundary.
    if resolved_topological_boundary.get_resolved_boundary().is_point_in_polygon(point):
        return pygplates.StrainRate.zero

    # Point is *not* located in the resolved topological boundary.
    return None

Added in version 0.49.

get_point_velocity(point[, velocity_delta_time=1.0][, velocity_delta_time_type=pygplates.VelocityDeltaTimeType.t_plus_delta_t_to_t][, velocity_units=pygplates.VelocityUnits.kms_per_my][, earth_radius_in_kms=pygplates.Earth.mean_radius_in_kms])

Returns the velocity of the specified point (if it lies within this resolved topological boundary).

Parameters:
  • point (PointOnSphere or LatLonPoint or tuple (latitude,longitude), in degrees, or tuple (x,y,z)) – the point to calculate velocity at

  • velocity_delta_time (float) – The time delta used to calculate velocity (defaults to 1 Myr).

  • velocity_delta_time_type (VelocityDeltaTimeType.t_plus_delta_t_to_t, VelocityDeltaTimeType.t_to_t_minus_delta_t or VelocityDeltaTimeType.t_plus_minus_half_delta_t) – How the two velocity times are calculated relative to the reconstruction time. This includes [t+dt, t], [t, t-dt] and [t+dt/2, t-dt/2]. Defaults to [t+dt, t].

  • velocity_units (VelocityUnits.kms_per_my or VelocityUnits.cms_per_yr) – whether to return velocity as kilometres per million years or centimetres per year (defaults to kilometres per million years)

  • earth_radius_in_kms (float) – the radius of the Earth in kilometres (defaults to pygplates.Earth.mean_radius_in_kms)

Return type:

Vector3D or None

If the point lies within this resolved topological boundary then a velocity vector will be returned, otherwise None will be returned.

Note

If this resolved topological boundary does not have a reconstruction plate ID then 0 will be used.

To calculate the velocity of a (latitude, longitude) point (if it is inside a resolved topological boundary):

point_velocity = resolved_topological_boundary.get_point_velocity((latitude, longitude))
if point_velocity is not None:
  ...

This method is essentially equivalent to:

def get_point_velocity(resolved_topological_boundary, point):
    # See if point is located within the resolved topological boundary polygon.
    if resolved_topological_boundary.get_resolved_boundary().is_point_in_polygon(point):
        # Get the reconstruction plate ID of this resolved topological boundary.
        # If it doesn't have one then zero will be used instead.
        plate_id = resolved_topological_boundary.get_feature().get_reconstruction_plate_id()
        velocity = ...  # calculate velocity using 'point' and 'plate_id'
        return velocity

    # Point is *not* located in the resolved topological boundary.
    return None

Added in version 0.49.

get_property()

Returns the feature property containing the topological boundary property associated with this ResolvedTopologicalBoundary.

Return type:

Property

This is the Property that the get_resolved_boundary() and get_resolved_geometry() are obtained from.

get_resolved_boundary()

Returns the resolved boundary geometry.

Return type:

PolygonOnSphere

get_resolved_feature()

Returns a feature containing the resolved boundary geometry.

Return type:

Feature

The returned feature contains the static resolved geometry. Unlike get_feature() it cannot be used to generate a ResolvedTopologicalBoundary via TopologicalModel, TopologicalSnapshot or resolve_topologies().

Note

The returned feature does not contain present-day geometry as is typical of most GPlates features.
In this way the returned feature is similar to a GPlates reconstruction export.

Note

The returned feature should not be reverse reconstructed to present day because topologies are resolved (not reconstructed).

See also

get_feature()

get_resolved_geometry()

Same as get_resolved_boundary().

get_resolved_geometry_point_velocities([velocity_delta_time=1.0][, velocity_delta_time_type=pygplates.VelocityDeltaTimeType.t_plus_delta_t_to_t][, velocity_units=pygplates.VelocityUnits.kms_per_my][, earth_radius_in_kms=pygplates.Earth.mean_radius_in_kms])

Returns the velocities of the resolved geometry points.

Parameters:
  • velocity_delta_time (float) – The time delta used to calculate velocities (defaults to 1 Myr).

  • velocity_delta_time_type (VelocityDeltaTimeType.t_plus_delta_t_to_t, VelocityDeltaTimeType.t_to_t_minus_delta_t or VelocityDeltaTimeType.t_plus_minus_half_delta_t) – How the two velocity times are calculated relative to the reconstruction time. This includes [t+dt, t], [t, t-dt] and [t+dt/2, t-dt/2]. Defaults to [t+dt, t].

  • velocity_units (VelocityUnits.kms_per_my or VelocityUnits.cms_per_yr) – whether to return velocities as kilometres per million years or centimetres per year (defaults to kilometres per million years)

  • earth_radius_in_kms (float) – the radius of the Earth in kilometres (defaults to pygplates.Earth.mean_radius_in_kms)

Return type:

list of Vector3D

To associate each velocity with its point (in a resolved topological boundary):

points = resolved_topological_boundary.get_resolved_geometry_points()
velocities = resolved_topological_boundary.get_resolved_geometry_point_velocities()

points_and_velocities = zip(points, point_velocities)

for point, velocity in points_and_velocities:
  ...

Added in version 0.50.

get_resolved_geometry_points()

Returns the points of the resolved geometry.

Return type:

list of PointOnSphere

This method is essentially equivalent to:

def get_resolved_geometry_points(resolved_topological_boundary):
    return resolved_topological_boundary.get_resolved_geometry().get_points()

Added in version 0.50.

reconstruct_point(point, reconstruction_time)

Incrementally reconstruct the specified point (if it lies within this resolved topological boundary) to the specified reconstruction time.

Parameters:
Return type:

PointOnSphere or None

Raises:

ValueError if reconstruction_time is distant-past (float('inf')) or distant-future (float('-inf')).

If the point lies within this resolved topological boundary then it is reconstructed from the reconstruction time of this resolved topological boundary to the specified reconstruction time, and the reconstructed point is returned (otherwise None will be returned).

The specified reconstruction time can be older or younger than the reconstruction time of this resolved topological boundary. If it’s older then the point is reconstructed backward in time, and if it’s younger then the point is reconstructed forward in time.

Note

The reconstruction involves calculating a stage rotation (using the reconstruction plate ID of this resolved topological boundary) from the reconstruction time of this resolved topological boundary to reconstruction_time. So ideally a small time increment (such as 1 Myr) should be used since the plate boundaries and rotations typically change over small time intervals.

To reconstruct a point located at (latitude, longitude) to a new position at a time 1 Myr older than the current time (if point is inside a resolved topological boundary):

reconstructed_point = resolved_topological_boundary.reconstruct_point(
        (latitude, longitude),
        resolved_topological_boundary.get_reconstruction_time() + 1.0)
if reconstructed_point is not None:
  ...

This method is essentially equivalent to:

def reconstruct_point(resolved_topological_boundary, point, reconstruction_time):
    # See if point is located within the resolved topological boundary polygon.
    if resolved_topological_boundary.get_resolved_boundary().is_point_in_polygon(point):
        # Get the reconstruction plate ID of this resolved topological boundary.
        # If it doesn't have one then zero will be used instead.
        plate_id = resolved_topological_boundary.get_feature().get_reconstruction_plate_id()
        # Rigidly rotate 'point' using 'plate_id' and stage rotation
        # from resolved time to 'reconstruction_time'.
        reconstructed_point = ...
        return reconstructed_point

    # Point is *not* located in the resolved topological boundary.
    return None

Added in version 0.50.