From f1e949713a28eae5080e24428c4d1944c15e2f4a Mon Sep 17 00:00:00 2001 From: YONG WOOK KIM Date: Mon, 6 Nov 2023 14:09:20 -0600 Subject: [PATCH 1/4] based updated to Open Street Map (#139) * based updated to Stadia.stamentoner * Updated basemap to open street map * updated to open street map * added testing printouts * added cetering map option * added center shifting * updated changelog --- CHANGELOG.md | 7 +++++++ pyincore_viz/geoutil.py | 8 ++++++-- pyincore_viz/tabledatasetlistmap.py | 5 +++-- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1d20d89..e7b5281 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). +## [Unreleased] +### Updated +- Basemap api updated to use open street map [#138](https://github.com/IN-CORE/pyincore-viz/issues/138) + +### Fixed +- Ipyleaflet map centering problem when map is called [#140](https://github.com/IN-CORE/pyincore-viz/issues/140) + ## [1.8.3] - 2023-08-16 ### Changed - Pytest changed to use micromamba [#128](https://github.com/IN-CORE/pyincore-viz/issues/128) diff --git a/pyincore_viz/geoutil.py b/pyincore_viz/geoutil.py index 90668c5..688375e 100644 --- a/pyincore_viz/geoutil.py +++ b/pyincore_viz/geoutil.py @@ -947,7 +947,7 @@ def get_ipyleaflet_map_with_center_location(cen_lon, cen_lat, zoom_level): obj: An ipyleaflet map. """ - map = ipylft.Map(center=(cen_lon, cen_lat), zoom=zoom_level, basemap=ipylft.basemaps.Stamen.Toner, + map = ipylft.Map(center=(cen_lon, cen_lat), zoom=zoom_level, basemap=ipylft.basemaps.OpenStreetMap.Mapnik, crs=projections.EPSG3857, scroll_wheel_zoom=True) return map @@ -963,13 +963,17 @@ def get_ipyleaflet_map(bbox=None): obj: An ipyleaflet map. """ - map = ipylft.Map(basemap=ipylft.basemaps.Stamen.Toner, zoom=10, + map = ipylft.Map(basemap=ipylft.basemaps.OpenStreetMap.Mapnik, zoom=10, crs=projections.EPSG3857, scroll_wheel_zoom=True) if bbox is not None: # the boundary information should be converted to ipyleaflet code boundary bounds = GeoUtil.convert_bound_to_ipylft_format(bbox) map.fit_bounds(bounds) + # get center for different jupyter versions + center = GeoUtil.calc_center_from_bbox(bbox) + # need to reverse x and y + map.center = [center[1], center[0]] map.add_control(ipylft.LayersControl(position='topright')) map.add_control(ipylft.FullScreenControl(position='topright')) diff --git a/pyincore_viz/tabledatasetlistmap.py b/pyincore_viz/tabledatasetlistmap.py index 31c6707..a8a03ff 100644 --- a/pyincore_viz/tabledatasetlistmap.py +++ b/pyincore_viz/tabledatasetlistmap.py @@ -18,7 +18,8 @@ class TableDatasetListMap: """Mapping class for visualizing list of Table Dataset""" def __init__(self): - self.map = ipylft.Map(center=(0, 0), zoom=12, basemap=ipylft.basemaps.Stamen.Toner, scroll_wheel_zoom=True) + self.map = ipylft.Map(center=(0, 0), zoom=12, basemap=ipylft.basemaps.OpenStreetMap.Mapnik, + scroll_wheel_zoom=True) def create_basemap_ipylft(self, geo_dataframe, title_list): """Creates map window with given inventory with multiple table dataset file using folder location. @@ -36,7 +37,7 @@ def create_basemap_ipylft(self, geo_dataframe, title_list): # create base ipyleaflet map self.map = ipylft.Map(center=(cen_x, cen_y), zoom=12, - basemap=ipylft.basemaps.Stamen.Toner, scroll_wheel_zoom=True) + basemap=ipylft.basemaps.OpenStreetMap.Mapnik, scroll_wheel_zoom=True) # add map widgets self.map = self.create_map_widgets(title_list, self.map, geo_dataframe) From 9d4dcd2c88cac1916be5f3f7f1a02cc9779eb66e Mon Sep 17 00:00:00 2001 From: YONG WOOK KIM Date: Mon, 6 Nov 2023 14:18:08 -0600 Subject: [PATCH 2/4] release 1.8.4 --- CHANGELOG.md | 2 +- docs/source/conf.py | 2 +- pyincore_viz/globals.py | 2 +- recipes/meta.yaml | 2 +- setup.py | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e7b5281..8b5f00a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,7 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). -## [Unreleased] +## [1.8.4] - 2023-11-08 ### Updated - Basemap api updated to use open street map [#138](https://github.com/IN-CORE/pyincore-viz/issues/138) diff --git a/docs/source/conf.py b/docs/source/conf.py index 5472a75..43ad713 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -33,7 +33,7 @@ # The short X.Y version version = '1.8' # The full version, including alpha/beta/rc tags -release = '1.8.3' +release = '1.8.4' # -- General configuration --------------------------------------------------- diff --git a/pyincore_viz/globals.py b/pyincore_viz/globals.py index 821493b..aa8270c 100644 --- a/pyincore_viz/globals.py +++ b/pyincore_viz/globals.py @@ -8,7 +8,7 @@ import logging from logging import config as logging_config -PACKAGE_VERSION = "1.8.3" +PACKAGE_VERSION = "1.8.4" INCORE_GEOSERVER_WMS_URL = "https://incore.ncsa.illinois.edu/geoserver/incore/wms" INCORE_GEOSERVER_DEV_WMS_URL = "https://incore-dev.ncsa.illinois.edu/geoserver/incore/wms" diff --git a/recipes/meta.yaml b/recipes/meta.yaml index 825c3b8..fffacb0 100644 --- a/recipes/meta.yaml +++ b/recipes/meta.yaml @@ -1,5 +1,5 @@ {% set name = "pyincore-viz" %} -{% set version = "1.8.3" %} +{% set version = "1.8.4" %} package: name: {{ name|lower }} diff --git a/setup.py b/setup.py index a87c6a0..df9988b 100644 --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ from setuptools import setup, find_packages # version number of pyincore -version = '1.8.3' +version = '1.8.4' with open("README.rst", encoding="utf-8") as f: readme = f.read() From b43eff1c8decc04b80b0351b016c58eb87fab260 Mon Sep 17 00:00:00 2001 From: YONG WOOK KIM Date: Mon, 6 Nov 2023 14:34:45 -0600 Subject: [PATCH 3/4] changed release date --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8b5f00a..210c4ba 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,7 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). -## [1.8.4] - 2023-11-08 +## [1.8.4] - 2023-11-09 ### Updated - Basemap api updated to use open street map [#138](https://github.com/IN-CORE/pyincore-viz/issues/138) From 320b34a7575c0f7f2dd60549a371e213974559ec Mon Sep 17 00:00:00 2001 From: YONG WOOK KIM Date: Mon, 6 Nov 2023 14:54:12 -0600 Subject: [PATCH 4/4] changed release date --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 210c4ba..8b5f00a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,7 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). -## [1.8.4] - 2023-11-09 +## [1.8.4] - 2023-11-08 ### Updated - Basemap api updated to use open street map [#138](https://github.com/IN-CORE/pyincore-viz/issues/138)