reformat lua
This commit is contained in:
parent
7e57824d9f
commit
72195d3b4c
1 changed files with 120 additions and 121 deletions
|
@ -1,5 +1,4 @@
|
||||||
-- special config to calcule pseudo-tags / "Brouter project"
|
-- special config to calcule pseudo-tags / "Brouter project"
|
||||||
-- EssBee version 08/05/2023
|
|
||||||
|
|
||||||
local srid = 3857
|
local srid = 3857
|
||||||
|
|
||||||
|
@ -75,11 +74,11 @@ function has_area_tags(tags)
|
||||||
|
|
||||||
return tags.place
|
return tags.place
|
||||||
or tags.population
|
or tags.population
|
||||||
end
|
end
|
||||||
|
|
||||||
function osm2pgsql.process_node(object)
|
function osm2pgsql.process_node(object)
|
||||||
|
|
||||||
if (object.tags.place == 'city' or object.tags.place == 'town' or object.tags.place == 'municipality') and has_area_tags(object.tags) then
|
if (object.tags.place == 'city' or object.tags.place == 'town' or object.tags.place == 'municipality') and has_area_tags(object.tags) then
|
||||||
tables.cities:insert({
|
tables.cities:insert({
|
||||||
osm_id = object.id,
|
osm_id = object.id,
|
||||||
name = object.tags.name,
|
name = object.tags.name,
|
||||||
|
@ -105,7 +104,7 @@ if (object.tags.place == 'city' or object.tags.place == 'town' or object.tags.pl
|
||||||
end
|
end
|
||||||
|
|
||||||
function osm2pgsql.process_way(object)
|
function osm2pgsql.process_way(object)
|
||||||
local way_type = object:grab_tag('type')
|
local way_type = object:grab_tag('type')
|
||||||
|
|
||||||
if ( object.tags.natural == 'water') or (object.tags.landuse ~= nil ) or (object.tags.leisure ~= nil ) then
|
if ( object.tags.natural == 'water') or (object.tags.landuse ~= nil ) or (object.tags.leisure ~= nil ) then
|
||||||
tables.polygons:insert({
|
tables.polygons:insert({
|
||||||
|
@ -153,7 +152,7 @@ function osm2pgsql.process_relation(object)
|
||||||
way = object:as_multipolygon()
|
way = object:as_multipolygon()
|
||||||
})
|
})
|
||||||
|
|
||||||
-- if (relation_type == 'boundary') and has_area_tags(object.tags) then
|
-- if (relation_type == 'boundary') and has_area_tags(object.tags) then
|
||||||
if (relation_type == 'boundary') then
|
if (relation_type == 'boundary') then
|
||||||
tables.cities_rel:insert({
|
tables.cities_rel:insert({
|
||||||
reltype = object.tags.relation_type,
|
reltype = object.tags.relation_type,
|
||||||
|
|
Loading…
Reference in a new issue