Closed kvalev closed 2 years ago
No, that is not supported. But it would be cool. I know topojson supports multiple layers with single declared arcs, but I don't know what a good approach would be to handle this usecase. Any suggestions or approaches are much welcome!
Thanks for the quick response! Unfortunately, I wont be of much help, as I am very much a newbie wrt to topojson. I just stumbled upon it, because one data visualization tool requires it.
One simple solution: you can first merge the geojsons / geo-dataframes together and distinguish them by adding one field. Then in the generated topojson dict, replace the single object by creating a dict based on the field you created.
@natsuapo, simple but effective. Sounds like an idea worth trying!
This is now supported by means of multiple geo-dataframes per https://github.com/mattijn/topojson/pull/169 and is documented here: https://mattijn.github.io/topojson/example/input-types.html#list-of-geodataframes.
Usage for above mentioned example can be declared as such:
from topojson import Topology
topo = Topology(
data=[regions, municipalities], # can be either a GeoDataFrame or a GeoJSON FeatureCollection
object_name=['regions', 'municipalities']
)
Documentation is here:
Hey, I am trying to merge multiple geojson feature collections to a single topojson, but I cant seem to get it running.
I tried both:
and
but neither of them worked. Is this use case supported?