Skip to content

Commit

Permalink
add misc_transforms
Browse files Browse the repository at this point in the history
  • Loading branch information
Hojat-Shirmard committed Nov 29, 2024
1 parent d16b5de commit 8836e32
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions gplately/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -1849,6 +1849,8 @@ def plot_all_topologies(self, ax, color="black", **kwargs):
"""Plot topological polygons and networks on a standard map projection."""
if "edgecolor" not in kwargs.keys():
kwargs["edgecolor"] = color
if "facecolor" not in kwargs.keys():
kwargs["facecolor"] = "none"

return self._plot_feature(
ax,
Expand Down Expand Up @@ -1993,4 +1995,36 @@ def plot_ridge_transforms(self, ax, color="black", **kwargs):
feature_name="ridge_transforms",
edgecolor=color,
**kwargs,
)

@property
def misc_transforms(self):
"""Combine miscellaneous transforms into one feature set."""
if self.time is None:
raise ValueError(
"No topologies have been resolved. Set `PlotTopologies.time` to construct them."
)
logger.debug("Returning misc_transforms property.")
return self.transforms + self.unclassified_features

def get_misc_transforms(self, central_meridian=0.0, tessellate_degrees=None):
"""Create a GeoDataFrame containing geometries of reconstructed miscellaneous transforms."""
logger.debug("Getting reconstructed miscellaneous transforms.")
return self.get_feature(
self.misc_transforms,
central_meridian=central_meridian,
tessellate_degrees=tessellate_degrees
)

@validate_topology_availability("miscellaneous transforms")
@append_docstring(PLOT_DOCSTRING.format("miscellaneous transforms"))
def plot_misc_transforms(self, ax, color="black", **kwargs):
"""Plot reconstructed miscellaneous transforms onto a map."""
logger.debug("Plotting reconstructed miscellaneous transforms.")
return self.plot_feature(
ax,
self.misc_transforms,
feature_name="misc_transforms",
edgecolor=color,
**kwargs,
)

0 comments on commit 8836e32

Please sign in to comment.