GEOS Problem

classic Classic list List threaded Threaded
3 messages Options
ElRudi ElRudi
Reply | Threaded
Open this post in threaded view
|

GEOS Problem

Hi,

I get a compiler error in GEOS.cpp (Version 2.10 and 3.0.0RC2, Visual Studio 2017, Win10):

error C2664: "geos::geom::Polygon *geos::geom::GeometryFactory::createPolygon(const geos::geom::LinearRing &,const std::vector<geos::geom::LinearRing *,std::allocator<_Ty>> &) const" : converting argument 2 from "std::vector<geos::geom::Geometry *,std::allocator<_Ty>> *" to "std::vector<geos::geom::LinearRing *,std::allocator<_Ty>> *" not possible

With the following changes (geom::Geometry -> geom::LinearRing) i can build the code:

Line 144:     std::vector<geom::LinearRing*>* holes = poly->getHoles().size() > 0 ? new std::vector<geom::LinearRing*>() : 0L;
Line 154       holes->push_back((geom::LinearRing*) hole); //MR

I don't know if my changes are the problem, but i get a crash in osgearth_viewer boston.earth when i'm flying through the city with invalid this pointer. Call Stack:

geosd.dll!geos::geom::CoordinateSequence::size() Line 122 C++
geosd.dll!geos::geom::LineString::validateConstruction() Line 83 C++
geosd.dll!geos::geom::LineString::LineString(geos::geom::CoordinateSequence * newCoords, const geos::geom::GeometryFactory * factory) Line 95 C++
geosd.dll!geos::geom::GeometryFactory::createLineString(geos::geom::CoordinateSequence * newCoords) Line 626 C++
osgEarthd.dll!`anonymous namespace'::import(const osgEarth::Geometry * input, const geos::geom::GeometryFactory * f) Line 127 C++
osgEarthd.dll!osgEarth::Util::GEOSContext::importGeometry(const osgEarth::Geometry * input) Zeile Line C++
osgEarthd.dll!osgEarth::Geometry::crop(const osgEarth::Polygon * cropPoly, osg::ref_ptr<osgEarth::Geometry> & output) Line 247 C++
osgEarthd.dll!osgEarth::CropFilter::push(std::list<osg::ref_ptr<osgEarth::Feature>,std::allocator<osg::ref_ptr<osgEarth::Feature> > > & input, osgEarth::Util::FilterContext & context) Line 117 C++
osgEarthd.dll!osgEarth::Util::FeatureModelGraph::createStyleGroup(const osgEarth::Style & style, std::list<osg::ref_ptr<osgEarth::Feature>,std::allocator<osg::ref_ptr<osgEarth::Feature> > > & workingSet, const osgEarth::Util::FilterContext & contextPrototype, const osgDB::Options * readOptions, const osgEarth::Query & query) Line 1712 C++

My geos version in 3.8.1
remoe remoe
Reply | Threaded
Open this post in threaded view
|

Re: GEOS Problem

Hi, do you have see this:
https://github.com/gwaldron/osgearth/pull/1497
?
Remo Eichenberger, Switzerland
ElRudi ElRudi
Reply | Threaded
Open this post in threaded view
|

Re: GEOS Problem

This post was updated on .
Thanks, i took those changed (quite the same) but now it crashes again with stack overflow with endless loop of:
geosd.dll!geos::geom::LineString::clone() Line 227 C++
geosd.dll!geos::geom::LineString::~LineString() Line 48 C++
geosd.dll!geos::geom::LineString::LineString(const geos::geom::LineString & ls) Line 54 C++

Before the application crashes there are some warnings:

Warning Referenced::signalObserversAndDelete(,,) doing delete with _refCount=4294967295
Warning: deleting still referenced object 0000026D1B6E2590 of type 'class osg::Referenced * __ptr64'
         the final reference count was 4294967295, memory corruption possible.
Warning Referenced::signalObserversAndDelete(,,) doing delete with _refCount=4294967295
Warning: deleting still referenced object 0000026D1B4C9560 of type 'class osg::Referenced * __ptr64'
         the final reference count was 4294967295, memory corruption possible.
Warning Referenced::signalObserversAndDelete(,,) doing delete with _refCount=4294967295
Warning: deleting still referenced object 0000026D1B6E1F00 of type 'class osg::Referenced * __ptr64'
         the final reference count was 4294967295, memory corruption possible.


Back to geos-3.7.3 the crashes are gone.