I have a GeoJSON file that contains one FeatureCollection with a bunch of features that are polygons. I also have the boundary of the continental USA in another GeoJSON file. I'd like to clip the first GeoJSON file, leaving only those features that are inside the bounds of the continental USA, preferably using ogr2ogr.
I've tried this:
ogr2ogr -f geojson -clipsrc us_boundary.geo.json out.json quad_5_usa.json
But I get a lot of these errors:
ERROR 1: TopologyException: found non-noded intersection between LINESTRING (-75.5474 35.7657, -75.4695 35.6083) and LINESTRING (-75.4806 35.561, -75.4917 35.666) at -75.490025631336778 35.649775563901855
and the output file is empty. Thoughts?