Skip to content
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

Selection of basemap output formats, TMS input, mobile UI #896

Merged
merged 12 commits into from
Oct 23, 2023

Conversation

spwoodcock
Copy link
Member

Note: this requires osm-fieldwork v0.3.7 or v0.4.0

I quickly made the PR as I had been working on osm-fieldwork basemapper.py and had it fresh in my head (avoid context switching).

Fixes #839 and fixes #586

  • Selection of mbtiles, osmand (sqlite) and pmtiles formats for basemap generation.
  • Use custom TMS URL for input.
  • Fixed mobile UI for tile generation modal.

@varun2948 I didn't spend too long on the UI part. I didn't want to duplicate work you may be doing already. But I just made it work on mobile as well as desktop 👍

@varun2948
Copy link
Contributor

@spwoodcock sounds good to me will have a look onto this branch aswell thanks for the feature on both side frontend backend .

@varun2948
Copy link
Contributor

@spwoodcock i am having this issue on this branch on my local server any idea ?

from osm_fieldwork.basemapper import create_basemap_file fmtm_api | ImportError: cannot import name 'create_basemap_file' from 'osm_fieldwork.basemapper' (/home/appuser/.local/lib/python3.10/site-packages/osm_fieldwork/basemapper.py)

@spwoodcock
Copy link
Member Author

This needs a new release of osm-fieldwork.

You can bind mount a local version - see the dev backend docs 👍

@varun2948
Copy link
Contributor

@spwoodcock now using development version of osm-fieldwork, I am getting error like this
File "/opt/app/central/central_routes.py", line 33, in <module> from ..projects import project_crud, project_schemas File "/opt/app/projects/project_crud.py", line 41, in <module> from osm_fieldwork.basemapper import create_basemap_file File "/home/appuser/.local/lib/python3.10/site-packages/osm_fieldwork/basemapper.py", line 34, in <module> from pmtiles.tile import ( ModuleNotFoundError: No module named 'pmtiles'

@spwoodcock
Copy link
Member Author

You need to rebuild the backend image using this branch.

It has the pmtiles dependency added.

@varun2948
Copy link
Contributor

added output_format on migration and then onto api and onto the UI table for generate basemap.
image

@spwoodcock
Copy link
Member Author

Nice 🤩

The migration looks good 👍

I was determining the format using the file extension - I'll have to check the download endpoint - we can probably use this new field instead. (I understand the new field is required to display the format without downloading the file).

Just fyi, I don't really envision the pmtiles format will be requested by a user, as it's an online only format (although they could, so we can give the option.

The idea of pmtiles was to:

  • Generate the entire project area in pmtiles when the project is created.
  • A user requests an area to download in mbtiles or sqlite format.
  • The backend grabs the tiles from S3 based pmtiles via RANGE request, and packages the tiles in the requested format (so they can view their area offline).

@varun2948
Copy link
Contributor

Yeah
My initial thought about the output_format was to extract it from the path and use that but then just did it with another field as it seemed reasonable as it already had a column for source.

Hmm about the PMtiles it was just requested by Rob so i guess we went ahead and did it for PMTiles too but i understand what you're trying to say.

@spwoodcock spwoodcock temporarily deployed to test October 23, 2023 14:46 — with GitHub Actions Inactive
@github-actions github-actions bot removed the migration Contains a DB migration label Oct 23, 2023
@pre-commit-ci pre-commit-ci bot temporarily deployed to test October 23, 2023 14:46 Inactive
@github-actions github-actions bot added the devops Related to deployment or configuration label Oct 23, 2023
@spwoodcock spwoodcock temporarily deployed to test October 23, 2023 14:47 — with GitHub Actions Inactive
@spwoodcock spwoodcock merged commit 90ace1b into development Oct 23, 2023
4 of 6 checks passed
@spwoodcock spwoodcock deleted the feat/basemap-tile-formats branch October 23, 2023 14:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend Related to backend code devops Related to deployment or configuration enhancement New feature or request frontend Related to frontend code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

MBTile generation, allow custom url input Support mbtile, sqlite, pmtile basemap generation
2 participants