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

Regionprovider Region ID fetching optimisation #1202

Merged
merged 9 commits into from Jan 5, 2016
Merged

Conversation

stevage
Copy link
Contributor

@stevage stevage commented Dec 22, 2015

This PR includes two separate optimisations:

  1. Maintaining an index of pre-computed codes for fast matching
  2. Allowing the use of server-side JSON instead of fetching IDs from WFS. The WFS method is still available as a fallback.

stevage added a commit to TerriaJS/nationalmap that referenced this pull request Dec 22, 2015
loadText('test/csv/mini_ced.xml').then(function(xml) {
ced.loadRegionsFromXML(xml);
expect(ced.regions.length).toEqual(6);
ced.loadRegionIDs().then(function(json) {
Copy link
Contributor

Choose a reason for hiding this comment

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

This isn't really a comment on your commit, but on the existing code - can you set it up so the unit tests didn't go off to a server at all, eg. using a spy? (eg. see ArcGisMapServerCatalogItemSpec)

Copy link
Contributor

Choose a reason for hiding this comment

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

btw @kring's doing some cool work on this right now using sinon.fakeServer.create(), to solve the problem of failing unit tests on IE9 (which cannot load data from the region mapping server without a proxy).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, good idea.

@RacingTadpole
Copy link
Contributor

OK, that's all I can think of! Over to you again :-)

@RacingTadpole
Copy link
Contributor

Looks good! Let me know when you're ready for me to take another look.

@stevage
Copy link
Contributor Author

stevage commented Dec 24, 2015

Oh, yep, I'm ready - think I addressed everything.

kring added a commit that referenced this pull request Jan 5, 2016
Regionprovider Region ID fetching optimisation
@kring kring merged commit fa03cf3 into master Jan 5, 2016
@kring kring deleted the regionprovider-fidList branch January 5, 2016 01:11
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.

None yet

3 participants