Read GeoJSON file, return array of geometries.
(file)
| 108 | |
| 109 | |
| 110 | def geojson2geom_array(file): |
| 111 | """Read GeoJSON file, return array of geometries.""" |
| 112 | features = geojson.loads(Path(file).read_text())["features"] |
| 113 | return np.fromiter((shape(feat["geometry"]) for feat in features), object) |
| 114 | |
| 115 | |
| 116 | def project(coordinates, proj_string, in_radians=False): |