All.

 

Please try the file in the attachment with geos-3.2.0. It crashes. Who can tell 
me what is wrong ? Thanks.
                                          
_________________________________________________________________
Hotmail: Trusted email with Microsoft’s powerful SPAM protection.
https://signup.live.com/signup.aspx?id=60969
#include "geos.h"

bool Contain(double *PH_x, double *PH_y, size_t PH_Num)
{
        GeometryFactory GF;

        geos::geom::Polygon *PG1;

        std::vector<Geometry*> holes;

        CoordinateArraySequence *PH=new CoordinateArraySequence();

        for(size_t i=0; i<PH_Num; i++)
        {
                PH->add(Coordinate(PH_x[i], PH_y[i], 0));
        }

        PH->add(Coordinate(PH_x[0], PH_y[0], 0));

//      std::cout<<PH->getSize()<<std::endl;

//      std::cout<<PH->toString()<<std::endl;

        LinearRing *HoleRing=GF.createLinearRing(*PH);

        std::cout<<HoleRing->getNumPoints()<<std::endl; 
         
        std::cout<<HoleRing->isSimple()<<std::endl;
         
        std::cout<<HoleRing->isClosed()<<std::endl;

        PG1=GF.createPolygon(*HoleRing, holes);

        GF.destroyGeometry(HoleRing);

        if(PH) 
        {
                delete PH;

                PH=NULL;
        }

        GF.destroyGeometry(PG1);

        return true;
};

void main()
{       
        double x[3];
        x[0]=0;
        x[1]=1;
        x[2]=1;

        double y[3];
        y[0]=0;
        y[1]=0;
        y[2]=1;

        Contain(x, y, 3);
};
_______________________________________________
geos-devel mailing list
geos-devel@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/geos-devel

Reply via email to