From 72d834b01db23484e94fbddf95054ce809498c6c Mon Sep 17 00:00:00 2001 From: Shreya Kakachery Date: Sat, 31 Jan 2026 09:38:07 -0800 Subject: [PATCH 1/7] Update installation to test pypi link --- README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 6d0be3e..ac7d237 100644 --- a/README.md +++ b/README.md @@ -36,10 +36,11 @@ Among the four main functions in Geospatial Toolkit, some overlap with existing ## Get started -You can install this package into your preferred Python environment using pip: +### Installation +You can install the latest version of the package from [TestPyPI](https://test.pypi.org/): ```bash -pip install geospatial_toolkit +pip install -i https://test.pypi.org/simple/ geospatial-toolkit ``` To use geospatial-toolkit in your code, start a Python session: From 058469e7ce4f2ef2b6f669b1bebf2a8c10d0a510 Mon Sep 17 00:00:00 2001 From: Shreya Kakachery Date: Sat, 31 Jan 2026 09:43:19 -0800 Subject: [PATCH 2/7] Add full user installation guide --- README.md | 31 +++++++++++++++++++++++-------- 1 file changed, 23 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index ac7d237..e5873e5 100644 --- a/README.md +++ b/README.md @@ -53,21 +53,36 @@ Then run: ```python import geospatial_toolkit as gst import pandas as pd +from shapely.geometry import Polygon -# Standardize latitude and longitude -# 'd' stands for degree -gst.standardize_latlong("34d3'8\"N", "118d14'37\"W") +# 1. Standardize latitude and longitude +gst.standardize_latlong("34° 3' 8\" N", "118° 14' 37\" W") -# Calculate Haversine distance between two points +# 2. Calculate Great-Circle distance point_a = (49.2827, -123.1207) # Vancouver point_b = (45.5017, -73.5673) # Montreal gst.haversine_distance(point_a, point_b) -# Get antipode of a location -gst.get_antipode("Vancouver, BC") +# 3. Get the antipode of a location +gst.get_antipode((49.2827, -123.1207)) -# Find which city contains a given point -gst.point_to_city(49.2827, -123.1207, cities_df=pd.DataFrame(...)) +# 4. Find which city contains a given point (using a reference DataFrame) +data = { + 'city_name': ['Vancouver', 'Port-aux-Français'], + 'geometry': [ + Polygon([(-124, 48), (-122, 48), (-122, 50), (-124, 50)]), + Polygon([(69, -50), (71, -50), (71, -48), (69, -48)]) + ] +} +cities_df = pd.DataFrame(data) + +gst.point_to_city(49.2827, -123.1207, cities_df) +``` + +To exit the Python session: + +``` +exit() ``` ## Development Environment From 13ca9426222ba83c133e42b11e2cefc72b7d7a15 Mon Sep 17 00:00:00 2001 From: Shreya Kakachery Date: Sat, 31 Jan 2026 09:51:15 -0800 Subject: [PATCH 3/7] Update README formatting and spacing --- README.md | 37 +++++++++++++++++++++++++++---------- 1 file changed, 27 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index e5873e5..dd2d450 100644 --- a/README.md +++ b/README.md @@ -37,6 +37,7 @@ Among the four main functions in Geospatial Toolkit, some overlap with existing ## Get started ### Installation + You can install the latest version of the package from [TestPyPI](https://test.pypi.org/): ```bash @@ -45,9 +46,10 @@ pip install -i https://test.pypi.org/simple/ geospatial-toolkit To use geospatial-toolkit in your code, start a Python session: -``` +```bash python ``` + Then run: ```python @@ -81,54 +83,62 @@ gst.point_to_city(49.2827, -123.1207, cities_df) To exit the Python session: -``` +```python exit() ``` ## Development Environment +### Prerequisites + +- Python 3.11 or higher +- [Conda](https://docs.conda.io/en/latest/miniconda.html) or Mamba package manager + To set up the development environment, navigate to your local folder of choice and follow the instructions below 1. Clone the repository: Using HTTPS: + ```bash git clone https://github.com/UBC-MDS/geospatial-toolkit.git ``` Or, using SSH: + ```bash git clone git@github.com:UBC-MDS/geospatial-toolkit.git ``` Navigate to the project root: + ```bash cd geospatial-toolkit ``` -2. Create project Conda environment: -```bash -conda env create -f environment.yml -``` +Create and activate the project Conda environment: -3. Activate the Conda environment: ```bash +conda env create -f environment.yml conda activate geospatial ``` -4. Install the package in editable mode +Install the package in editable mode + ```bash pip install -e . ``` -5. (Recommended) Install development dependencies +(Recommended) Install development dependencies This project uses optional dependency groups for development, testing, documentation, and packaging. Install all development-related dependencies with: + ```bash pip install -e ".[all]" ``` + Alternatively, you can install specific groups: ```bash @@ -141,12 +151,14 @@ pip install -e ".[docs]" To run the full test suite, ensure the development environment is activated and the package is installed in editable mode with testing dependencies. -In terminal, from the project root directory, run: +In terminal, from the project root directory, run: + ```bash pytest ``` To run tests with coverage, run: + ```bash pytest --cov=geospatial_toolkit ``` @@ -158,16 +170,21 @@ Ensure the development environment is activated and the package is installed in ```bash pip install -e ".[docs]" ``` + Generate the API reference: + ```bash quartodoc build ``` + Preview the site locally: + ```bash quarto preview ``` ## Contributors + - Athul Sasidharan - Prabuddha Tamhane - Shrabanti Bala Joya From 5377d74aa6e16b1f8b7813266a483813c2d83ea9 Mon Sep 17 00:00:00 2001 From: Shreya Kakachery Date: Sat, 31 Jan 2026 09:52:44 -0800 Subject: [PATCH 4/7] Update documentation instructions --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index dd2d450..3fafb80 100644 --- a/README.md +++ b/README.md @@ -165,6 +165,10 @@ pytest --cov=geospatial_toolkit ## Building Documentation +This project uses quartodoc and Quarto to generate its documentation. + +Note on Dependencies: Building the documentation requires `nbformat` to execute Python code blocks. This is included in the `environment.yml` file. + Ensure the development environment is activated and the package is installed in editable mode with documentation dependencies: ```bash From 4407380d695159fbc5e298f56f9f43ffa7b5335f Mon Sep 17 00:00:00 2001 From: Shreya Kakachery Date: Sat, 31 Jan 2026 10:40:45 -0800 Subject: [PATCH 5/7] Add note about 'd' to demo function --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 3fafb80..ca73357 100644 --- a/README.md +++ b/README.md @@ -58,7 +58,8 @@ import pandas as pd from shapely.geometry import Polygon # 1. Standardize latitude and longitude -gst.standardize_latlong("34° 3' 8\" N", "118° 14' 37\" W") +# 'd' stands for degree +gst.standardize_latlong('34d3'8"N', '118d14'37"W') # 2. Calculate Great-Circle distance point_a = (49.2827, -123.1207) # Vancouver From be05daa44cfda1428ea46b8e95de318c5132bd93 Mon Sep 17 00:00:00 2001 From: Shreya Kakachery Date: Sat, 31 Jan 2026 10:42:00 -0800 Subject: [PATCH 6/7] Update installation link --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ca73357..a61a949 100644 --- a/README.md +++ b/README.md @@ -41,7 +41,7 @@ Among the four main functions in Geospatial Toolkit, some overlap with existing You can install the latest version of the package from [TestPyPI](https://test.pypi.org/): ```bash -pip install -i https://test.pypi.org/simple/ geospatial-toolkit +pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ geospatial-toolkit ``` To use geospatial-toolkit in your code, start a Python session: From 4648f05c76ad09f8c9ac52523730a0bd779d8af9 Mon Sep 17 00:00:00 2001 From: sjbalagit Date: Sat, 31 Jan 2026 10:48:02 -0800 Subject: [PATCH 7/7] Fix escape characters in standardize_latlong example --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a61a949..f09736a 100644 --- a/README.md +++ b/README.md @@ -59,7 +59,7 @@ from shapely.geometry import Polygon # 1. Standardize latitude and longitude # 'd' stands for degree -gst.standardize_latlong('34d3'8"N', '118d14'37"W') +gst.standardize_latlong('34d3\'8"N', '118d14\'37"W') # 2. Calculate Great-Circle distance point_a = (49.2827, -123.1207) # Vancouver