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

Fix load-time performance issue with Proj4 #618

Open
theduckylittle opened this issue Dec 25, 2020 · 2 comments
Open

Fix load-time performance issue with Proj4 #618

theduckylittle opened this issue Dec 25, 2020 · 2 comments

Comments

@theduckylittle
Copy link
Member

This line of code in src/application.js is causing all sorts of problems:

        register(proj4);

Why? Not sure yet.

What's the problem? This line alone takes 2-3 seconds to run and seems to spike the CPU at times.

What's it supposed to do? GeoMoose does two fun things with projections: 1) It uses the UTM projections to provide better accuracy for measurement versus just using 3857. 2) It allows the users to display the mouse coordinates in local projections. Helpful for not having to know all of state-plane or handle lat-lon preferences at the local level.

Ideas on a fix:

  1. Use the new OpenLayers projection classes to define the projections. No need to bring along an extra version of Proj.
  2. Do not use Proj to calculate the points in the measure tool and just do the math for the UTM projections manually (see the USNG tool for an example of UTM math).
@brentfraser
Copy link
Contributor

As for measure, in previous versions of GeoMoose (1? 2? sometime around 2010) we switched to using Geodesic option in OpenLayers as this works far better in Northern latitudes. I would prefer using that (might need a search of OpenLayers to find the current status).

@brentfraser
Copy link
Contributor

This is the technique we should use https://openlayers.org/en/latest/examples/measure.html. Note the comment on that page regarding great circles.

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

No branches or pull requests

2 participants