Closed jefffriesen closed 6 years ago
Creating a layer that takes topojson instead of geojson could, in some cases, significantly reduce the payload to the browse
@jefffriesen You are absolutely right.
The good news is that we foresaw this need and intentionally designed the GeoJsonLayer
as a composite layer that separates parsing of GeoJson data into a parent layer and rendering into sub layers (PolygonLayer
, PathLayer
, ScatterplotLayer
). Thus aTopoJsonLayer
could now be created without touching any rendering.
The bad news is that we have no current plans for doing this work. However, we would be very happy to accept a PR.
It should be quite straightforward for someone who knows TopoJson to simply copy of the GeoJsonLayer
folder into a TopJsonLayer
folder and replace the geojson parsing with topojson support.
The main necessary change should be here
Sounds like you were very thoughtful about the API design. That's great.
Unfortunately, I don't have the time to do a PR for this because of deadlines. I'm using fairly large geojson files (33 MB + 21 MB for a single view). Right now I'm using Electron so loading over the network is not an issue, but eventually I will want to use it in a regular browser context. Hopefully someone else comes across this with more time. You laid out a nice pathway to get started. Thanks.
Can be done by application through https://github.com/topojson/topojson-client
, converting topojson to geojson.
You all have probably considered this internally but I didn't see any tickets or mention of it.
Creating a layer that takes topojson instead of geojson could, in some cases, significantly reduce the payload to the browser: https://github.com/topojson/topojson
From their docs:
Not sure if it would be it's own layer or an alternative in the geojson layer. Either way, it seems like a useful addition to your library.
Thanks!