-
Notifications
You must be signed in to change notification settings - Fork 956
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
Trim unnecessary coordinate precision? #357
Comments
Because 7th digit has a maximum margin of error that equals 11mm on the equator. We have 14 digits, half of them are simply unnecessary, leading to 2 times bigger sizes of GeoJSON when saved to a file. Although maybe this should be done as a post-processing step with a separate JS module, not as a part of each individual module, most users are unaware of the unnecessary digits. |
Yeah, I think this should be in a separate module - the space savings only happens when serializing out geojson, and often turf-using applications don't serialize at all/save to disk, or have lots of temporary results that aren't ever saved. |
I'm hitting file transfer limits when I run my 6-points-of-precision geojson through turf and get 14 points back. Even a separate module in turf for this would be fabulous, though for the moment there's this. |
@wboykinm just realized that you can probably do without a separate module: var meta = require('turf-meta');
meta.coordEach(geojson, function (p) {
p[0] = Math.round(p[0] * 1e6) / 1e6;
p[1] = Math.round(p[1] * 1e6) / 1e6;
}); |
SO EASY |
In order to let us configure and build the platform for new regions, this PR adds a new environment variable `REGION_ENV`. When set, it causes replacement configuration options to be loaded. As an example, this PR adds configurations that enable only the Meldedialog for `REGION_ENV=bonn`. The new region can be activated with the new commands - npm start:bonn - npm dev:bonn - npm build:bonn Closes FixMyBerlin/fixmy.platform#262 * Extend config for region-specific setup * Add geojson boundary for sample region * Disable subpages when their routes are not configured * Add instance-specific configuration for reports feature * Add build command for sample new region
from @mourner 's comment at
turf-junkyard/turf-hex-grid#19
The current code generates unnecessarily detailed coordinates because there's no rounding:
[-95.59408416187462, 31.27105676807148],
[-95.80518167741707, 31.58431182228841]
We should round to at least 7-8 digits.
I'm not sure that this makes sense... why should we limit coordinate precision?
The text was updated successfully, but these errors were encountered: