Subject: Re: [geometry] Integrating OGR library with Boost.Geometry
From: Menelaos Karavelas (menelaos.karavelas_at_[hidden])
Date: 2015-05-26 08:34:57
On 26/05/2015 03:22 Î¼Î¼, Eric MSP Veith wrote:
> Hi Menelaos,
> On Tuesday 26 May 2015 15:09:39, Menelaos Karavelas
> <menelaos.karavelas_at_[hidden]> wrote:
> xample, dereferrencing returns a value rather than a
>> What is your linestring's value type and reference type? In the
>> implementation of the segment iterator it is assumed that, when
>> dereferrencing an iterator on the points of the linestring, a reference
>> (or const reference) is returned. If your linestring iterator returns
>> point values then this could indeed be a problem.
> My linestring iterator indeed returns "Value" and not "Value &" when
> dereferencing. This is the code:
> Value dereference() const
> assert(m_currentPointIndex < m_collection->getNumPoints());
> OGRPoint point;
> m_collection->getPoint(m_currentPointIndex, &point);
> return point;
> As you might guess from the invocation, the OGR API only allows "copy-out"
> access to the points of a linestring, no reference.
> I just checked the header of the OGRPoint class and saw that there's no
> OGRPoint(const OGRPoint &p) copy constructor defined. Meh, I guess I have the
> culprint now.
> What would you advise as the best course of action --- a wrapper class? (I've
> solid C++ skills, but am by no means an expert, and therefore grateful for
> hints regarding the best solution.)
Could you please replace
boost/geometry/iterators/detail/segment_iterator/value_type.hpp with the
It should work in your setting. If it does I will submit a patch (it
will go under review, etc.) so that you can have the correct version in
the develop branch and the next BG release.
> Geometry mailing list
Geometry list run by mateusz at loskot.net