1 /**********************************************************************
3 * GEOS - Geometry Engine Open Source
4 * http://geos.osgeo.org
6 * Copyright (C) 2011 Sandro Santilli <strk@keybit.net>
8 * This is free software; you can redistribute and/or modify it under
9 * the terms of the GNU Lesser General Public Licence as published
10 * by the Free Software Foundation.
11 * See the COPYING file for more information.
13 **********************************************************************/
16 // Test Suite for geos::algorithm::InteriorPointArea
20 #include <geos/geom/Coordinate.h>
21 #include <geos/algorithm/InteriorPointArea.h>
22 #include <geos/io/WKTReader.h>
23 #include <geos/geom/Geometry.h>
35 // dummy data, not used
36 struct test_interiorpointarea_data
{
37 typedef geos::geom::Geometry Geometry
;
38 typedef geos::geom::Coordinate Coordinate
;
39 typedef geos::algorithm::InteriorPointArea InteriorPointArea
;
41 geos::io::WKTReader reader
;
42 std::auto_ptr
<Geometry
> geom
;
44 test_interiorpointarea_data()
49 typedef test_group
<test_interiorpointarea_data
> group
;
50 typedef group::object object
;
52 group
test_interiorpointarea_group("geos::algorithm::InteriorPointArea");
58 // http://trac.osgeo.org/geos/ticket/475
59 // This is a test for a memory leak more than anything else
62 void object::test
<1>()
66 // this polygon is a typical hourglass-shape with a self intersection
68 geom
.reset( reader
.read("POLYGON((6 54, 15 54, 6 47, 15 47, 6 54))") );
73 InteriorPointArea
interior_builder(geom
.get());
74 interior_builder
.getInteriorPoint(centroid
);