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

Reduce precision of coordinates to ~1m #3

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

slowe
Copy link

@slowe slowe commented Oct 12, 2021

I've truncated coordinates in the GeoJSON for Local Authorities and Wards to 5 decimal places - this is equivalent to ~1.1m at the equator or sub-metre resolution at the latitude of the UK. Given that these are simplified shapes anyway, they could be truncated even further.

I've also removed some white space in the coordinates to shrink the files even more.

The result is that the Local Authority GeoJSON is now 1.3MB (previously 2.6MB) and Wards are now 5.3MB (previously 8.6MB).

You could further strip out some of the properties of the areas if they are unnecessary e.g. in Wards removing properties "BNG_E", "BNG_N", "LONG", "LAT", "Shape__Are", and "Shape__Len would save a further 1MB.

Also remove some white space to shrink the files further
@slowe
Copy link
Author

slowe commented Oct 12, 2021

Given the existence of previous versions of each GeoJSON I saved these truncated versions with new filenames rather than over-write the existing ones.

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.

1 participant