Skip to content

Commit

Permalink
Alter new function names
Browse files Browse the repository at this point in the history
We aren't creating Line, Triangle or Rect types, after all.
  • Loading branch information
urschrei committed Sep 3, 2020
1 parent 1f5d55f commit d2abdb0
Showing 1 changed file with 6 additions and 17 deletions.
23 changes: 6 additions & 17 deletions src/conversion/from_geo_types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ where
T: Float,
{
fn from(line: &geo_types::Line<T>) -> Self {
let coords = create_line_type(line);
let coords = create_from_line_type(line);

geometry::Value::LineString(coords)
}
Expand All @@ -64,7 +64,7 @@ where
T: Float,
{
fn from(triangle: &geo_types::Triangle<T>) -> Self {
let coords = create_triangle_type(triangle);
let coords = create_from_triangle_type(triangle);

geometry::Value::Polygon(coords)
}
Expand All @@ -76,7 +76,7 @@ where
T: Float,
{
fn from(rect: &geo_types::Rect<T>) -> Self {
let coords = create_rect_type(rect);
let coords = create_from_rect_type(rect);

geometry::Value::Polygon(coords)
}
Expand Down Expand Up @@ -179,7 +179,7 @@ where
.collect()
}

fn create_line_type<T>(line_string: &geo_types::Line<T>) -> LineStringType
fn create_from_line_type<T>(line_string: &geo_types::Line<T>) -> LineStringType
where
T: Float,
{
Expand All @@ -189,31 +189,20 @@ where
]
}

fn create_triangle_type<T>(triangle: &geo_types::Triangle<T>) -> PolygonType
fn create_from_triangle_type<T>(triangle: &geo_types::Triangle<T>) -> PolygonType
where
T: Float,
{
create_polygon_type(&triangle.to_polygon())
}

fn create_rect_type<T>(rect: &geo_types::Rect<T>) -> PolygonType
fn create_from_rect_type<T>(rect: &geo_types::Rect<T>) -> PolygonType
where
T: Float,
{
create_polygon_type(&rect.to_polygon())
}

// fn create_geometrycollection_type<T>(
// gc: &geo_types::GeometryCollection<T>,
// ) -> Vec<geometry::Geometry>
// where
// T: Float,
// {
// gc.iter()
// .map(|geom| geometry::Geometry::new(geometry::Value::from(geom)))
// .collect()
// }

fn create_multi_line_string_type<T>(
multi_line_string: &geo_types::MultiLineString<T>,
) -> Vec<LineStringType>
Expand Down

0 comments on commit d2abdb0

Please sign in to comment.