pygplates.TopologyPointLocation

class pygplates.TopologyPointLocation

Bases: instance

Locates a point in a specific resolved topological boundary or network (deforming region or interior rigid block).

TopologyPointLocations are equality (==, !=) comparable (but not hashable - cannot be used as a key in a dict).

Added in version 0.29.

Changed in version 0.47: Equality compares object state instead of object identity.

__init__()

Raises an exception This class cannot be instantiated from Python

Methods

__init__

Raises an exception This class cannot be instantiated from Python

located_in_resolved_boundary()

Query if point is located in a resolved topological boundary.

located_in_resolved_network()

Query if point is located in a resolved topological network.

located_in_resolved_network_deforming_region(...)

Query if point is located in the deforming region of a resolved topological network.

located_in_resolved_network_rigid_block()

Query if point is located in an interior rigid block of a resolved topological network.

not_located_in_resolved_topology()

Query if point is not located in any resolved topological boundaries or networks.

located_in_resolved_boundary()

Query if point is located in a resolved topological boundary.

Returns:

the resolved topological boundary that contains the point, otherwise None

Return type:

ResolvedTopologicalBoundary or None

located_in_resolved_network()

Query if point is located in a resolved topological network.

Returns:

the resolved topological network that contains the point, otherwise None

Return type:

ResolvedTopologicalNetwork or None

Note

The point can be anywhere inside a resolved topological network - inside its deforming region or inside any one of its interior rigid blocks (if it has any).

located_in_resolved_network_deforming_region([return_network_triangle=False])

Query if point is located in the deforming region of a resolved topological network.

Parameters:

return_network_triangle (bool) – Whether to also return the triangle (in the network triangulation) containing the point. Defaults to False.

Returns:

the resolved topological network whose deforming region contains the point (and the triangle in the network triangulation containing the point if return_network_triangle is True), otherwise None

Return type:

ResolvedTopologicalNetwork, or 2-tuple (ResolvedTopologicalNetwork, NetworkTriangulation.Triangle) if return_network_triangle is True, or None

Note

Returns None if point is inside a resolved topological network but is also inside one of its interior rigid blocks (and hence not inside its deforming region).

To locate the triangle (in the network triangulation) that contains the point:

resolved_topological_network_and_triangle = topology_point_location.located_in_resolved_network_deforming_region(
        return_network_triangle=True)
if resolved_topological_network_and_triangle:
    resolved_topological_network, network_triangle_containing_point = resolved_topological_network_and_triangle

Note

When a point location is queried, for example with ResolvedTopologicalNetwork.get_point_location(), the point is first projected from 3D space into 2D projection space using the Lambert azimuthal equal-area projection (with projection centre at the centroid of the network’s polygon boundary). Only then is the point tested against the triangles of the network’s 2D Delaunay triangulation (also in the same 2D projection) to locate the containing 2D triangle.
This means the original 3D point might not be contained by the 3D version of that triangle (ie, the 2D triangle with vertices unprojected back to 3D). For example, if you took the network triangle (containing the 2D point) and created a polygon from its 3D vertices and then did a point-in-polygon test using the original 3D point then it could potentially be outside the polygon (3D triangle). This is because the triangle boundary lines in 2D space do not map to the triangle boundary lines in 3D space (since the projection is not gnomonic, ie, doesn’t project 3D great circle arcs as straight 2D lines).
This also means the network triangle containing the point might be marked as outside the deforming region. However the point is still considered to be inside the deforming region since it is inside the network’s polygon boundary (and outside the network’s interior rigid blocks, if any). And it can still have a non-zero strain rate due to strain rate smoothing.

Changed in version 0.50: Added return_network_triangle argument.

located_in_resolved_network_rigid_block()

Query if point is located in an interior rigid block of a resolved topological network.

Returns:

tuple of resolved topological network and its interior rigid block (that contains the point), otherwise None

Return type:

2-tuple (ResolvedTopologicalNetwork, ReconstructedFeatureGeometry), or None

Note

Returns None if point is inside a resolved topological network but is not inside one of its interior rigid blocks.

not_located_in_resolved_topology()

Query if point is not located in any resolved topological boundaries or networks.

Returns:

True if point is not located in any resolved topologies

Return type:

bool