-
-
Notifications
You must be signed in to change notification settings - Fork 474
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2231 from joto/new-attr-handling
Changed handling of object attributes in flex output
- Loading branch information
Showing
7 changed files
with
133 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
-- This config example file is released into the Public Domain. | ||
-- | ||
-- Most of the time we are only interested in nodes, ways, and relations that | ||
-- have tags. But we can also get the untagged ones if necessary by using | ||
-- the processing functions 'process_untagged_node', 'process_untagged_way', | ||
-- and 'process_untagged_relation', respectively. | ||
|
||
local nodes = osm2pgsql.define_node_table('nodes', { | ||
{ column = 'tags', type = 'jsonb' }, | ||
{ column = 'geom', type = 'point' }, | ||
}) | ||
|
||
local ways = osm2pgsql.define_way_table('ways', { | ||
{ column = 'tags', type = 'jsonb' }, | ||
{ column = 'geom', type = 'linestring' }, | ||
}) | ||
|
||
function osm2pgsql.process_node(object) | ||
nodes:insert({ | ||
tags = object.tags, | ||
geom = object:as_point(), | ||
}) | ||
end | ||
|
||
function osm2pgsql.process_untagged_node(object) | ||
nodes:insert({ | ||
geom = object:as_point(), | ||
}) | ||
end | ||
|
||
-- If you want to use the same function in both cases, that's also quite easy. | ||
-- For instance like this: | ||
|
||
local function do_way(object) | ||
ways:insert({ | ||
tags = object.tags, | ||
geom = object:as_linestring(), | ||
}) | ||
end | ||
|
||
osm2pgsql.process_way = do_way | ||
osm2pgsql.process_untagged_way = do_way | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters