[Tile-serving] [osm2pgsql] Use the polygon flag from the tagtransforms to change multi-backend (#471)

Sarah Hoffmann notifications at github.com
Mon Oct 26 20:05:28 UTC 2015


> -                copy_to_table(id, wkt->geom.c_str(), outtags);
> +                if (polygon) {
> +                    // The way is required to be a polygon
> +                    if (boost::starts_with(wkt->geom, "POLYGON") || boost::starts_with(wkt->geom, "MULTIPOLYGON")) {
> +                        m_expire->from_nodes_poly(m_way_helper.node_cache, id);
> +                        copy_to_table(id, wkt->geom.c_str(), outtags);
> +                    }
> +                } else {
> +                    // The way is not required to be a polygon
> +                    copy_to_table(id, wkt->geom.c_str(), outtags);
> +                    if (boost::starts_with(wkt->geom, "POLYGON") || boost::starts_with(wkt->geom, "MULTIPOLYGON")) {
> +                        m_expire->from_nodes_poly(m_way_helper.node_cache, id);
> +                    } else {
> +                        m_expire->from_nodes_line(m_way_helper.node_cache);
> +                    }
> +                }

Can this be moved in a function to avoid the code duplication?

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


More information about the Tile-serving mailing list