Skip to content

Commit

Permalink
Merge pull request #7 from ThomasCartier/update_functions
Browse files Browse the repository at this point in the history
Update bindings to use sfcgal 2.0.0
  • Loading branch information
mthh authored Nov 14, 2024
2 parents 648c978 + 8d7d561 commit d39b8c2
Show file tree
Hide file tree
Showing 9 changed files with 1,869 additions and 247 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ categories = ["algorithms", "api-bindings"]
documentation = "https://mthh.github.io/sfcgal-rs/sfcgal/"

[dependencies]
sfcgal-sys = "0.7.0"
sfcgal-sys = "0.8.0"
anyhow = "1.0"
libc = "0.2"
geo-types = "0.7"
Expand Down
2 changes: 1 addition & 1 deletion benches/bench.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ extern crate geojson;
extern crate sfcgal;
extern crate test;

use sfcgal::{FromGeoJSON, SFCGeometry, ToCoordinates, ToGeoJSON, ToSFCGAL, TryInto};
use sfcgal::{FromGeoJSON, SFCGeometry, ToCoordinates, ToGeoJSON, TryInto};
use std::convert::TryFrom;
use std::io::Read;
use test::Bencher;
Expand Down
4 changes: 2 additions & 2 deletions examples/skeleton_geojson.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ fn main() {
};
let new_features = features
.iter()
.filter_map(|ref feature| {
.filter_map(|feature| {
if let Some(geom) = &feature.geometry {
if let Value::Polygon(..) = geom.value {
let polygon_sfc = SFCGeometry::from_geojson::<Pt3d>(&geom.value).unwrap();
Expand All @@ -42,7 +42,7 @@ fn main() {
});
}
}
return None;
None
})
.collect::<Vec<_>>();

Expand Down
50 changes: 25 additions & 25 deletions src/conversion/coords.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ where
/// ``` rust
/// use sfcgal::{SFCGeometry, CoordSeq, Point3d, ToCoordinates};
///
/// let line_3d = SFCGeometry::new("LINESTRING(3.5 5.6 1.0,4.8 10.5 1.0)").unwrap();
/// let line_3d = SFCGeometry::new("LINESTRING (3.5 5.6 1.0,4.8 10.5 1.0)").unwrap();
/// let coordinates = line_3d.to_coordinates::<Point3d>().unwrap();
/// // assert_eq!(coordinates, CoordSeq::Linestring(vec![(3.5, 5.6, 1.0), (4.8, 10.5, 1.0)]));
/// ```
Expand Down Expand Up @@ -480,7 +480,7 @@ mod tests {

#[test]
fn point_2d_sfcgal_to_coordinates_to_sfcgal() {
let input_wkt = "POINT(0.1 0.9)";
let input_wkt = "POINT (0.1 0.9)";
let pt_sfcgal = SFCGeometry::new(input_wkt).unwrap();
let coords: CoordSeq<Point2d> = pt_sfcgal.to_coordinates().unwrap();
if let CoordSeq::Point(ref coords) = coords {
Expand All @@ -495,7 +495,7 @@ mod tests {

#[test]
fn point_3d_sfcgal_to_coordinates_to_sfcgal() {
let input_wkt = "POINT Z(0.1 0.9 1.0)";
let input_wkt = "POINT Z (0.1 0.9 1.0)";
let pt_sfcgal = SFCGeometry::new(input_wkt).unwrap();
let coords: CoordSeq<Point3d> = pt_sfcgal.to_coordinates().unwrap();
if let CoordSeq::Point(ref coords) = coords {
Expand All @@ -511,7 +511,7 @@ mod tests {

#[test]
fn multipoint_2d_sfcgal_to_coordinates_to_sfcgal() {
let input_wkt = "MULTIPOINT((3.5 5.6),(4.8 10.5))";
let input_wkt = "MULTIPOINT ((3.5 5.6),(4.8 10.5))";
let multipt_sfcgal = SFCGeometry::new(input_wkt).unwrap();
let coords: CoordSeq<Point2d> = multipt_sfcgal.to_coordinates().unwrap();
if let CoordSeq::Multipoint(ref coords) = coords {
Expand All @@ -528,7 +528,7 @@ mod tests {

#[test]
fn multipoint_3d_sfcgal_to_coordinates_to_sfcgal() {
let input_wkt = "MULTIPOINT Z((3.5 5.6 1.0),(4.8 10.5 1.0))";
let input_wkt = "MULTIPOINT Z ((3.5 5.6 1.0),(4.8 10.5 1.0))";
let multipt_sfcgal = SFCGeometry::new(input_wkt).unwrap();
let coords: CoordSeq<Point3d> = multipt_sfcgal.to_coordinates().unwrap();
if let CoordSeq::Multipoint(ref coords) = coords {
Expand All @@ -547,7 +547,7 @@ mod tests {

#[test]
fn linestring_2d_sfcgal_to_coordinates() {
let input_wkt = "LINESTRING(3.5 5.6,4.8 10.5)";
let input_wkt = "LINESTRING (3.5 5.6,4.8 10.5)";
let linestring_sfcgal = SFCGeometry::new(input_wkt).unwrap();
let coords: CoordSeq<Point2d> = linestring_sfcgal.to_coordinates().unwrap();
if let CoordSeq::Linestring(ref coords) = coords {
Expand All @@ -564,7 +564,7 @@ mod tests {

#[test]
fn linestring_3d_sfcgal_to_coordinates() {
let input_wkt = "LINESTRING Z(3.5 5.6 1.0,4.8 10.5 1.0)";
let input_wkt = "LINESTRING Z (3.5 5.6 1.0,4.8 10.5 1.0)";
let linestring_sfcgal = SFCGeometry::new(input_wkt).unwrap();
let coords: CoordSeq<Point3d> = linestring_sfcgal.to_coordinates().unwrap();
if let CoordSeq::Linestring(ref coords) = coords {
Expand All @@ -583,7 +583,7 @@ mod tests {

#[test]
fn multilinestring_2d_sfcgal_to_coordinates() {
let input_wkt = "MULTILINESTRING((3.5 5.6,4.8 10.5),(8.9 12.9,2.1 3.5),(1.1 4.8,6.2 7.5))";
let input_wkt = "MULTILINESTRING ((3.5 5.6,4.8 10.5),(8.9 12.9,2.1 3.5),(1.1 4.8,6.2 7.5))";
let mls_sfcgal = SFCGeometry::new(input_wkt).unwrap();
let coords: CoordSeq<Point2d> = mls_sfcgal.to_coordinates().unwrap();
if let CoordSeq::Multilinestring(ref coords) = coords {
Expand All @@ -602,7 +602,7 @@ mod tests {

#[test]
fn multilinestring_3d_sfcgal_to_coordinates() {
let input_wkt = "MULTILINESTRING Z((3.5 5.6 1.0,4.8 10.5 1.0),(8.9 12.9 4.0,2.1 3.5 4.0),(1.1 4.8 4.0,6.2 7.5 4.0))";
let input_wkt = "MULTILINESTRING Z ((3.5 5.6 1.0,4.8 10.5 1.0),(8.9 12.9 4.0,2.1 3.5 4.0),(1.1 4.8 4.0,6.2 7.5 4.0))";
let multilinestring_sfcgal = SFCGeometry::new(input_wkt).unwrap();
let coords: CoordSeq<Point3d> = multilinestring_sfcgal.to_coordinates().unwrap();
if let CoordSeq::Multilinestring(ref coords) = coords {
Expand All @@ -624,7 +624,7 @@ mod tests {

#[test]
fn triangle_2d_sfcgal_to_coordinates_to_sfcgal() {
let input_wkt = "TRIANGLE((0.0 1.0,1.0 0.0,1.0 1.0,0.0 1.0))";
let input_wkt = "TRIANGLE ((0.0 1.0,1.0 0.0,1.0 1.0,0.0 1.0))";
let triangle_sfcgal = SFCGeometry::new(input_wkt).unwrap();
let coords: CoordSeq<Point2d> = triangle_sfcgal.to_coordinates().unwrap();
if let CoordSeq::Triangle(ref pts) = coords {
Expand All @@ -643,7 +643,7 @@ mod tests {

#[test]
fn solid_3d_sfcgal_to_coordinates() {
let input_wkt = "SOLID Z((((0 0 0,0 0 1,0 1 1,0 1 0,0 0 0)),\
let input_wkt = "SOLID Z ((((0 0 0,0 0 1,0 1 1,0 1 0,0 0 0)),\
((0 0 0,0 1 0,1 1 0,1 0 0,0 0 0)),\
((0 0 0,1 0 0,1 0 1,0 0 1,0 0 0)),\
((1 0 0,1 1 0,1 1 1,1 0 1,1 0 0)),\
Expand All @@ -666,7 +666,7 @@ mod tests {

#[test]
fn solid_with_interior_shell_3d_sfcgal_to_coordinates() {
let input_wkt = "SOLID Z((\
let input_wkt = "SOLID Z ((\
((0.0 0.0 0.0,0.0 1.0 0.0,1.0 1.0 0.0,1.0 0.0 0.0,0.0 0.0 0.0)),\
((1.0 0.0 0.0,1.0 1.0 0.0,1.0 1.0 1.0,1.0 0.0 1.0,1.0 0.0 0.0)),\
((0.0 1.0 0.0,0.0 1.0 1.0,1.0 1.0 1.0,1.0 1.0 0.0,0.0 1.0 0.0)),\
Expand Down Expand Up @@ -701,7 +701,7 @@ mod tests {
#[test]
fn geometrycollection_3d_sfcgal_to_coordinates() {
let input_wkt =
"GEOMETRYCOLLECTION Z(POINT Z(4.0 6.0 1.0),LINESTRING Z(4.0 6.0 1.0,7.0 10.0 1.0))";
"GEOMETRYCOLLECTION Z (POINT Z (4.0 6.0 1.0),LINESTRING Z (4.0 6.0 1.0,7.0 10.0 1.0))";
let gc_sfcgal = SFCGeometry::new(input_wkt).unwrap();
let coords: CoordSeq<Point3d> = gc_sfcgal.to_coordinates().unwrap();
if let CoordSeq::Geometrycollection(ref seq_coords) = coords {
Expand Down Expand Up @@ -762,28 +762,28 @@ mod tests {
let multipolygon_sfcgal = CoordSeq::Multipolygon(coords_multipolygon)
.to_sfcgal()
.unwrap();
assert_eq!("POINT(1.1 1.1)", pt_sfcgal.to_wkt_decim(1).unwrap());
assert_eq!("POINT (1.1 1.1)", pt_sfcgal.to_wkt_decim(1).unwrap());
assert_eq!(
"MULTIPOINT((1.1 1.1),(2.2 2.2))",
"MULTIPOINT ((1.1 1.1),(2.2 2.2))",
multipt_sfcgal.to_wkt_decim(1).unwrap()
);
assert_eq!(
"LINESTRING(1.1 1.1,2.2 2.2)",
"LINESTRING (1.1 1.1,2.2 2.2)",
line_sfcgal.to_wkt_decim(1).unwrap()
);
assert_eq!(
"MULTILINESTRING((1.1 1.1,2.2 2.2),\
"MULTILINESTRING ((1.1 1.1,2.2 2.2),\
(3.1 3.1,5.2 5.2,5.2 5.2),\
(1.1 1.1,2.2 2.2,5.2 5.2))",
multiline_sfcgal.to_wkt_decim(1).unwrap(),
);
assert_eq!(
"POLYGON((0.0 0.0,1.0 0.0,1.0 1.0,0.0 1.0,0.0 0.0),\
"POLYGON ((0.0 0.0,1.0 0.0,1.0 1.0,0.0 1.0,0.0 0.0),\
(0.1 0.1,0.1 0.9,0.9 0.9,0.9 0.1,0.1 0.1))",
polygon_sfcgal.to_wkt_decim(1).unwrap(),
);
assert_eq!(
"MULTIPOLYGON(((0.0 0.0,1.0 0.0,1.0 1.0,0.0 1.0,0.0 0.0),\
"MULTIPOLYGON (((0.0 0.0,1.0 0.0,1.0 1.0,0.0 1.0,0.0 0.0),\
(0.1 0.1,0.1 0.9,0.9 0.9,0.9 0.1,0.1 0.1)),\
((2.0 2.0,6.0 2.0,6.0 6.0,2.0 6.0,2.0 2.0)))",
multipolygon_sfcgal.to_wkt_decim(1).unwrap(),
Expand Down Expand Up @@ -855,27 +855,27 @@ mod tests {
let multipolygon_sfcgal = CoordSeq::Multipolygon(coords_multipolygon)
.to_sfcgal()
.unwrap();
assert_eq!("POINT Z(1.1 1.1 1.1)", pt_sfcgal.to_wkt_decim(1).unwrap());
assert_eq!("POINT Z (1.1 1.1 1.1)", pt_sfcgal.to_wkt_decim(1).unwrap());
assert_eq!(
"MULTIPOINT Z((1.1 1.1 5.0),(2.2 2.2 5.0))",
"MULTIPOINT Z ((1.1 1.1 5.0),(2.2 2.2 5.0))",
multipt_sfcgal.to_wkt_decim(1).unwrap()
);
assert_eq!(
"LINESTRING Z(1.1 1.1 5.0,2.2 2.2 5.0)",
"LINESTRING Z (1.1 1.1 5.0,2.2 2.2 5.0)",
line_sfcgal.to_wkt_decim(1).unwrap()
);
assert_eq!(
"MULTILINESTRING Z((1.1 1.1 3.0,2.2 2.2 3.0),(3.1 3.1 3.0,5.2 5.2 3.0,5.2 5.2 3.0),\
"MULTILINESTRING Z ((1.1 1.1 3.0,2.2 2.2 3.0),(3.1 3.1 3.0,5.2 5.2 3.0,5.2 5.2 3.0),\
(1.1 1.1 3.0,2.2 2.2 3.0,5.2 5.2 3.0))",
multiline_sfcgal.to_wkt_decim(1).unwrap(),
);
assert_eq!(
"POLYGON Z((0.0 0.0 3.0,1.0 0.0 3.0,1.0 1.0 3.0,0.0 1.0 3.0,0.0 0.0 3.0),\
"POLYGON Z ((0.0 0.0 3.0,1.0 0.0 3.0,1.0 1.0 3.0,0.0 1.0 3.0,0.0 0.0 3.0),\
(0.1 0.1 3.0,0.1 0.9 3.0,0.9 0.9 3.0,0.9 0.1 3.0,0.1 0.1 3.0))",
polygon_sfcgal.to_wkt_decim(1).unwrap(),
);
assert_eq!(
"MULTIPOLYGON Z(((0.0 0.0 3.0,1.0 0.0 3.0,1.0 1.0 3.0,0.0 1.0 3.0,0.0 0.0 3.0),\
"MULTIPOLYGON Z (((0.0 0.0 3.0,1.0 0.0 3.0,1.0 1.0 3.0,0.0 1.0 3.0,0.0 0.0 3.0),\
(0.1 0.1 3.0,0.1 0.9 3.0,0.9 0.9 3.0,0.9 0.1 3.0,0.1 0.1 3.0)),\
((2.0 2.0 3.0,6.0 2.0 3.0,6.0 6.0 3.0,2.0 6.0 3.0,2.0 2.0 3.0)))",
multipolygon_sfcgal.to_wkt_decim(1).unwrap(),
Expand Down
30 changes: 15 additions & 15 deletions src/conversion/geojson.rs
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ pub trait ToGeoJSON {
/// use sfcgal::{SFCGeometry, ToGeoJSON};
/// type Point3d = (f64, f64, f64);
///
/// let input_wkt = "POINT(0.1 0.9 1.0)";
/// let input_wkt = "POINT (0.1 0.9 1.0)";
/// let pt_sfcgal = SFCGeometry::new(input_wkt).unwrap();
/// let pt_geojson = pt_sfcgal.to_geojson::<Point3d>().unwrap();
/// ```
Expand Down Expand Up @@ -244,7 +244,7 @@ mod tests {

#[test]
fn point_2d_sfcgal_to_geojson_to_sfcgal() {
let input_wkt = "POINT(0.1 0.9)";
let input_wkt = "POINT (0.1 0.9)";
let pt_sfcgal = SFCGeometry::new(input_wkt).unwrap();
let pt_geojson = pt_sfcgal.to_geojson::<Point2d>().unwrap();
let pt_sfcgal_new = SFCGeometry::from_geojson::<Point2d>(&pt_geojson).unwrap();
Expand All @@ -262,7 +262,7 @@ mod tests {

#[test]
fn point_3d_sfcgal_to_geojson_to_sfcgal() {
let input_wkt = "POINT(0.1 0.9 1.0)";
let input_wkt = "POINT (0.1 0.9 1.0)";
let pt_sfcgal = SFCGeometry::new(input_wkt).unwrap();
let pt_geojson = pt_sfcgal.to_geojson::<Point3d>().unwrap();
let pt_sfcgal_new = SFCGeometry::from_geojson::<Point3d>(&pt_geojson).unwrap();
Expand All @@ -279,7 +279,7 @@ mod tests {
}
#[test]
fn multipoint_2d_sfcgal_to_geojson_to_sfcgal() {
let input_wkt = "MULTIPOINT((0.1 0.9),(2.3 3.4))";
let input_wkt = "MULTIPOINT ((0.1 0.9),(2.3 3.4))";
let multipt_sfcgal = SFCGeometry::new(input_wkt).unwrap();
let multipt_geojson = multipt_sfcgal.to_geojson::<Point2d>().unwrap();
let multipt_sfcgal_new = SFCGeometry::from_geojson::<Point2d>(&multipt_geojson).unwrap();
Expand All @@ -291,7 +291,7 @@ mod tests {

#[test]
fn multipoint_3d_sfcgal_to_geojson_to_sfcgal() {
let input_wkt = "MULTIPOINT((0.1 0.9 1.1),(2.3 3.4 1.1))";
let input_wkt = "MULTIPOINT ((0.1 0.9 1.1),(2.3 3.4 1.1))";
let multipt_sfcgal = SFCGeometry::new(input_wkt).unwrap();
let multipt_geojson = multipt_sfcgal.to_geojson::<Point3d>().unwrap();
let multipt_sfcgal_new = SFCGeometry::from_geojson::<Point3d>(&multipt_geojson).unwrap();
Expand All @@ -302,7 +302,7 @@ mod tests {
}
#[test]
fn line_2d_sfcgal_to_geojson_to_sfcgal() {
let input_wkt = "LINESTRING(10.0 1.0, 1.0 2.0)";
let input_wkt = "LINESTRING (10.0 1.0, 1.0 2.0)";
let line_sfcgal = SFCGeometry::new(input_wkt).unwrap();
let line_geojson = line_sfcgal.to_geojson::<Point2d>().unwrap();
let line_sfcgal_new = SFCGeometry::from_geojson::<Point2d>(&line_geojson).unwrap();
Expand All @@ -319,7 +319,7 @@ mod tests {
}
#[test]
fn line_3d_sfcgal_to_geojson_to_sfcgal() {
let input_wkt = "LINESTRING(10.0 1.0 2.0, 1.0 2.0 1.7)";
let input_wkt = "LINESTRING (10.0 1.0 2.0, 1.0 2.0 1.7)";
let line_sfcgal = SFCGeometry::new(input_wkt).unwrap();
let line_geojson = line_sfcgal.to_geojson::<Point3d>().unwrap();
let line_sfcgal_new = SFCGeometry::from_geojson::<Point3d>(&line_geojson).unwrap();
Expand All @@ -336,7 +336,7 @@ mod tests {
}
#[test]
fn multiline_2d_sfcgal_to_geojson_to_sfcgal() {
let input_wkt = "MULTILINESTRING(\
let input_wkt = "MULTILINESTRING (\
(-0.0 -0.0,0.5 0.5),\
(1.0 -0.0,0.5 0.5),\
(1.0 1.0,0.5 0.5),\
Expand All @@ -358,7 +358,7 @@ mod tests {
}
#[test]
fn multiline_3d_sfcgal_to_geojson_to_sfcgal() {
let input_wkt = "MULTILINESTRING(\
let input_wkt = "MULTILINESTRING (\
(-0.0 -0.0 1.3,0.5 0.5 1.3),\
(1.0 -0.0 1.3,0.5 0.5 1.3),\
(1.0 1.0 1.3,0.5 0.5 1.3),\
Expand All @@ -380,7 +380,7 @@ mod tests {
}
#[test]
fn polyg_2d_sfcgal_to_geojson_to_sfcgal() {
let input_wkt = "POLYGON((0.0 0.0, 1.0 0.0, 1.0 1.0, 0.0 0.0))";
let input_wkt = "POLYGON ((0.0 0.0, 1.0 0.0, 1.0 1.0, 0.0 0.0))";
let polyg_sfcgal = SFCGeometry::new(input_wkt).unwrap();
let polyg_geojson = polyg_sfcgal.to_geojson::<Point2d>().unwrap();
let polyg_sfcgal_new = SFCGeometry::from_geojson::<Point2d>(&polyg_geojson).unwrap();
Expand All @@ -397,7 +397,7 @@ mod tests {
}
#[test]
fn polyg_3d_sfcgal_to_geojson_to_sfcgal() {
let input_wkt = "POLYGON((0.0 0.0 2.0, 1.0 0.0 2.0, 1.0 1.0 2.0, 0.0 0.0 2.0))";
let input_wkt = "POLYGON ((0.0 0.0 2.0, 1.0 0.0 2.0, 1.0 1.0 2.0, 0.0 0.0 2.0))";
let polyg_sfcgal = SFCGeometry::new(input_wkt).unwrap();
let polyg_geojson = polyg_sfcgal.to_geojson::<Point3d>().unwrap();
let polyg_sfcgal_new = SFCGeometry::from_geojson::<Point3d>(&polyg_geojson).unwrap();
Expand All @@ -414,7 +414,7 @@ mod tests {
}
#[test]
fn multipolyg_2d_sfcgal_to_geojson_to_sfcgal() {
let input_wkt = "MULTIPOLYGON(((0.0 0.0, 1.0 0.0, 1.0 1.0, 0.0 0.0)))";
let input_wkt = "MULTIPOLYGON (((0.0 0.0, 1.0 0.0, 1.0 1.0, 0.0 0.0)))";
let multipolyg_sfcgal = SFCGeometry::new(input_wkt).unwrap();
let multipolyg_geojson = multipolyg_sfcgal.to_geojson::<Point2d>().unwrap();
let multipolyg_sfcgal_new =
Expand All @@ -426,7 +426,7 @@ mod tests {
}
#[test]
fn multipolyg_3d_sfcgal_to_geojson_to_sfcgal() {
let input_wkt = "MULTIPOLYGON(((0.0 0.0 2.0, 1.0 0.0 2.0, 1.0 1.0 2.0, 0.0 0.0 2.0)))";
let input_wkt = "MULTIPOLYGON (((0.0 0.0 2.0, 1.0 0.0 2.0, 1.0 1.0 2.0, 0.0 0.0 2.0)))";
let multipolyg_sfcgal = SFCGeometry::new(input_wkt).unwrap();
let multipolyg_geojson = multipolyg_sfcgal.to_geojson::<Point3d>().unwrap();
let multipolyg_sfcgal_new =
Expand All @@ -444,7 +444,7 @@ mod tests {
}
#[test]
fn geomcollection_2d_sfcgal_to_geojson_to_sfcgal() {
let input_wkt = "GEOMETRYCOLLECTION(POINT(1.0 1.0),LINESTRING(10.0 1.0,1.0 2.0))";
let input_wkt = "GEOMETRYCOLLECTION (POINT (1.0 1.0),LINESTRING (10.0 1.0,1.0 2.0))";
let multipolyg_sfcgal = SFCGeometry::new(input_wkt).unwrap();
let multipolyg_geojson = multipolyg_sfcgal.to_geojson::<Point2d>().unwrap();
let multipolyg_sfcgal_new =
Expand All @@ -457,7 +457,7 @@ mod tests {
#[test]
fn geomcollection_3d_sfcgal_to_geojson_to_sfcgal() {
let input_wkt =
"GEOMETRYCOLLECTION(POINT(1.0 1.0 4.0),LINESTRING(10.0 1.0 4.0,1.0 2.0 4.0))";
"GEOMETRYCOLLECTION (POINT (1.0 1.0 4.0),LINESTRING (10.0 1.0 4.0,1.0 2.0 4.0))";
let multipolyg_sfcgal = SFCGeometry::new(input_wkt).unwrap();
let multipolyg_geojson = multipolyg_sfcgal.to_geojson::<Point3d>().unwrap();
let multipolyg_sfcgal_new =
Expand Down
4 changes: 2 additions & 2 deletions src/conversion/geotypes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ mod tests {

#[test]
fn point_sfcgal_try_into_geo() {
let pt_sfcgal = SFCGeometry::new("POINT(0.1 0.9)").unwrap();
let pt_sfcgal = SFCGeometry::new("POINT (0.1 0.9)").unwrap();
let pt: Point<f64> =
geo_types::Point::try_from(TryInto::try_into(pt_sfcgal).unwrap()).unwrap();
assert_ulps_eq!(pt.x(), 0.1);
Expand Down Expand Up @@ -551,7 +551,7 @@ mod tests {

#[test]
fn geometrycollection_sfcgal_to_geo_to_sfcgal() {
let input_wkt = "GEOMETRYCOLLECTION(POINT(4.0 6.0),LINESTRING(4.0 6.0,7.0 10.0))";
let input_wkt = "GEOMETRYCOLLECTION (POINT (4.0 6.0),LINESTRING (4.0 6.0,7.0 10.0))";
let gc_sfcgal = SFCGeometry::new(input_wkt).unwrap();
let gc: geo_types::Geometry<f64> = TryInto::try_into(gc_sfcgal).unwrap();
if let geo_types::Geometry::GeometryCollection(_gc) = &gc {
Expand Down
Loading

0 comments on commit d39b8c2

Please sign in to comment.