Einstein Analytics GeoJSON format script
Hi All,
Ran into an issue reformatting a large GeoJSON file to upload into Einstein Analytics - the file size was far too large for EA to handle and the standard GeoJSON format doesn't allow you to map a field in your dataset to an area on the map. The trailhead (https://trailhead.salesforce.com/en/content/learn/projects/wave_charts_custom_map/wave_charts_custom_map_geojson) gives a quick and dirty script to do this but doesn't fully solve the formatting issues and the file size remains the same.
A friend and I created a python script to flatten the required Id field and reduce the file size by removing decimal places from the polygon coordinates and then remove duplicate values to drastically reduce the file size (albeit the polygons are slightly less accurate).
This script allowed me to format a 160mb file down to just over 30mb which Einstein can then handle and the map is accurate enough for my use case.
We have added the script to this github repo if anyone wants to use it.
https://github.com/neal-shah/sf-einstein-analytics-geojson-map-formatter
Let me know if you have any questions.
Saahil
Is anyone willing to help a non-profit to resize their California ZIP code geoJSON map using either of these techniques?