I have a .geojson dateset of sub-district administrative divisions. I would like to map out all the administrative divisions within a given district, but I can’t assemble them correctly.
I have tried using array.find:
ghimire_admin3_DANG_find = ghimire_admin3.features.find(f => f.properties.DISTRICT === "DANG")
But as the documentation notes:
The value of the first element in the array that satisfies the provided testing function.
Since I have several instances of in the data, and want to get them all, I tried using d3.group:
ghimire_admin3_DANG_group = d3.group(ghimire_admin3.features, f => f.properties.DISTRICT === "DANG")
But the resulting map would render as is; it needs to be narrowed to the resulting group of objects identified as ‘true’.
Any tips for how to get at this group of 10 ‘true’ values and to map them? The map in the notebook is derived entirely from Mike’s GeoJSON Viewer [I would have forked, but started the notebook just playing w/ the data on my own.]
Here’s my progress:
… Probably I am going about this the wrong way and should be using reduce and filter.