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

Paul Norman notifications at github.com
Thu Oct 8 08:09:38 UTC 2015


> +    {
> +        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;
> +    }
> +
> +    // standard polygon - reproject rings individually, then assemble polygon and
> +    // compute area.

Does reprojecting `poly` and using `poly->getArea()` work?

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


More information about the Tile-serving mailing list