[Tile-serving] [osm2pgsql] Add area reprojection facility (#454)

Paul Norman notifications at github.com
Sat Oct 3 00:06:03 UTC 2015


> +        return geom->getArea();
> +    }
> +
> +    // MultiPolygon - return sum of individual areas
> +    if (const geos::geom::MultiPolygon* multi = dynamic_cast<const geos::geom::MultiPolygon *>(geom))
> +    {
> +        double area = 0.0;
> +        for (std::size_t i=0; i<multi->getNumGeometries(); i++)
> +        {
> +            area += getArea(multi->getGeometryN(i));
> +        }
> +        return area;
> +    }
> +
> +    const geos::geom::Polygon *poly = dynamic_cast<const geos::geom::Polygon *>(geom);
> +    if (!poly) return 0.0;

```c++
if (!poly) {
    return 0.0;
}
```

---
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/osm2pgsql/pull/454/files#r41079976
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/tile-serving/attachments/20151002/25d5082e/attachment.html>


More information about the Tile-serving mailing list