[Tile-serving] [osm2pgsql] Add area reprojection facility (#454)
Paul Norman
notifications at github.com
Fri Oct 9 10:56:00 UTC 2015
> + reprojection = r;
> +}
> +
> +/**
> + * Computes area of given polygonal geometry.
> + * \return the area in projected units, or in EPSG 3857 if area reprojection is enabled
> + */
> +double geometry_builder::getArea(const geos::geom::Geometry *geom) const
> +{
> + // reprojection is not necessary, or has not been asked for.
> + if (!reprojection) {
> + return geom->getArea();
> + }
> +
> + // MultiPolygon - return sum of individual areas
> + if (const geos::geom::MultiPolygon* multi = dynamic_cast<const geos::geom::MultiPolygon *>(geom)) {
this is the multipolygon case, https://github.com/openstreetmap/osm2pgsql/pull/454/files#diff-853d1c6f0a63324f82abcb98373e8bc5 only contains a simple closed way.
---
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/osm2pgsql/pull/454/files#r41618755
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/tile-serving/attachments/20151009/d76f9d77/attachment.html>
More information about the Tile-serving
mailing list