I am using the natural earth 10m files to reduce, simplify, and quantize them into TopoJSON. However, for my use case, I'm attempting to store the data on the server and request a country or region I am currently interested in to display with d3. Because of this I need to keep my file size fairly small.
I was able to write some hacky code to strip out the region geometry data and arcs from the full TopoJSON file and serve that at a reasonably small size. Unfortunately, I've come to realize that doing a mesh on this does not give me any results. If, however, I do not reindex all of the arcs and instead just inject empty arrays into the arc positions I don't need, mesh works fine.
Basically, my question is, is there a way for me to strip out a specific country or region from a large TopoJSON file? I don't mean just the geometry object since that's easy enough to do, but also reduce the main arcs array to only include what is needed. I'm struggling to find a clean way to do this.
Thanks!