| 1 |
|
| MODULE = Geo::Geos PACKAGE = Geo::Geos::GeometryFactory |
| 2 |
|
| PROTOTYPES: DISABLE |
| 3 |
|
| |
| 4 |
|
| GeometryFactory* create(SV* arg1 = NULL, SV* arg2 = NULL) { |
| 5 |
31 |
| GeometryFactory::Ptr ptr; |
| 6 |
31 |
| if (!arg1) { |
| 7 |
31 |
▶ | ptr = GeometryFactory::create(); |
Branch: 1 branch
| Branch | True | False | Total |
| ptr = GeometryFactory::create(); |
27 |
4 |
31 |
|
| 8 |
27 |
▶ | } |
Branch: 1 branch
| Branch | True | False | Total |
| } |
27 |
0 |
27 |
|
| 9 |
|
| else { |
| 10 |
|
| auto& pm = xs::in<PrecisionModel&>(arg1); |
| 11 |
4 |
▶ | if (arg2) { |
Branch: 1 branch
| Branch | True | False | Total |
| if (arg2) { |
4 |
0 |
4 |
|
| 12 |
4 |
▶ | int srid = SvIV(arg2); |
Branch: 1 branch
| Branch | True | False | Total |
| int srid = SvIV(arg2); |
3 |
1 |
4 |
|
| 13 |
3 |
▶ | ptr = GeometryFactory::create(&pm, srid); |
Branch: 1 branch
| Branch | True | False | Total |
| ptr = GeometryFactory::create(&pm, srid); |
3 |
0 |
3 |
|
| 14 |
3 |
▶ | } |
Branch: 1 branch
| Branch | True | False | Total |
| } |
3 |
0 |
3 |
|
| 15 |
|
| else ptr = GeometryFactory::create(&pm); |
| 16 |
1 |
▶ | } |
Branch: 1 branch
| Branch | True | False | Total |
| } |
1 |
0 |
1 |
|
| 17 |
|
| |
| 18 |
|
| if (ptr.get()) { |
| 19 |
31 |
▶ | /* steal pointer without destroying the factory */ |
Branch: 1 branch
| Branch | True | False | Total |
| /* steal pointer without destroying the factory */ |
31 |
0 |
31 |
|
| 20 |
|
| RETVAL = ptr.release(); |
| 21 |
31 |
| } |
| 22 |
|
| else throw ("unsupported arguments"); |
| 23 |
0 |
| } |
| 24 |
|
| |
| 25 |
|
| PrecisionModel* GeometryFactory::getPrecisionModel() { |
| 26 |
1 |
| auto pm = THIS->getPrecisionModel(); |
| 27 |
1 |
▶ | RETVAL = new PrecisionModel(*pm); |
Branch: 1 branch
| Branch | True | False | Total |
| RETVAL = new PrecisionModel(*pm); |
1 |
0 |
1 |
|
| 28 |
1 |
▶ | } |
Branch: 4 branches
| Branch | True | False | Total |
| } |
1 |
0 |
1 |
| } |
1 |
0 |
1 |
| } |
1 |
0 |
1 |
| } |
0 |
0 |
0 |
|
| 29 |
|
| |
| 30 |
4 |
▶ | int GeometryFactory::getSRID () |
Branch: 1 branch
| Branch | True | False | Total |
| int GeometryFactory::getSRID () |
0 |
4 |
4 |
|
| 31 |
|
| |
| 32 |
|
| GeometryCollection* GeometryFactory::createGeometryCollection() { |
| 33 |
1 |
| RETVAL = THIS->createGeometryCollection(); |
| 34 |
1 |
▶ | } |
Branch: 2 branches
| Branch | True | False | Total |
| } |
1 |
0 |
1 |
| } |
1 |
0 |
1 |
|
| 35 |
|
| |
| 36 |
|
| Point* GeometryFactory::createPoint(Sv arg1 = Sv{}, SV* arg2 = NULL) { |
| 37 |
35 |
| if (!arg1) RETVAL = THIS->createPoint(); |
| 38 |
35 |
▶ | else { |
Branch: 2 branches
| Branch | True | False | Total |
| else { |
1 |
34 |
35 |
| else { |
1 |
0 |
1 |
|
| 39 |
|
| if (!arg1.is_array_ref()) { |
| 40 |
34 |
▶ | Object obj {arg1}; |
Branch: 2 branches
| Branch | True | False | Total |
| Object obj {arg1}; |
34 |
0 |
34 |
| Object obj {arg1}; |
32 |
2 |
34 |
|
| 41 |
32 |
▶ | if (obj && obj.stash().name() == "Geo::Geos::Coordinate") { |
Branch: 1 branch
| Branch | True | False | Total |
| if (obj && obj.stash().name() == "Geo::Geos::Coordinate") { |
32 |
0 |
32 |
|
| 42 |
32 |
▶ | auto coord = xs::in<Coordinate*>(obj); |
Branch: 8 branches
| Branch | True | False | Total |
| auto coord = xs::in<Coordinate*>(obj); |
32 |
0 |
32 |
| auto coord = xs::in<Coordinate*>(obj); |
32 |
0 |
32 |
| auto coord = xs::in<Coordinate*>(obj); |
32 |
0 |
32 |
| auto coord = xs::in<Coordinate*>(obj); |
32 |
0 |
32 |
| auto coord = xs::in<Coordinate*>(obj); |
32 |
0 |
32 |
| auto coord = xs::in<Coordinate*>(obj); |
32 |
0 |
32 |
| auto coord = xs::in<Coordinate*>(obj); |
32 |
0 |
32 |
| auto coord = xs::in<Coordinate*>(obj); |
0 |
0 |
0 |
|
| 43 |
32 |
▶ | RETVAL = THIS->createPoint(*coord); |
Branch: 1 branch
| Branch | True | False | Total |
| RETVAL = THIS->createPoint(*coord); |
32 |
0 |
32 |
|
| 44 |
32 |
▶ | } |
Branch: 1 branch
| Branch | True | False | Total |
| } |
32 |
0 |
32 |
|
| 45 |
|
| else throw ("Object must be blessed into Geo::Geos::Coordinate"); |
| 46 |
0 |
| } |
| 47 |
32 |
| else { |
| 48 |
|
| if (!arg2) throw ("missing mandatory argument"); |
| 49 |
2 |
▶ | size_t dims = SvIV(arg2); |
Branch: 1 branch
| Branch | True | False | Total |
| size_t dims = SvIV(arg2); |
0 |
2 |
2 |
|
| 50 |
2 |
▶ | auto seq = Helper::convert_copy(*THIS, Array(arg1), dims); |
Branch: 1 branch
| Branch | True | False | Total |
| auto seq = Helper::convert_copy(*THIS, Array(arg1), dims); |
2 |
0 |
2 |
|
| 51 |
2 |
▶ | RETVAL = THIS->createPoint(seq); |
Branch: 2 branches
| Branch | True | False | Total |
| RETVAL = THIS->createPoint(seq); |
2 |
0 |
2 |
| RETVAL = THIS->createPoint(seq); |
2 |
0 |
2 |
|
| 52 |
2 |
▶ | } |
Branch: 1 branch
| Branch | True | False | Total |
| } |
2 |
0 |
2 |
|
| 53 |
|
| } |
| 54 |
|
| } |
| 55 |
|
| |
| 56 |
|
| MultiPoint* GeometryFactory::createMultiPoint(SV* arg1 = NULL, SV* arg2 = NULL) { |
| 57 |
13 |
| if (!arg1) RETVAL = THIS->createMultiPoint(); |
| 58 |
13 |
▶ | else { |
Branch: 2 branches
| Branch | True | False | Total |
| else { |
2 |
11 |
13 |
| else { |
2 |
0 |
2 |
|
| 59 |
|
| if (!arg2) throw ("missing mandatory argument"); |
| 60 |
11 |
▶ | size_t dims = SvIV(arg2); |
Branch: 1 branch
| Branch | True | False | Total |
| size_t dims = SvIV(arg2); |
0 |
11 |
11 |
|
| 61 |
11 |
▶ | auto seq = std::unique_ptr<CoordinateSequence>(Helper::convert_copy(*THIS, Array(arg1), dims)); |
Branch: 1 branch
| Branch | True | False | Total |
| auto seq = std::unique_ptr<CoordinateSequence>(Helper::convert_copy(*THIS, Array(arg1), dims)); |
11 |
0 |
11 |
|
| 62 |
11 |
▶ | RETVAL = THIS->createMultiPoint(*seq); |
Branch: 2 branches
| Branch | True | False | Total |
| RETVAL = THIS->createMultiPoint(*seq); |
11 |
0 |
11 |
| RETVAL = THIS->createMultiPoint(*seq); |
11 |
0 |
11 |
|
| 63 |
11 |
▶ | } |
Branch: 1 branch
| Branch | True | False | Total |
| } |
11 |
0 |
11 |
|
| 64 |
11 |
| } |
| 65 |
|
| |
| 66 |
|
| LineString* GeometryFactory::createLineString(SV* arg1 = NULL, SV* arg2 = NULL) { |
| 67 |
22 |
| if (!arg1) RETVAL = THIS->createLineString(); |
| 68 |
22 |
▶ | else { |
Branch: 2 branches
| Branch | True | False | Total |
| else { |
1 |
21 |
22 |
| else { |
1 |
0 |
1 |
|
| 69 |
|
| if (!arg2) throw ("missing argument"); |
| 70 |
21 |
▶ | size_t dims = SvIV(arg2); |
Branch: 1 branch
| Branch | True | False | Total |
| size_t dims = SvIV(arg2); |
0 |
21 |
21 |
|
| 71 |
21 |
▶ | auto seq = std::unique_ptr<CoordinateSequence>(Helper::convert_copy(*THIS, Array(arg1), dims)); |
Branch: 1 branch
| Branch | True | False | Total |
| auto seq = std::unique_ptr<CoordinateSequence>(Helper::convert_copy(*THIS, Array(arg1), dims)); |
21 |
0 |
21 |
|
| 72 |
21 |
▶ | RETVAL = THIS->createLineString(*seq); |
Branch: 2 branches
| Branch | True | False | Total |
| RETVAL = THIS->createLineString(*seq); |
21 |
0 |
21 |
| RETVAL = THIS->createLineString(*seq); |
21 |
0 |
21 |
|
| 73 |
21 |
▶ | } |
Branch: 1 branch
| Branch | True | False | Total |
| } |
21 |
0 |
21 |
|
| 74 |
21 |
| } |
| 75 |
|
| |
| 76 |
|
| MultiLineString* GeometryFactory::createMultiLineString(SV* arg1 = NULL) { |
| 77 |
3 |
| if (!arg1) RETVAL = THIS->createMultiLineString(); |
| 78 |
3 |
▶ | else { |
Branch: 2 branches
| Branch | True | False | Total |
| else { |
1 |
2 |
3 |
| else { |
1 |
0 |
1 |
|
| 79 |
|
| Array geometries(arg1); |
| 80 |
2 |
▶ | if (!geometries) throw ("unsupported argument"); |
Branch: 1 branch
| Branch | True | False | Total |
| if (!geometries) throw ("unsupported argument"); |
2 |
0 |
2 |
|
| 81 |
2 |
▶ | auto lines = Helper::convert_geometries(geometries); |
Branch: 1 branch
| Branch | True | False | Total |
| auto lines = Helper::convert_geometries(geometries); |
0 |
2 |
2 |
|
| 82 |
2 |
▶ | RETVAL = THIS->createMultiLineString(lines); |
Branch: 2 branches
| Branch | True | False | Total |
| RETVAL = THIS->createMultiLineString(lines); |
2 |
0 |
2 |
| RETVAL = THIS->createMultiLineString(lines); |
2 |
0 |
2 |
|
| 83 |
2 |
▶ | } |
Branch: 1 branch
| Branch | True | False | Total |
| } |
2 |
0 |
2 |
|
| 84 |
2 |
| } |
| 85 |
|
| |
| 86 |
|
| LinearRing* GeometryFactory::createLinearRing(SV* arg1 = NULL, SV* arg2 = NULL) { |
| 87 |
22 |
| if (!arg1) RETVAL = THIS->createLinearRing(); |
| 88 |
22 |
▶ | else { |
Branch: 2 branches
| Branch | True | False | Total |
| else { |
1 |
21 |
22 |
| else { |
1 |
0 |
1 |
|
| 89 |
|
| if (!arg2) throw ("missing argument"); |
| 90 |
21 |
▶ | size_t dims = SvIV(arg2); |
Branch: 1 branch
| Branch | True | False | Total |
| size_t dims = SvIV(arg2); |
0 |
21 |
21 |
|
| 91 |
21 |
▶ | auto seq = std::unique_ptr<CoordinateSequence>(Helper::convert_copy(*THIS, Array(arg1), dims)); |
Branch: 1 branch
| Branch | True | False | Total |
| auto seq = std::unique_ptr<CoordinateSequence>(Helper::convert_copy(*THIS, Array(arg1), dims)); |
21 |
0 |
21 |
|
| 92 |
21 |
▶ | RETVAL = THIS->createLinearRing(*seq); |
Branch: 2 branches
| Branch | True | False | Total |
| RETVAL = THIS->createLinearRing(*seq); |
21 |
0 |
21 |
| RETVAL = THIS->createLinearRing(*seq); |
21 |
0 |
21 |
|
| 93 |
21 |
▶ | } |
Branch: 1 branch
| Branch | True | False | Total |
| } |
21 |
0 |
21 |
|
| 94 |
21 |
| } |
| 95 |
|
| |
| 96 |
|
| geos::geom::Polygon* GeometryFactory::createPolygon(SV* arg1 = NULL, SV* arg2 = NULL) { |
| 97 |
16 |
| if (!arg1) RETVAL = THIS->createPolygon(); |
| 98 |
16 |
▶ | else { |
Branch: 2 branches
| Branch | True | False | Total |
| else { |
1 |
15 |
16 |
| else { |
1 |
0 |
1 |
|
| 99 |
|
| auto ring = xs::in<LinearRing*>(arg1); |
| 100 |
15 |
▶ | auto holes = Helper::convert_geometries(Array(arg2)); |
Branch: 1 branch
| Branch | True | False | Total |
| auto holes = Helper::convert_geometries(Array(arg2)); |
15 |
0 |
15 |
|
| 101 |
15 |
▶ | RETVAL = THIS->createPolygon(*ring, holes); |
Branch: 2 branches
| Branch | True | False | Total |
| RETVAL = THIS->createPolygon(*ring, holes); |
15 |
0 |
15 |
| RETVAL = THIS->createPolygon(*ring, holes); |
15 |
0 |
15 |
|
| 102 |
15 |
▶ | } |
Branch: 1 branch
| Branch | True | False | Total |
| } |
15 |
0 |
15 |
|
| 103 |
15 |
| } |
| 104 |
|
| |
| 105 |
|
| MultiPolygon* GeometryFactory::createMultiPolygon(SV* arg1 = NULL) { |
| 106 |
2 |
| if (!arg1) RETVAL = THIS->createMultiPolygon(); |
| 107 |
2 |
▶ | else { |
Branch: 2 branches
| Branch | True | False | Total |
| else { |
1 |
1 |
2 |
| else { |
1 |
0 |
1 |
|
| 108 |
|
| auto polygons = Helper::convert_geometries(Array(arg1)); |
| 109 |
1 |
▶ | RETVAL = THIS->createMultiPolygon(polygons); |
Branch: 2 branches
| Branch | True | False | Total |
| RETVAL = THIS->createMultiPolygon(polygons); |
1 |
0 |
1 |
| RETVAL = THIS->createMultiPolygon(polygons); |
1 |
0 |
1 |
|
| 110 |
1 |
▶ | } |
Branch: 1 branch
| Branch | True | False | Total |
| } |
1 |
0 |
1 |
|
| 111 |
1 |
| } |
| 112 |
|
| |
| 113 |
|
| Sv GeometryFactory::toGeometry(Envelope* env) { |
| 114 |
1 |
▶ | RETVAL = Helper::uplift(THIS->toGeometry(env)); |
Branch: 2 branches
| Branch | True | False | Total |
| RETVAL = Helper::uplift(THIS->toGeometry(env)); |
1 |
0 |
1 |
| RETVAL = Helper::uplift(THIS->toGeometry(env)); |
1 |
0 |
1 |
|
| 115 |
|
| } |
| 116 |
|
| |
| 117 |
|
| Sv GeometryFactory::createEmptyGeometry() { |
| 118 |
1 |
▶ | RETVAL = Helper::uplift(THIS->createEmptyGeometry()); |
Branch: 2 branches
| Branch | True | False | Total |
| RETVAL = Helper::uplift(THIS->createEmptyGeometry()); |
1 |
0 |
1 |
| RETVAL = Helper::uplift(THIS->createEmptyGeometry()); |
1 |
0 |
1 |
|
| 119 |
|
| } |
| 120 |
|
| |
| 121 |
0 |
▶ | int CLONE_SKIP (...) { PERL_UNUSED_VAR(items); RETVAL = 1; } |
Branch: 1 branch
| Branch | True | False | Total |
| int CLONE_SKIP (...) { PERL_UNUSED_VAR(items); RETVAL = 1; } |
0 |
0 |
0 |
|
| 122 |
|
| |
| 123 |
|
| BOOT { |
| 124 |
46 |
▶ | xs::exp::autoexport(Stash(__PACKAGE__)); |
Branch: 2 branches
| Branch | True | False | Total |
| xs::exp::autoexport(Stash(__PACKAGE__)); |
46 |
0 |
46 |
| xs::exp::autoexport(Stash(__PACKAGE__)); |
46 |
0 |
46 |
|
| 125 |
|
| } |