Skip to content

feat: 1312 add missing data to the pmtiles#1328

Merged
jcpitre merged 31 commits into
mainfrom
1312-add-missing-data-to-the-pmtiles
Sep 9, 2025
Merged

feat: 1312 add missing data to the pmtiles#1328
jcpitre merged 31 commits into
mainfrom
1312-add-missing-data-to-the-pmtiles

Conversation

@qcdyx

@qcdyx qcdyx commented Aug 26, 2025

Copy link
Copy Markdown
Contributor

Summary:

Closes #1312

Expected behavior:
image

image image

Testing tips:

Provide tips, procedures and sample files on how to test the feature.
Testers are invited to follow the tips AND to try anything they deem relevant outside the bounds of the testing tips.

Please make sure these boxes are checked before submitting your pull request - thanks!

  • Run the unit tests with ./scripts/api-tests.sh to make sure you didn't break anything
  • Add or update any needed documentation to the repo
  • Format the title like "feat: [new feature short description]". Title must follow the Conventional Commit Specification(https://www.conventionalcommits.org/en/v1.0.0/).
  • Linked all relevant issues
  • Include screenshot(s) showing how this pull request works and fixes the issue(s)

@qcdyx qcdyx linked an issue Aug 26, 2025 that may be closed by this pull request
@qcdyx qcdyx changed the title 1312 add missing data to the pmtiles feat: 1312 add missing data to the pmtiles Aug 26, 2025
Comment thread functions-python/tasks_executor/src/tasks/pmtiles_builder/build_pmtiles.py Outdated
Comment thread functions-python/tasks_executor/src/tasks/pmtiles_builder/build_pmtiles.py Outdated
Comment thread functions-python/tasks_executor/src/tasks/pmtiles_builder/build_pmtiles.py Outdated
if not default_agency_name:
default_agency_name = agency_name

if not agencies and default_agency_name:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This condition is never true, as if the default_agency_name is set differently than "", the previous loop will have added at least one entry in the agencies dictionary.

agencies = {}
default_agency_name = ""
for row in self._read_csv(self.get_path(AGENCY_FILE)):
agency_id = row.get("agency_id") or "default"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[question]: Is it possible not to use the key "default"? It might be unlikely that an agency set the ID to "default," but it's possible.

Comment thread functions-python/tasks_executor/src/tasks/pmtiles_builder/build_pmtiles.py Outdated
Comment on lines +418 to +419
agency_id = route.get("agency_id") or "default"
agency_name = agencies.get(agency_id, agency_id)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it is preferable to use an empty string rather than "default".

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed. Using "default" as a key could conflict with a valid agency_id. It's better to use an empty string for the default agency when agency_id is not specified.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I find that default_agency_name is not useful in _load_agencies anymore, removed.

Comment thread functions-python/tasks_executor/src/tasks/pmtiles_builder/build_pmtiles.py Outdated
@qcdyx qcdyx requested a review from davidgamez August 26, 2025 20:13
@qcdyx qcdyx requested a review from jcpitre September 2, 2025 14:23

@davidgamez davidgamez left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work, I just added a non-blocking suggestion.

Comment thread functions-python/pmtiles_builder/src/main.py Outdated
@jcpitre jcpitre merged commit c5f7844 into main Sep 9, 2025
3 of 4 checks passed
@jcpitre jcpitre deleted the 1312-add-missing-data-to-the-pmtiles branch September 9, 2025 01:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add missing data to the pmtiles.

3 participants