-
Notifications
You must be signed in to change notification settings - Fork 242
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for sub-region tile servers (local maps) #128
base: main
Are you sure you want to change the base?
Conversation
std::string origin_crs; | ||
|
||
// local map projection | ||
PJ_CONTEXT * context = proj_context_create(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this PR!
Would you mind using smart pointers here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your feedback on this pull request.
You could use smart pointers (potentially std::unique_ptr
), but objects of type TileMapInformation
are passed into different functions. Thus, an explicit copy constructor would have to be defined for TileMapInformation
. In addition, you would probably also define a custom destructor that calls special "cleanup" functions of the PROJ
Lib.
Since the use of smart pointers has been largely avoided in the repository, I have not used them as well. But of course, we can discuss this again. What do you think?
New Feature: Support for Sub-Region Tile Servers
This pull request introduces a new feature allowing support for tile servers that provide maps for a specific sub-region rather than global coverage. This functionality is enabled via a new top-level property:
Use Local Map
.Details
For tile servers covering only a specific sub-region, zoom levels and tile coverage may deviate from typical global tile maps. Thus, certain properties need to be configured manually. Specifically:
Refer to OpenStreetMap's guide on zoom levels for more context on how zoom levels affect tile size and coverage.
New Properties under
Use Local Map
The following properties are introduced to support configuration for local map servers:
Meter per Pixel (Zoom 0)
: Defines the length (in meters) of a pixel edge at zoom level 0. Default is0.0
.Origin CRS
: The EPSG code for the coordinate reference system (CRS) of the local origin. This should be a cartesian coordinate system. Default is not set.Origin X
: The X-coordinate of the local origin in the specified CRS. Default is0.0
.Origin Y
: The Y-coordinate of the local origin in the specified CRS. Default is0.0
.Additional Notes
Please review the "Example Usage" section in the
README.md
for detailed usage examples and to verify integration with existing functionality.