[Tile-serving] [osm2pgsql] Incorrect multi backend linestring geoms (#274)

Paul Norman notifications at github.com
Mon Feb 2 22:20:49 UTC 2015


A shorter testcase
```json
[
  {
    "name": "test_line",
    "type": "line",
    "tagtransform": "multi_line.lua",
    "tagtransform-node-function": "drop_all",
    "tagtransform-way-function": "test_ways",
    "tagtransform-relation-function": "drop_all",
    "tagtransform-relation-member-function": "drop_all",
    "tags": [
      {"name": "foo", "type": "text"}
    ]
  }
]
```

multi_line.lua
```lua
function drop_all (...)
  return 1, {}
end

-- A generic way to process ways, given a function which determines if tags are interesting
-- Takes an optional function to process tags. Always says it's a polygon if there's matching tags
function test_ways (kv, num_keys)
  tags = {}
  return 0, tags, 1, 0
end
```

```xml
<?xml version='1.0' encoding='UTF-8'?>
<osm version="0.6" generator="hand">
<!-- nodes in the order 11 12
                        1   2
-->
<node id="1" lat="1" lon="1" version="1" timestamp="2010-01-01T00:00:00Z" changeset="1"/>
<node id="2" lat="1" lon="1.001" version="1" timestamp="2010-01-01T00:00:00Z" changeset="1"/>
<node id="11" lat="1.001" lon="1.001" version="1" timestamp="2010-01-01T00:00:00Z" changeset="1"/>
<node id="12" lat="1.001" lon="1.001" version="1" timestamp="2010-01-01T00:00:00Z" changeset="1"/>
<way id="1" version="1" timestamp="2010-01-01T00:00:00Z" changeset="1">
<nd ref="1"/>
<nd ref="2"/>
</way>
<way id="2" version="1" timestamp="2010-01-01T00:00:00Z" changeset="1">
<nd ref="11"/>
<nd ref="12"/>
</way>
</osm>
```

With `./osm2pgsql -O multi -S multi_line.style.json multi_line.osm -l` to import I get these results from psql
```
select osm_id,foo,st_astext(way) from test_line;
 osm_id | foo |        st_astext
--------+-----+-------------------------
      1 |     | LINESTRING(1 1,1.001 1)
(1 row)
```

---
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/osm2pgsql/issues/274#issuecomment-72550880
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/tile-serving/attachments/20150202/c8b3b7bc/attachment-0001.html>


More information about the Tile-serving mailing list