Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## develop #236 +/- ##
===========================================
+ Coverage 87.39% 87.45% +0.05%
===========================================
Files 212 213 +1
Lines 12900 13006 +106
Branches 1093 1109 +16
===========================================
+ Hits 11274 11374 +100
- Misses 1226 1231 +5
- Partials 400 401 +1 ☔ View full report in Codecov by Harness. |
There was a problem hiding this comment.
Shouldn't this be in street/project.py?
There was a problem hiding this comment.
This is consistent with raster_tile_server and vector_tile_server also in utils/geo/
71352ae to
f15f817
Compare
a2dad0a to
f15f817
Compare
| elif provider.name in (StreetImageProviderNameEnum.PANORAMAX, StreetImageProviderNameEnum.PANORAMAX_CUSTOM): | ||
| base = (provider.url or Config.PANORAMAX_API_LINK).rstrip("/") | ||
| url = f"{base}/api/map/{z}/{x}/{y}.mvt" |
There was a problem hiding this comment.
What is the different between PANORMAX and PANORAMAX_CUSTOM?
Do we need both of these?
Also, the code above indicates that user can override MAPILLARY url
There was a problem hiding this comment.
The difference is:
- PANORAMAX uses the default public Metacatalog API endpoint with access to images of all federated Panoramax instances.
- PANORAMAX_CUSTOM allows users to specify a custom Panoramax API URL and thereby uses images from unfederated instances, or filter for images from a specific Panoramax instance.
Both use the same API format (/api/map/{z}/{x}/{y}.mvt) and return the same data structure, but PANORAMAX_CUSTOM is validated to require a URL.
The requirement to add an explicit PANORAMAX_CUSTOM came from review of the changes in Manager Dashboard: mapswipe/manager-dashboard#74 (review)
I agree that the user should not be able to override the MAPILLARY url, as the Pydantic validator in StreetImageProvider already enforces. I pushed a commit that clearly indicates that we always call the Mapillary API at Config.MAPILLARY_API_LINK.
There was a problem hiding this comment.
Can we document this somewhere in the code? Just a simple NOTE will be good.
If a provider.url is defined for PANORAMAX_CUSTOM and not defined for PANORAMAX then we should have different if/else so that the behavior is more explicit.
d4cb5bf to
5a5553c
Compare
| def backfill_image_provider(apps, schema_editor): | ||
| Project = apps.get_model('project', 'Project') | ||
|
|
||
| for project in Project._default_manager.all(): |
There was a problem hiding this comment.
We should use a filter instead of fetching all projects.
| project.project_type_specifics['imageProvider'] = { | ||
| 'name': 'MAPILLARY' | ||
| } | ||
| project.save(update_fields=['project_type_specifics']) |
There was a problem hiding this comment.
We should do a bulk save during migration
| for project in Project._default_manager.all(): | ||
| if project.project_type != 7: # STREET type | ||
| continue | ||
|
|
||
| if project.project_type_specifics is None: |
There was a problem hiding this comment.
We should filter instead of using continue.
| f"Migrating isPano to panoOnly for project {project.id} ({project.name})" | ||
| ) | ||
| filters['panoOnly'] = filters.pop('isPano') | ||
| project.save(update_fields=['project_type_specifics']) |
There was a problem hiding this comment.
We should do a bulk save.
Bulk save also return the no. of updates made.
Add logic from mapswipe/python-mapswipe-workers@dev...panoramax and refactor StreetImageProvider. This introduces a type change of View Streets project tasks taskId that requires migration and changes in Firebase.
…nsure correct sorting, sampling threshhold input in m instead km
Co-authored-by: Sushil Tiwari <susiltiwari750@gmail.com>
…ider is mapillary, correct type hint
… mandatory image provider
…tespace in migration
5a5553c to
1652e8d
Compare
…shold to meters > Migrations 0013/0014 used camelCase keys but project_type_specifics is stored snake_case. Also add a migration to convert legacy sampling_threshold values from km (float) to m (int).
Depends on
Changes
This enables the MapSwipe backend to handle View Streets projects with different image providers (currently Mapillary and Panoramax).
This PR doesn't introduce any:
printThis PR contains valid: