[Tile-serving] [openstreetmap/osm2pgsql] Multi-backend and boundaries (#593)
Paul Norman
notifications at github.com
Thu Jun 16 22:29:03 UTC 2016
I'm trying to create a linestring representation of boundaries with the multi-backend, like the pgsql backend, where the relation goes into the line table as a `ST_LineString`
```
gis=# SELECT osm_id, ST_GeometryType(way), boundary FROM planet_osm_polygon WHERE osm_id = -1852574;
osm_id | st_geometrytype | boundary
----------+-----------------+----------------
-1852574 | ST_Polygon | administrative
(1 row)
gis=# SELECT osm_id, ST_GeometryType(way), boundary FROM planet_osm_line WHERE osm_id = -1852574;
osm_id | st_geometrytype | boundary
----------+-----------------+----------------
-1852574 | ST_LineString | administrative
(1 row)
```
This is done by `m_tagtransform->filter_rel_member_tags` setting `make_boundary` and then
```cpp
// If the tag transform said the polygon looked like a boundary we want to make that as well
// If we are making a boundary then also try adding any relations which form complete rings
// The linear variants will have already been processed above
if (make_boundary) {
wkbs = builder.build_polygons(xnodes, m_options.enable_multi, id);
for (const auto& wkb: wkbs) {
expire.from_wkb(wkb.geom.c_str(), -id);
if ((wkb.area > 0.0) && m_enable_way_area) {
snprintf(tmp, sizeof(tmp), "%g", wkb.area);
outtags.push_override(tag_t("way_area", tmp));
}
m_tables[t_poly]->write_row(-id, outtags, wkb.geom);
}
}
```
The equivalent part of the code for the multi-backend, `output_multi_t::process_relation`, does not make use of `make_boundary`
---
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/osm2pgsql/issues/593
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/tile-serving/attachments/20160616/36ea8896/attachment.html>
More information about the Tile-serving
mailing list