void makePolyWithHole(Geography &geo) { geo.addEmptyRing() << GeographyPoint(0, 0) << GeographyPoint(1, 0) << GeographyPoint(1, 1) << GeographyPoint(0, 1) << GeographyPoint(0, 0); geo.addEmptyRing() << GeographyPoint(0.1, 0.1) << GeographyPoint(0.1, 0.9) << GeographyPoint(0.9, 0.9) << GeographyPoint(0.9, 0.1) << GeographyPoint(0.1, 0.1); }
/** * Return a point which is this point translated by the * given offset. * * This is mostly used in testing. We want to move points slightly, * so that we can test approximate equality of polygons. */ GeographyPoint translate(const GeographyPoint &offset) { return GeographyPoint(getLongitude() + offset.getLongitude(), getLatitude() + offset.getLatitude()); }