Skip to content

Commit

Permalink
ski area longitude
Browse files Browse the repository at this point in the history
  • Loading branch information
dhimmel committed Oct 15, 2024
1 parent 7f14833 commit 9e26b44
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ DOI: [10.1038/s41558-023-01759-5](https://doi.org/10.1038/s41558-023-01759-5)
- [openskimap.org/issues/82](https://github.com/russellporter/openskimap.org/issues/82): Add slope aspect information
- [openskimap.org/issues/135](https://github.com/russellporter/openskimap.org/issues/135): ski_areas.geojson location information is missing
- [openskimap.org/issues/137](https://github.com/russellporter/openskimap.org/issues/137): Restrict coordinate precision to prevent floating-point rounding errors
- [openskimap.org/issues/139](https://github.com/russellporter/openskimap.org/issues/139): Black Mountain of New Hampshire USA is missing location region metadata
- [komoot/photon/issues/838](https://github.com/komoot/photon/issues/838) and [openskimap.org/issues/139](https://github.com/russellporter/openskimap.org/issues/139): Black Mountain of New Hampshire USA is missing location region metadata
- [osmnx/issues/1137](https://github.com/gboeing/osmnx/issues/1137) and [osmnx/pull/1139](https://github.com/gboeing/osmnx/pull/1139): Support directed bearing/orientation distributions and plots
- [osmnx/issues/1143](https://github.com/gboeing/osmnx/issues/1143) and [osmnx/pull/1147](https://github.com/gboeing/osmnx/pull/1147): _bearings_distribution: defer weighting to np.histogram
- [osmnx/pull/1149](https://github.com/gboeing/osmnx/pull/1149): _bearings_distribution: bin_centers terminology
5 changes: 5 additions & 0 deletions ski_bearings/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,11 @@ class SkiAreaModel(Model): # type: ignore [misc]
ge=-90,
le=90,
)
longitude: float | None = Field(
description="Longitude of the ski area in decimal degrees.",
ge=-180,
le=180,
)
hemisphere: Literal["north", "south"] | None = Field(
description="Hemisphere of the ski area.",
)
Expand Down
3 changes: 3 additions & 0 deletions ski_bearings/osmnx_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ def create_networkx_with_metadata(
graph.graph["latitude"] = statistics.mean(
lat for _, lat in graph.nodes(data="y")
)
graph.graph["longitude"] = statistics.mean(
lon for _, lon in graph.nodes(data="x")
)
graph.graph["hemisphere"] = "north" if graph.graph["latitude"] > 0 else "south"
if graph.number_of_edges() > 0:
with suppress_user_warning():
Expand Down

0 comments on commit 9e26b44

Please sign in to comment.