Update code to remove geometry deprecation warnings

This commit is contained in:
Tobie Morgan Hitchcock 2022-02-22 16:30:02 +00:00
parent d5c53b7791
commit ca6974a5a8

View file

@ -259,7 +259,7 @@ impl fmt::Display for Geometry {
Geometry::Line(v) => write!( Geometry::Line(v) => write!(
f, f,
"{{ type: 'LineString', coordinates: [{}] }}", "{{ type: 'LineString', coordinates: [{}] }}",
v.points_iter() v.points()
.map(|ref v| format!("[{}, {}]", v.x(), v.y())) .map(|ref v| format!("[{}, {}]", v.x(), v.y()))
.collect::<Vec<_>>() .collect::<Vec<_>>()
.join(", ") .join(", ")
@ -268,7 +268,7 @@ impl fmt::Display for Geometry {
f, f,
"{{ type: 'Polygon', coordinates: [[{}]{}] }}", "{{ type: 'Polygon', coordinates: [[{}]{}] }}",
v.exterior() v.exterior()
.points_iter() .points()
.map(|ref v| format!("[{}, {}]", v.x(), v.y())) .map(|ref v| format!("[{}, {}]", v.x(), v.y()))
.collect::<Vec<_>>() .collect::<Vec<_>>()
.join(", "), .join(", "),
@ -281,7 +281,7 @@ impl fmt::Display for Geometry {
.map(|i| { .map(|i| {
format!( format!(
"[{}]", "[{}]",
i.points_iter() i.points()
.map(|ref v| format!("[{}, {}]", v.x(), v.y())) .map(|ref v| format!("[{}, {}]", v.x(), v.y()))
.collect::<Vec<_>>() .collect::<Vec<_>>()
.join(", ") .join(", ")
@ -308,7 +308,7 @@ impl fmt::Display for Geometry {
v.iter() v.iter()
.map(|v| format!( .map(|v| format!(
"[{}]", "[{}]",
v.points_iter() v.points()
.map(|ref v| format!("[{}, {}]", v.x(), v.y())) .map(|ref v| format!("[{}, {}]", v.x(), v.y()))
.collect::<Vec<_>>() .collect::<Vec<_>>()
.join(", ") .join(", ")
@ -323,7 +323,7 @@ impl fmt::Display for Geometry {
.map(|v| format!( .map(|v| format!(
"[[{}]{}]", "[[{}]{}]",
v.exterior() v.exterior()
.points_iter() .points()
.map(|ref v| format!("[{}, {}]", v.x(), v.y())) .map(|ref v| format!("[{}, {}]", v.x(), v.y()))
.collect::<Vec<_>>() .collect::<Vec<_>>()
.join(", "), .join(", "),
@ -336,7 +336,7 @@ impl fmt::Display for Geometry {
.map(|i| { .map(|i| {
format!( format!(
"[{}]", "[{}]",
i.points_iter() i.points()
.map(|ref v| format!("[{}, {}]", v.x(), v.y())) .map(|ref v| format!("[{}, {}]", v.x(), v.y()))
.collect::<Vec<_>>() .collect::<Vec<_>>()
.join(", ") .join(", ")
@ -382,7 +382,7 @@ impl Serialize for Geometry {
map.serialize_value("LineString")?; map.serialize_value("LineString")?;
map.serialize_key("coordinates")?; map.serialize_key("coordinates")?;
map.serialize_value( map.serialize_value(
v.points_iter() v.points()
.map(|p| vec![p.x(), p.y()]) .map(|p| vec![p.x(), p.y()])
.collect::<Vec<Vec<f64>>>() .collect::<Vec<Vec<f64>>>()
.as_slice(), .as_slice(),
@ -397,7 +397,7 @@ impl Serialize for Geometry {
map.serialize_value( map.serialize_value(
vec![v vec![v
.exterior() .exterior()
.points_iter() .points()
.map(|p| vec![p.x(), p.y()]) .map(|p| vec![p.x(), p.y()])
.collect::<Vec<Vec<f64>>>()] .collect::<Vec<Vec<f64>>>()]
.into_iter() .into_iter()
@ -405,7 +405,7 @@ impl Serialize for Geometry {
v.interiors() v.interiors()
.into_iter() .into_iter()
.map(|i| { .map(|i| {
i.points_iter() i.points()
.map(|p| vec![p.x(), p.y()]) .map(|p| vec![p.x(), p.y()])
.collect::<Vec<Vec<f64>>>() .collect::<Vec<Vec<f64>>>()
}) })