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

Isochrons should have a precision parameter #1851

Open
therealgilles opened this issue Nov 17, 2016 · 4 comments
Open

Isochrons should have a precision parameter #1851

therealgilles opened this issue Nov 17, 2016 · 4 comments

Comments

@therealgilles
Copy link

It would be great if the isochrons had a precision parameter, so that their size could be reduced by lowering the precision.

@TeXitoi
Copy link
Contributor

TeXitoi commented Nov 17, 2016

You have troubles with the size of the isochrones? Can you express your specific use case? How do you imagine this parameter?

For now, the circles are every 2 degrees, maybe that's still too much. Some ST_Simplify is also doable.

@therealgilles
Copy link
Author

I am displaying isochrons on Google Maps or Apple Maps using react-native (using react-native-maps). I have about 10 isochrons and displaying them slows down dragging and zoom in/out. The polygons also take a lot of memory (200 to 300 MB).

For now, I am downsampling the isochron data by keeping one set of coordinates every 5. I get a significant speed-up in user experience and the memory usage is down to 100 MB. The only (minor) issue is that there can be display artifacts (discrepancies) between the holes of an isochron and the polygons of the one that fill up that hole.

@TeXitoi
Copy link
Contributor

TeXitoi commented Nov 18, 2016

Maybe we can just limit the resolution of the circles. 180 points for a circle may be a bit too much. 60 may be enough.

For your specific problem (ie not the download time, but the performances on the device), some libs simplify the polygon. Leaflet do that for example. You can look at http://en.wikipedia.org/wiki/Douglas-Peucker_algorithm for a classic algorithm to handle that.

@TeXitoi
Copy link
Contributor

TeXitoi commented Nov 18, 2016

Maybe such a simplification would be a great contribution do react-native-maps.

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

No branches or pull requests

3 participants