feat: support direct lat/lon input to bypass Nominatim geocoding - #233
Open
NieBangyan wants to merge 13 commits into
Open
NieBangyan wants to merge 13 commits into
NieBangyan wants to merge 13 commits into
Conversation
Updated README.md to include modifications for Chinese localization and network adaptability. Added usage examples and parameter descriptions for generating map posters with latitude and longitude.
Updated README to include modifications for improved functionality in China, emphasizing direct latitude/longitude input and localization features.
Updated README to reflect changes in functionality and usage instructions for generating map posters using latitude and longitude.
Updated the README to clarify changes made to the get_coordinates() function and argument validation.
Added information on map generation using city and country names.
Updated README to reflect new features and usage instructions for map generation.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR introduces a new feature that allows users to generate map posters using direct latitude/longitude coordinates, bypassing the Nominatim geocoding service entirely.All existing functionality remains fully backward-compatible. The new arguments are optional, so users can still use the old
--city/--countryworkflow without any changes.Problem
The current implementation relies on Nominatim for geocoding, which can be:
This limits the tool's usability for users in affected regions and prevents generating posters for locations that Nominatim cannot resolve (e.g., unnamed villages or remote areas).
Solution
--latand--longarguments to accept direct coordinates.--cityand--countryoptional. If missing, the script defaults to using coordinates for the filename and "Unknown" for the country label.--display-cityand--display-countryarguments allow users to override the displayed names, which is especially useful for non-Latin scripts (e.g., Chinese, Korean).Key Changes
create_map_poster.pyto allow--city/--countryor--lat/--long.get_coordinates()if they exist.Example Usage
Tested with multiple coordinate pairs, including Chinese cities, and verified that both the new coordinate workflow and the original geocoding workflow work correctly