|
Geometry : |
Subject: Re: [geometry] Buffer algorithm
From: joan ABADIE (joan.abadie_at_[hidden])
Date: 2013-10-22 10:38:48
Hi Barend,
I have looked at test_buffer.hpp.
It gave me some tips on how to compute a buffer with buffer_inserter
but I can't figure out how to define 2 templates : JoinStrategy and
EndStrategy.
Could you help me to define them ?
Here is an easy code sample to go from a linestring to a buffered polygon.
typedef boost::geometry::model::d2::point_xy<double,
boost::geometry::cs::cartesian> Point_type;
typedef boost::geometry::model::polygon<Point_type>
Polygon_type;///CCW closed cartesian polygon
typedef boost::geometry::model::linestring<Point_type>
LineString_type;///CCW closed cartesian polygon
typedef boost::geometry::coordinate_type<LineString_type>::type coordinate_type;
typedef Point_type point_type;
typedef Point_type output_point_type;
LineString_type boostTrajectory; //my line string to buffer
//to be initialized here
boost::geometry::strategy::buffer::distance_asymmetric
<
coordinate_type
>
distance_strategy(bufferDistance, bufferDistance);
std::vector<Polygon_type> buffered; //buffered result
boost::geometry::buffer_inserter<Polygon_type>(boostTrajectory,
std::back_inserter(buffered),
distance_strategy,
* ???join_strategy???,*
* ???end_strategy???*
);
regards.
Joan Abadie
2013/10/21 Barend Gehrels <barend_at_[hidden]>
> Hi Joan,
>
> joan wrote On 21-10-2013 16:08:
>
> Hello,
>>
>> I also need the feature to have a buffer feature in order to go from a
>> linestring to a polygon.
>> I have read many posts on the subject but I couldn't manage to compute a
>> buffer using boost 1.54 or trunk.
>>
>> When will the feature be planned ?
>> Is there some hacks (using buffer_inserter ...) that enable this computing
>> in the trunk ?
>>
>>
> Sure, in trunk it is possible, using extensions. The best "example" is the
> testcode in test_buffer.hpp
>
> Let me know if I can help more, I did plan to work in this in the near
> future again.
>
> It is not yet ready, there are some issues, you may encounter them, but
> depending on your cases it might be useful for you.
>
> I cannot yet say when it will be in Release.
>
> Regards, Barend
>
>
> ______________________________**_________________
> Geometry mailing list
> Geometry_at_[hidden]
> http://lists.boost.org/**mailman/listinfo.cgi/geometry
>
Geometry list run by mateusz at loskot.net