예제 #1
0
 test_capigeosnode_data()
     : geom1_(0), geom2_(0), w_(0)
 {
     initGEOS(notice, notice);
     w_ = GEOSWKTWriter_create();
     GEOSWKTWriter_setTrim(w_, 1);
 }       
예제 #2
0
 test_capigeosdistance_data()
     : geom1_(nullptr), geom2_(nullptr), geom3_(nullptr), w_(nullptr)
 {
     initGEOS(notice, notice);
     w_ = GEOSWKTWriter_create();
     GEOSWKTWriter_setTrim(w_, 1);
 }
예제 #3
0
 test_capioffsetcurve_data()
     : geom1_(0), geom2_(0), wkt_(0)
 {
     initGEOS(notice, notice);
     wktw_ = GEOSWKTWriter_create();
     GEOSWKTWriter_setTrim(wktw_, 1);
 }       
예제 #4
0
 test_capigeosminimumrectangle_data()
     : input_(nullptr), wkt_(nullptr)
 {
     initGEOS(notice, notice);
     wktw_ = GEOSWKTWriter_create();
     GEOSWKTWriter_setTrim(wktw_, 1);
     GEOSWKTWriter_setRoundingPrecision(wktw_, 8);
 }
예제 #5
0
 test_capiunaryunion_data()
     : geom1_(0), geom2_(0)
 {
     initGEOS(notice, notice);
     wktw_ = GEOSWKTWriter_create();
     GEOSWKTWriter_setTrim(wktw_, 1);
     GEOSWKTWriter_setOutputDimension(wktw_, 3);
 }       
 test_capigeosclipbyrect_data()
   : geom1_(0), geom2_(0), geom3_(0), w_(0)
 {
   initGEOS(notice, notice);
   w_ = GEOSWKTWriter_create();
   GEOSWKTWriter_setTrim(w_, 1);
   GEOSWKTWriter_setRoundingPrecision(w_, 8);
 }     
예제 #7
0
    void object::test<13>()
    {
        GEOSWKTWriter *writer = GEOSWKTWriter_create();

        ensure( "getOutputDimension_1", 
                GEOSWKTWriter_getOutputDimension(writer) == 2 );

        GEOSWKTWriter_setTrim( writer, 1 );
        GEOSWKTWriter_setOutputDimension( writer, 3 );
        ensure( "getOutputDimension_2", 
                GEOSWKTWriter_getOutputDimension(writer) == 3 );

        test_writer_wkt(writer, "POINT Z (10 13 3)");
        GEOSWKTWriter_destroy( writer );
    }
예제 #8
0
Handle<Value> Geometry::ToWKT(const Arguments& args)
{
    Local<Value> wktjs;
    GEOSWKTWriter *wkt_writer = GEOSWKTWriter_create();
    Geometry *geom = ObjectWrap::Unwrap<Geometry>(args.This());
    HandleScope scope;
    if (geom->geos_geom_ != NULL) {
        char *wkt = GEOSWKTWriter_write(wkt_writer, geom->geos_geom_);
        wktjs = String::New(wkt);
        GEOSFree(wkt);
    } else {
        wktjs = String::New("");
    }
    return scope.Close(wktjs);
}