| 76 | } |
| 77 | |
| 78 | void Polygon::init() |
| 79 | { |
| 80 | m_pd.reset(new PrivateData()); |
| 81 | |
| 82 | // If the handle was null, we need to create an empty polygon. |
| 83 | if (!m_geom) |
| 84 | { |
| 85 | m_geom.reset(new OGRPolygon()); |
| 86 | return; |
| 87 | } |
| 88 | |
| 89 | OGRwkbGeometryType t = m_geom->getGeometryType(); |
| 90 | |
| 91 | if (!(t == wkbPolygon || |
| 92 | t == wkbMultiPolygon || |
| 93 | t == wkbPolygon25D || |
| 94 | t == wkbMultiPolygon25D)) |
| 95 | { |
| 96 | throw pdal::pdal_error("pdal::Polygon() cannot construct geometry " |
| 97 | "because OGR geometry is not Polygon or MultiPolygon."); |
| 98 | } |
| 99 | } |
| 100 | |
| 101 | void Polygon::initGrids() const |
| 102 | { |