[OSM-dev] osm2pgsql polygon handling semantic?

Sven Geggus lists at fuchsschwanzdomain.de
Tue Oct 20 18:52:24 UTC 2015


Paul Norman <penorman at mac.com> wrote:

> Assuming it matches some tag with a column, yes. In a case where it has 
> only a key with polygon,nocolumn (or phstore), it wouldn't make it into 
> the line table or polygon table.

This does not seem to be true.

Artificial waterway.osm
--cut--
<?xml version='1.0' encoding='UTF-8'?>
<osm version='0.6' upload='false' generator='JOSM'>
  <node id='117' visible='true' version='1' lat='49.16700513707' lon='8.12518444414' />
  <node id='118' visible='true' version='1' lat='49.13091446704' lon='8.08644347959' />
  <node id='120' visible='true' version='1' lat='49.11055388122' lon='8.05181140521' />
  <node id='122' visible='true' version='1' lat='49.08710965227' lon='8.04476759347' />
  <node id='124' visible='true' version='1' lat='49.04634415702' lon='8.0512244209' />
  <way id='119' visible='true' version='1'>
    <nd ref='117' />
    <nd ref='118' />
    <nd ref='120' />
    <nd ref='122' />
    <nd ref='124' />
    <tag k='waterway' v='river' />
    <tag k='width' v='30' />
  </way>
</osm>
--cut--

Using the following style:

--cut--
node,way   waterway     text         polygon,nocolumn

node,way   z_order      int4         linear # This is calculated during import
way        way_area     real                # This is calculated during import
--cut--

Using the following command...

osm2pgsql -S waterway.style -d imposm waterway.osm --hstore --hstore-match-only

... this will end up in a 1 line planet_osm_line table.

Sven

-- 
Exploits and holes are a now a necessary protection against large
corporate interests. (Alan Cox)

/me is giggls at ircnet, http://sven.gegg.us/ on the Web



More information about the dev mailing list