Skip to content
This repository has been archived by the owner on Apr 10, 2018. It is now read-only.

Migrate ramps to ensure validity #411

Closed
wants to merge 1 commit into from
Closed

Migrate ramps to ensure validity #411

wants to merge 1 commit into from

Conversation

scothis
Copy link
Contributor

@scothis scothis commented Feb 5, 2016

We added validation checks to make sure that ramp stops are sorted by
zoom level and do not have duplicate stops by zoom. This broke some
styles that have ramps with out of order and/or duplicate stops.

We should migrate these styles ramp to ensure compliance with the new
validations. The migration does the following:

  • sorts ramp stops by zoom
  • removes duplicate stops
  • marginally increments the zoom of a colliding stop with a unique value
    • rerun the migration in case changing the zoom causes a new
      collision/ordering issue

We added validation checks to make sure that ramp stops are sorted by
zoom level and do not have duplicate stops by zoom. This broke some
styles that have ramps with out of order and/or duplicate stops.

We should migrate these styles ramp to ensure compliance with the new
validations. The migration does the following:

- sorts ramp stops by zoom
- removes duplicate stops
- marginally increments the zoom of a colliding stop with a unique value
  - rerun the migration in case changing the zoom causes a new
    collision/ordering issue
@scothis
Copy link
Contributor Author

scothis commented Feb 5, 2016

@tmcw for review

@jfirebaugh
Copy link
Contributor

When/where will this migration get run?

@scothis
Copy link
Contributor Author

scothis commented Feb 5, 2016

When/where will this migration get run?

Good question, typically we migrate between major version. The issue here is that we made a backwards incompatible change (#397) between 8.3 and 8.4, which causes some styles to not render. There's overhead in migrating a v8 style to v8, but a little overhead is better than a style breaking when upgrading to a new version of gl-js.

Minimally, we can run the migrator within gl-js if style validation errors are detected. Other renders will need to figure out their own migration path.

@jfirebaugh
Copy link
Contributor

Running a v8 ⇢ v8 migration is unfortunately unsafe -- for example it will incorrectly reverse coordinates in video sources and the order of symbol layers.

I think it might be prudent to revert #397 and let it wait for v9.

@scothis
Copy link
Contributor Author

scothis commented Feb 5, 2016

I think it might be prudent to revert #397 and let it wait for v9.

Agreed.

@scothis
Copy link
Contributor Author

scothis commented Feb 5, 2016

Continued at #413

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants