Skip to content

Commit

Permalink
Handle polygon zones
Browse files Browse the repository at this point in the history
  • Loading branch information
dabreegster committed Jul 14, 2023
1 parent 134889a commit 642a841
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -379,9 +379,10 @@ pub fn load_zones(
{
let gj_geom: geojson::Geometry = feature.geometry.unwrap();
let geo_geometry: geo_types::Geometry<f64> = gj_geom.try_into().unwrap();
// TODO Support polygons too
if let geo_types::Geometry::MultiPolygon(mp) = geo_geometry {
zones.insert(zone_name, mp);
} else if let geo_types::Geometry::Polygon(p) = geo_geometry {
zones.insert(zone_name, p.into());
}
} else {
bail!(
Expand Down

0 comments on commit 642a841

Please sign in to comment.