Conversation
Changes for autosize
S-57 base functionality implementation
…dle northern and southern projection
updated configuration for different utm zones, display should now han…
shallow waters are not underlapping whole map now
loading shapefiles simplified
Get records in layer
Utility updates
* Update README.md - features * Update README.md * Update README.md - usage * Update README.md - image * image added * image * image * Update README.md * Update README.md --------- Co-authored-by: miqn <109998643+meeqn@users.noreply.github.com>
* added some description for users running SC for the first time * upgraded test file and parametrized coastline display
* added some description for users running SC for the first time * upgraded test file and parametrized coastline display * seacharts 4 setup tips added
* added some description for users running SC for the first time * upgraded test file and parametrized coastline display * seacharts 4 setup tips added * Generated descriptions for most of the code and few refactors
* add weather utility function * Update config.yaml * Update config.yaml * Update config.yaml
* minor fixes regarding setup and documentation * simplified testing files
* Refactor configuration schema and core classes for improved clarity and functionality. Use CoordTuple for XY paired data in Extent class - it notably improves readability and thus maintainability. In the future these types of coordinates and bounding boxes could be replaced with similar, more readable containers. Changelog: - Updated comments in config_schema.yaml for better understanding of parameters. - Enhanced Config class to support optional config_path parameter. - Introduced CoordTuple class in extent.py for better handling of 2D coordinates. - Modified methods in extent.py to utilize CoordTuple for size, origin, and center. - Adjusted ENC class to return coordinates as tuples from extent. - Cleaned up imports and removed unused code in various files. - Improved type hints across multiple classes for better code readability. * Enhance directory structure creation and improve error handling for layer retrieval * Remove unused autosize option from config schema
There was a problem hiding this comment.
Pull Request Overview
This PR introduces SeaCharts version 4.0 with significant enhancements including S-57 maritime map format support, weather data visualization, and improved API functionality. The changes add support for parsing and displaying S-57 Electronic Navigational Charts alongside existing FGDB support, integrate weather data overlays with time-based controls, and provide new coordinate query methods.
Key Changes
- S-57 Format Support: New parser (
S57Parser) for IHO S-57 maritime chart format with layer extraction capabilities - Weather Visualization: Integration with PyThor weather service for displaying wind, waves, currents, and tides with interactive time slider controls
- Enhanced API: Added methods for querying depth at coordinates, checking layer membership, and retrieving layer parameters
Reviewed Changes
Copilot reviewed 38 out of 42 changed files in this pull request and generated 16 comments.
Show a summary per file
| File | Description |
|---|---|
| user_doc/seacharts_user_doc.md | Comprehensive user documentation for v4.0 features |
| tests/test_seacharts_4_0.py | Test file demonstrating new S-57 and coordinate query functionality |
| tests/config_sc4.yaml | Configuration for S-57 map testing |
| seacharts/core/parserS57.py | New S-57 format parser implementation |
| seacharts/environment/weather.py | Weather data fetching and parsing logic |
| seacharts/display/display.py | Added weather visualization and control panel features |
| seacharts/core/extent.py | Enhanced coordinate transformation with WGS84 and UTM support |
| seacharts/layers/layer.py | Added parameter extraction at coordinates |
| seacharts/enc.py | New coordinate query methods for depth and layer membership |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
tests/test_seacharts_4_0.py
Outdated
| import sys, os | ||
| from shapely.geometry import MultiPolygon, Polygon | ||
| # file made to showcase functionalities added in seacharts 4.0 integrated within old seacharts functionalities | ||
| # for |
There was a problem hiding this comment.
Incomplete comment on line 4 - appears to be a fragment that should be completed or removed.
seacharts/display/display.py
Outdated
| if (bbox[i] != environment.scope.extent.bbox[i]): | ||
| changed.append(i) | ||
| if len(changed)>0: | ||
| print(Fore.RED + f"WARNING: Bouding box for display has exceeded the limit of CRS axes and therefore been scaled down. Watch out for potentially cropped chart display!" + Fore.RESET) |
There was a problem hiding this comment.
Corrected spelling of 'Bouding' to 'Bounding'.
| print(Fore.RED + f"WARNING: Bouding box for display has exceeded the limit of CRS axes and therefore been scaled down. Watch out for potentially cropped chart display!" + Fore.RESET) | |
| print(Fore.RED + f"WARNING: Bounding box for display has exceeded the limit of CRS axes and therefore been scaled down. Watch out for potentially cropped chart display!" + Fore.RESET) |
seacharts/display/display.py
Outdated
| """ | ||
| Sets bounding box for the display taking projection's (crs's) x and y limits for display into account. | ||
| Making sure that bbox doesn't exceed limits prevents crashes. When such limit is exceeded, an appropriate message is displayed | ||
| to inform user about possibility of unexpeced display bound crop |
There was a problem hiding this comment.
Corrected spelling of 'unexpeced' to 'unexpected'.
| to inform user about possibility of unexpeced display bound crop | |
| to inform user about possibility of unexpected display bound crop |
seacharts/display/display.py
Outdated
|
|
||
| def start(self) -> None: | ||
| """ | ||
| self.started__ = """ |
There was a problem hiding this comment.
Line 88 contains a syntax error: the docstring is incorrectly assigned to a variable self.started__ instead of being a proper docstring. This should be formatted as a standard docstring immediately after the function definition.
| self.started__ = """ | |
| """ |
seacharts/display/display.py
Outdated
| if "wind_speed" and "wind_direction" in radio_labels: | ||
| radio_labels.append("wind") | ||
| if "wave_height" and "wave_direction" in radio_labels: | ||
| radio_labels.append("wave") | ||
| if "sea_current_speed" and "sea_current_direction" in radio_labels: |
There was a problem hiding this comment.
The boolean logic is incorrect. The expression if \"wind_speed\" and \"wind_direction\" in radio_labels will always evaluate the first string as truthy and only check if the second is in the list. It should be if \"wind_speed\" in radio_labels and \"wind_direction\" in radio_labels. The same issue exists on lines 748 and 750.
| if "wind_speed" and "wind_direction" in radio_labels: | |
| radio_labels.append("wind") | |
| if "wave_height" and "wave_direction" in radio_labels: | |
| radio_labels.append("wave") | |
| if "sea_current_speed" and "sea_current_direction" in radio_labels: | |
| if "wind_speed" in radio_labels and "wind_direction" in radio_labels: | |
| radio_labels.append("wind") | |
| if "wave_height" in radio_labels and "wave_direction" in radio_labels: | |
| radio_labels.append("wave") | |
| if "sea_current_speed" in radio_labels and "sea_current_direction" in radio_labels: |
seacharts/display/features.py
Outdated
| Adds an overlay geometry to the display. | ||
|
|
||
| :param geometry: The geometry to overlay. | ||
| :param color_name: The name of the color for the overlay. | ||
| :param fill: Whether the overlay should be filled. | ||
| :param linewidth: The width of the overlay line. | ||
| :param linestyle: The style of the overlay line. | ||
| :param alpha: The transparency level of the overlay. |
There was a problem hiding this comment.
The docstring parameters don't match the function signature. The function add_polygon has parameters shape, color, interiors, fill, linewidth, linestyle, and alpha, but the docstring references geometry and color_name instead.
| Adds an overlay geometry to the display. | |
| :param geometry: The geometry to overlay. | |
| :param color_name: The name of the color for the overlay. | |
| :param fill: Whether the overlay should be filled. | |
| :param linewidth: The width of the overlay line. | |
| :param linestyle: The style of the overlay line. | |
| :param alpha: The transparency level of the overlay. | |
| Adds a polygon overlay to the display. | |
| :param shape: The exterior coordinates of the polygon, or a collection of polygons. | |
| :param color: The color to use for the polygon. | |
| :param interiors: A list of interior coordinates (holes) for the polygon. | |
| :param fill: Whether the polygon should be filled. | |
| :param linewidth: The width of the polygon outline. | |
| :param linestyle: The style of the polygon outline. | |
| :param alpha: The transparency level of the polygon. |
seacharts/display/display.py
Outdated
| draw_default = data is None | ||
| for i in range(len(direction_data)): | ||
| for j in range(len(direction_data[i])): | ||
| x = direction_data[i][j] |
There was a problem hiding this comment.
Variable x is not used.
| x = direction_data[i][j] |
| super().__init__(bounding_box, path_strings) | ||
| self.epsg = epsg | ||
|
|
||
| def get_source_root_name(self) -> str: |
There was a problem hiding this comment.
Mixing implicit and explicit returns may indicate an error, as implicit returns always return None.
seacharts/enc.py
Outdated
| import _warnings | ||
| from pathlib import Path | ||
|
|
||
| from shapely.geometry import Point, Polygon |
There was a problem hiding this comment.
Import of 'Polygon' is not used.
| from shapely.geometry import Point, Polygon | |
| from shapely.geometry import Point |
seacharts/core/parserFGDB.py
Outdated
|
|
||
| import fiona | ||
|
|
||
| from seacharts.core import DataParser, paths |
There was a problem hiding this comment.
Import of 'paths' is not used.
| from seacharts.core import DataParser, paths | |
| from seacharts.core import DataParser |
* Fixed some issues based on Copilot-generated review. - Added a check in `build_directory_structure` to raise a ValueError if the source root name is None. - Updated `get_source_root_name` method signatures in `DataParser`, `FGDBParser`, and `S57Parser` to indicate they can return None. - Modified return values in `FGDBParser` and `S57Parser` to return None when no valid data is found. - Improved docstrings for clarity on return types and conditions. * Fix the false positive scenarios in control panel creation
* Remove unused 'override' method * Change config to default to darkmode * Remove redundant markdown, update main README file
No description provided.