Skip to content

Commit

Permalink
Added wkt read feature to polyhedral surfaces
Browse files Browse the repository at this point in the history
  • Loading branch information
Siddharth-coder13 committed Feb 14, 2021
1 parent 030d240 commit b551f6d
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 30 deletions.
5 changes: 5 additions & 0 deletions include/boost/geometry/algorithms/clear.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,11 @@ struct clear<Geometry, ring_tag>
: detail::clear::collection_clear<Geometry>
{};

// Clear for Polyhedral surface
template <typename Geometry>
struct clear<Geometry, polyhedral_surface_tag>
: detail::clear::no_action<Geometry>
{};

// Polygon can (indirectly) use std for clear
template <typename Polygon>
Expand Down
21 changes: 0 additions & 21 deletions include/boost/geometry/geometries/PolyhedralSurface.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,28 +102,7 @@ struct Poly_ring_type
>::ring_type& type;
};

/*template
<
typename Ring,
template<typename, typename> class Container,
template<typename> class Allocator
>
struct ring_type
<
model::PolyhedralSurface
<
Ring,
Container, Allocator
>
>
{
typedef typename model::PolyhedralSurface
<
Ring,
Container, Allocator
>::ring_type& type;

};*/


} // namespace traits
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@ class PolyhedralSurface
BOOST_CONCEPT_USAGE(PolyhedralSurface)
{

Geometry* polyhedralSurface = 0;
ring_type* ring = 0;

}
#endif

Expand Down
17 changes: 11 additions & 6 deletions include/boost/geometry/io/wkt/read.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -462,13 +462,18 @@ struct polyhderal_surface_parser
static inline void apply(tokenizer::iterator& it,
tokenizer::iterator const& end,
std::string const& wkt,
PolyhedralSurface& ring)
PolyhedralSurface& Poly)
{
handle_open_parenthesis(it, end, wkt);
int i = 0;
typename ring_type<PolyhedralSurface>::type ring;
while(it != end && *it != ")"){
//appender::apply(it, end, wkt, ring);
i++;
appender::apply(it, end, wkt, ring);
if(it!=end && *it == ",")
{
//skip after ring is parsed
++it;
}

}
handle_close_parenthesis(it, end, wkt);
}
Expand Down Expand Up @@ -584,7 +589,7 @@ struct geometry_parser
{
static inline void apply(std::string const& wkt, Geometry& geometry)
{
//geometry::clear(geometry);
geometry::clear(geometry);

tokenizer tokens(wkt, boost::char_separator<char>(" ", ",()"));
tokenizer::iterator it, end;
Expand Down Expand Up @@ -933,7 +938,7 @@ struct read_wkt<segment_tag, Segment>
template <typename Geometry>
inline void read_wkt(std::string const& wkt, Geometry& geometry)
{
//geometry::concepts::check<Geometry>();
geometry::concepts::check<Geometry>();
dispatch::read_wkt<typename tag<Geometry>::type, Geometry>::apply(wkt, geometry);
}

Expand Down

0 comments on commit b551f6d

Please sign in to comment.