Merge pull request #556 from afischerdev/jdbc-import

Works for me, but performance test for planet processing still running. Maybe I'll change to prelaod Database Info and matching against a memory map, but I first merge and do eventual changes in a new PR
This commit is contained in:
abrensch 2023-05-28 14:05:25 +02:00 committed by GitHub
commit 624edc63ee
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 2243 additions and 12 deletions

View file

@ -12,6 +12,12 @@ import java.io.DataOutputStream;
import java.io.File; import java.io.File;
import java.io.FileOutputStream; import java.io.FileOutputStream;
import java.io.IOException; import java.io.IOException;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.HashMap;
import java.util.Map; import java.util.Map;
import btools.expressions.BExpressionContextNode; import btools.expressions.BExpressionContextNode;
@ -33,6 +39,19 @@ public class OsmCutter extends MapCreatorBase {
public RestrictionCutter restrictionCutter; public RestrictionCutter restrictionCutter;
public NodeFilter nodeFilter; public NodeFilter nodeFilter;
Connection conn = null;
PreparedStatement psAllTags = null;
ResultSet rsBrouter = null;
int cntHighways = 0;
int cntWayModified = 0;
String jdbcurl;
Map<String, String> databaseField2Tag;
Map<String, Integer> databaseFieldsFound;
public static void main(String[] args) throws Exception { public static void main(String[] args) throws Exception {
System.out.println("*** OsmCutter: cut an osm map in node-tiles + a way file"); System.out.println("*** OsmCutter: cut an osm map in node-tiles + a way file");
if (args.length != 6 && args.length != 7) { if (args.length != 6 && args.length != 7) {
@ -55,9 +74,6 @@ public class OsmCutter extends MapCreatorBase {
private BExpressionContextWay _expctxWay; private BExpressionContextWay _expctxWay;
private BExpressionContextNode _expctxNode; private BExpressionContextNode _expctxNode;
// private BExpressionContextWay _expctxWayStat;
// private BExpressionContextNode _expctxNodeStat;
public void process(File lookupFile, File outTileDir, File wayFile, File relFile, File resFile, File profileFile, File mapFile) throws Exception { public void process(File lookupFile, File outTileDir, File wayFile, File relFile, File resFile, File profileFile, File mapFile) throws Exception {
if (!lookupFile.exists()) { if (!lookupFile.exists()) {
throw new IllegalArgumentException("lookup-file: " + lookupFile + " does not exist"); throw new IllegalArgumentException("lookup-file: " + lookupFile + " does not exist");
@ -70,10 +86,6 @@ public class OsmCutter extends MapCreatorBase {
meta.readMetaData(lookupFile); meta.readMetaData(lookupFile);
_expctxWay.parseFile(profileFile, "global"); _expctxWay.parseFile(profileFile, "global");
// _expctxWayStat = new BExpressionContextWay( null );
// _expctxNodeStat = new BExpressionContextNode( null );
this.outTileDir = outTileDir; this.outTileDir = outTileDir;
if (!outTileDir.isDirectory()) if (!outTileDir.isDirectory())
throw new RuntimeException("out tile directory " + outTileDir + " does not exist"); throw new RuntimeException("out tile directory " + outTileDir + " does not exist");
@ -117,6 +129,9 @@ public class OsmCutter extends MapCreatorBase {
return "records read: " + recordCnt + " nodes=" + nodesParsed + " ways=" + waysParsed + " rels=" + relsParsed + " changesets=" + changesetsParsed; return "records read: " + recordCnt + " nodes=" + nodesParsed + " ways=" + waysParsed + " rels=" + relsParsed + " changesets=" + changesetsParsed;
} }
public void setJdbcUrl(String url) {
this.jdbcurl = url;
}
@Override @Override
public void nextNode(NodeData n) throws Exception { public void nextNode(NodeData n) throws Exception {
@ -164,6 +179,78 @@ public class OsmCutter extends MapCreatorBase {
} }
} }
private void generateTagsFromDatabase(long osm_id, Map<String, String> map) {
if (jdbcurl == null) return;
try {
// is the database allready connected?
if (conn == null) {
String sql_all_tags = "SELECT * from all_tags where losmid = ?";
System.out.println("OsmCutter start connection to the database........" + jdbcurl);
conn = DriverManager.getConnection(jdbcurl);
psAllTags = conn.prepareStatement(sql_all_tags);
databaseField2Tag = new HashMap<>();
databaseField2Tag.put("noise_class", "estimated_noise_class");
databaseField2Tag.put("river_class", "estimated_river_class");
databaseField2Tag.put("forest_class", "estimated_forest_class");
databaseField2Tag.put("town_class", "estimated_town_class");
databaseField2Tag.put("traffic_class", "estimated_traffic_class");
databaseFieldsFound = new HashMap<>();
for (String key : databaseField2Tag.keySet()) {
databaseFieldsFound.put(key, 0);
}
System.out.println("OsmCutter connect to the database ok........");
}
for (Map.Entry<String, String> e : map.entrySet()) {
if (e.getKey().equals("highway")) {
cntHighways = cntHighways + 1;
psAllTags.setLong(1, osm_id);
// process the results
rsBrouter = psAllTags.executeQuery();
if (rsBrouter.next()) {
cntWayModified = cntWayModified + 1;
for (String key : databaseField2Tag.keySet()) {
if (rsBrouter.getString(key) != null) {
map.put(databaseField2Tag.get(key), rsBrouter.getString(key));
databaseFieldsFound.put(key, databaseFieldsFound.get(key) + 1);
}
}
}
if ((cntHighways % 100000) == 0) {
String out = "HW processed=" + cntHighways + " HW modifs=" + cntWayModified;
for (String key : databaseFieldsFound.keySet()) {
out += " " + key + "=" + databaseFieldsFound.get(key);
}
System.out.println(out);
}
return;
}
}
} catch (SQLException g) {
System.err.format(" OsmCutter execute sql .. SQL State: %s\n%s\n", g.getSQLState(), g.getMessage());
System.exit(1);
} catch (Exception f) {
f.printStackTrace();
System.exit(1);
}
}
@Override @Override
public void nextWay(WayData w) throws Exception { public void nextWay(WayData w) throws Exception {
@ -173,13 +260,14 @@ public class OsmCutter extends MapCreatorBase {
// encode tags // encode tags
if (w.getTagsOrNull() == null) return; if (w.getTagsOrNull() == null) return;
generateTagsFromDatabase(w.wid, w.getTagsOrNull());
generatePseudoTags(w.getTagsOrNull()); generatePseudoTags(w.getTagsOrNull());
int[] lookupData = _expctxWay.createNewLookupData(); int[] lookupData = _expctxWay.createNewLookupData();
for (String key : w.getTagsOrNull().keySet()) { for (String key : w.getTagsOrNull().keySet()) {
String value = w.getTag(key); String value = w.getTag(key);
_expctxWay.addLookupValue(key, value.replace(' ', '_'), lookupData); _expctxWay.addLookupValue(key, value.replace(' ', '_'), lookupData);
// _expctxWayStat.addLookupValue( key, value, null );
} }
w.description = _expctxWay.encode(lookupData); w.description = _expctxWay.encode(lookupData);

View file

@ -12,8 +12,8 @@ import java.io.File;
public class OsmFastCutter extends MapCreatorBase { public class OsmFastCutter extends MapCreatorBase {
public static void main(String[] args) throws Exception { public static void main(String[] args) throws Exception {
System.out.println("*** OsmFastCutter: cut an osm map in node-tiles + way-tiles"); System.out.println("*** OsmFastCutter: cut an osm map in node-tiles + way-tiles");
if (args.length != 11 && args.length != 12) { if (args.length != 11 && args.length != 12 && args.length != 13) {
String common = "java OsmFastCutter <lookup-file> <node-dir> <way-dir> <node55-dir> <way55-dir> <border-file> <out-rel-file> <out-res-file> <filter-profile> <report-profile> <check-profile>"; String common = "java OsmFastCutter <lookup-file> <node-dir> <way-dir> <node55-dir> <way55-dir> <border-file> <out-rel-file> <out-res-file> <filter-profile> <report-profile> <check-profile> <map-file> [jdbc-url]";
System.out.println("usage: bzip2 -dc <map> | " + common); System.out.println("usage: bzip2 -dc <map> | " + common);
System.out.println("or : " + common + " <inputfile> "); System.out.println("or : " + common + " <inputfile> ");
@ -33,12 +33,14 @@ public class OsmFastCutter extends MapCreatorBase {
, new File(args[9]) , new File(args[9])
, new File(args[10]) , new File(args[10])
, args.length > 11 ? new File(args[11]) : null , args.length > 11 ? new File(args[11]) : null
, args.length > 12 ? args[12] : null
); );
} }
public static void doCut(File lookupFile, File nodeDir, File wayDir, File node55Dir, File way55Dir, File borderFile, File relFile, File resFile, File profileAll, File profileReport, File profileCheck, File mapFile) throws Exception { public static void doCut(File lookupFile, File nodeDir, File wayDir, File node55Dir, File way55Dir, File borderFile, File relFile, File resFile, File profileAll, File profileReport, File profileCheck, File mapFile, String jdbcurl) throws Exception {
// **** run OsmCutter **** // **** run OsmCutter ****
OsmCutter cutter = new OsmCutter(); OsmCutter cutter = new OsmCutter();
if (jdbcurl != null) cutter.setJdbcUrl(jdbcurl);
// ... inject WayCutter // ... inject WayCutter
cutter.wayCutter = new WayCutter(); cutter.wayCutter = new WayCutter();

View file

@ -35,7 +35,7 @@ public class MapcreatorTest {
File profileCheck = new File(profileDir, "softaccess.brf"); File profileCheck = new File(profileDir, "softaccess.brf");
File borderFile = new File(tmpdir, "bordernids.dat"); File borderFile = new File(tmpdir, "bordernids.dat");
new OsmFastCutter().doCut(lookupFile, nodes, ways, nodes55, ways55, borderFile, relFile, resFile, profileAll, profileReport, profileCheck, mapFile); new OsmFastCutter().doCut(lookupFile, nodes, ways, nodes55, ways55, borderFile, relFile, resFile, profileAll, profileReport, profileCheck, mapFile, null);
// run PosUnifier // run PosUnifier

View file

@ -0,0 +1,954 @@
-- calculation of new tags (estimated_noise_class, estimated_river_class,estimated_forest_class, estimated_town_class, estimated_traffic_class)
-- formatted by https://sqlformat.darold.net/
SET client_encoding TO UTF8;
SELECT
NOW();
-- create new tables for tuning
SELECT
OSM_ID::bigint,
HIGHWAY,
WATERWAY,
WIDTH,
MAXSPEED,
CASE WHEN MAXSPEED IS NULL THEN
0
WHEN NOT (MAXSPEED ~ '^[0-9\.]+$') THEN
0
WHEN MAXSPEED::numeric > '105' THEN
1
WHEN MAXSPEED::numeric > '75' THEN
2
ELSE
3
END AS MAXSPEED_CLASS,
ST_BUFFER (WAY, 50) AS WAY INTO TABLE OSM_LINE_BUF_50
FROM
LINES
WHERE
HIGHWAY IS NOT NULL
OR WATERWAY IN ('river', 'canal');
SELECT
NOW();
-- modify "way" by large waterways !!" (example Rhein ==> width = 400 ....) enlarge a bit the "50 meter" buffer
UPDATE
osm_line_buf_50
SET
way = st_buffer (way, (width::numeric / 10))
WHERE
waterway = 'river'
AND width IS NOT NULL
AND (width ~ '^[0-9\.]+$')
AND width::numeric > 15;
SELECT
osm_id::bigint,
leisure,
landuse,
p.natural,
p.water,
ST_Buffer (way, 50) AS way INTO TABLE osm_poly_buf_50
FROM
polygons p
WHERE
-- do not consider small surfaces
st_area (p.way) > 1000
AND p.natural IN ('water')
OR (p.landuse IN ('forest', 'allotments', 'flowerbed', 'orchard', 'vineyard', 'recreation_ground', 'village_green')
OR p.leisure IN ('park', 'nature_reserve'));
SELECT
osm_id::bigint,
leisure,
landuse,
p.natural,
p.water,
ST_Buffer (way, 70) AS way INTO TABLE osm_poly_buf_120
FROM
osm_poly_buf_50 p;
SELECT
NOW();
-- create indexes
CREATE INDEX osm_line_buf_50_idx ON public.osm_line_buf_50 USING gist (way) WITH (fillfactor = '100');
ANALYZE;
SELECT
osm_id,
highway,
way,
ST_Expand (way, 15000) way2,
ST_Centroid (way) way0 INTO TABLE primsecter15k
FROM
lines
WHERE
highway IN ('primary', 'primary_link', 'secondary', 'secondary_link', 'tertiary');
CREATE INDEX primsecter15k_idx2 ON public.primsecter15k USING gist (way2) WITH (fillfactor = '100');
CREATE INDEX primsecter15k_idx1 ON public.primsecter15k USING gist (way) WITH (fillfactor = '100');
CREATE INDEX primsecter15k_idx0 ON public.primsecter15k USING gist (way0) WITH (fillfactor = '100');
SELECT
NOW();
-- create a new "town" table based on cities_rel (with a valid/numeric population) AND fetch by need the population from the cities table)
-- clean the cities table (when population is null or population is not numeric or unusable)
SELECT
a.name,
REPLACE(a.population, '.', '')::bigint population,
a.way INTO cities_ok
FROM
cities a
WHERE
a.population IS NOT NULL
AND (a.population ~ '^[0-9\.]+$')
AND a.place IN ('town', 'city', 'municipality');
-- clean the cities_rel table (when population is not numeric or unusable)
SELECT
a.name AS name,
a.admin_level,
CASE WHEN a.population IS NOT NULL
AND (a.population ~ '^[0-9\.]+$') THEN
REPLACE(a.population, '.', '')::bigint
ELSE
NULL
END AS population,
a.way INTO cities_rel_ok
FROM
cities_rel a;
-- select town + population + way starting with cities_rel_ok ....
SELECT
a.name AS name,
CASE WHEN a.population IS NOT NULL THEN
a.population
WHEN b.population IS NOT NULL THEN
b.population
ELSE
NULL
END AS population,
a.way INTO cities_intermed1
FROM
cities_rel_ok a
LEFT OUTER JOIN cities_ok b ON a.name = b.name
WHERE
a.admin_level = '8'
ORDER BY
a.name;
-- select town + population + way starting with cities_ok .... (to catch specials cases as ex. "Berlin" which is tagged with "admin_level=4")
SELECT
a.name AS name,
a.population,
CASE WHEN b.way IS NOT NULL THEN
b.way
-- stupid case (ex. "Ebingen": no relation available, so no administrattive surface ... create a dummy area with 2000 m radius !
ELSE
st_buffer (a.way, 2000)
END AS way INTO cities_intermed2
FROM
cities_ok a
LEFT OUTER JOIN cities_rel_ok b ON a.name = b.name
AND b.way IS NOT NULL
AND b.admin_level = '8'
ORDER BY
name;
SELECT
name,
MAX(population) AS population,
way,
st_centroid (way) AS way0 INTO cities_all
FROM ((
SELECT
*
FROM
cities_intermed1
WHERE
population IS NOT NULL)
UNION (
SELECT
*
FROM
cities_intermed2)) a
WHERE
population IS NOT NULL
-- and population > 20000
GROUP BY
name,
way
ORDER BY
population;
SELECT
NOW();
-- create tags for noise
-- create raw data
-- when several highways-segments are producing noise, aggregate the noises using the "ST_Union" of the segments!
-- (better as using "sum" or "max" that do not deliver good factors)
SELECT
m.osm_id losmid,
m.highway lhighway,
q.highway AS qhighway,
q.maxspeed_class,
CASE WHEN q.highway IN ('motorway', 'motorway_link', 'trunk', 'trunk_link')
AND q.maxspeed_class < 1.1 THEN
st_area (st_intersection (m.way, ST_Union (q.way))) / st_area (m.way)
WHEN q.highway IN ('motorway', 'motorway_link', 'trunk', 'trunk_link') THEN
st_area (st_intersection (m.way, ST_Union (q.way))) / (1.5 * st_area (m.way))
WHEN q.highway IN ('primary', 'primary_link')
AND q.maxspeed_class < 2.1 THEN
st_area (st_intersection (m.way, ST_Union (q.way))) / (2 * st_area (m.way))
WHEN q.highway IN ('primary', 'primary_link') THEN
st_area (st_intersection (m.way, ST_Union (q.way))) / (3 * st_area (m.way))
WHEN q.highway IN ('secondary')
AND q.maxspeed_class < 2.1 THEN
st_area (st_intersection (m.way, ST_Union (q.way))) / (3 * st_area (m.way))
WHEN q.highway IN ('secondary') THEN
st_area (st_intersection (m.way, ST_Union (q.way))) / (5 * st_area (m.way))
END AS noise_factor INTO TABLE noise_tmp
FROM
osm_line_buf_50 AS m
INNER JOIN osm_line_buf_50 AS q ON ST_Intersects (m.way, q.way)
WHERE
m.highway IS NOT NULL
AND q.highway IN ('motorway', 'motorway_link', 'trunk', 'trunk_link', 'primary', 'primary_link', 'secondary')
GROUP BY
losmid,
lhighway,
m.way,
q.highway,
q.maxspeed_class
ORDER BY
noise_factor DESC;
SELECT
NOW();
-- aggregate data:
-- on "maxspeed_class take the sum of several highways (having different maxspeed-class) union is then not done, but not very frequent
-- on "phighway" take the sum of several highways (as probably several highways are producing noise at the point!
SELECT
losmid,
lhighway,
SUM(noise_factor) AS sum_noise_factor INTO TABLE noise_tmp2
FROM
noise_tmp
GROUP BY
losmid,
lhighway
ORDER BY
sum_noise_factor DESC;
-- create the noise classes
SELECT
losmid,
CASE WHEN y.sum_noise_factor < 0.1 THEN
'1'
WHEN y.sum_noise_factor < 0.25 THEN
'2'
WHEN y.sum_noise_factor < 0.4 THEN
'3'
WHEN y.sum_noise_factor < 0.55 THEN
'4'
WHEN y.sum_noise_factor < 0.8 THEN
'5'
ELSE
'6'
END AS noise_class INTO TABLE noise_tags
FROM
noise_tmp2 y
WHERE
y.sum_noise_factor > 0.01;
SELECT
COUNT(*)
FROM
noise_tags;
SELECT
noise_class,
COUNT(*)
FROM
noise_tags
GROUP BY
noise_class
ORDER BY
noise_class;
DROP TABLE noise_tmp2;
SELECT
NOW();
-- create tags for river
SELECT
xid,
SUM(water_river_see) AS river_see INTO TABLE river_tmp
FROM (
SELECT
m.osm_id AS xid,
st_area (st_intersection (m.way, ST_Union (q.way))) / st_area (m.way) AS water_river_see
FROM
osm_line_buf_50 AS m
INNER JOIN osm_poly_buf_120 AS q ON ST_Intersects (m.way, q.way)
WHERE
m.highway IS NOT NULL
-- and st_area(q.way) > 90746 !!! filter on very small surfaces was set above !!!!!!!!!
AND q.natural IN ('water')
AND (q.water IS NULL
OR q.water NOT IN ('wastewater'))
GROUP BY
m.osm_id,
m.way
UNION
SELECT
m.osm_id AS xid,
st_area (st_intersection (m.way, ST_Union (q.way))) / st_area (m.way) AS water_river_see
FROM
osm_line_buf_50 AS m
INNER JOIN osm_line_buf_50 AS q ON ST_Intersects (m.way, q.way)
WHERE
m.highway IS NOT NULL
AND q.waterway IN ('river', 'canal')
GROUP BY
m.osm_id,
m.way) AS abcd
GROUP BY
xid
ORDER BY
river_see DESC;
SELECT
y.xid losmid,
CASE WHEN y.river_see < 0.17 THEN
'1'
WHEN y.river_see < 0.35 THEN
'2'
WHEN y.river_see < 0.57 THEN
'3'
WHEN y.river_see < 0.85 THEN
'4'
WHEN y.river_see < 1 THEN
'5'
ELSE
'6'
END AS river_class INTO TABLE river_tags
FROM
river_tmp y
WHERE
y.river_see > 0.05;
SELECT
COUNT(*)
FROM
river_tags;
SELECT
river_class,
COUNT(*)
FROM
river_tags
GROUP BY
river_class
ORDER BY
river_class;
SELECT
NOW();
-- create tags for forest
SELECT
m.osm_id,
m.highway,
st_area (st_intersection (m.way, ST_Union (q.way))) / st_area (m.way) AS green_factor INTO TABLE forest_tmp
FROM
osm_line_buf_50 AS m
INNER JOIN osm_poly_buf_50 AS q ON ST_Intersects (m.way, q.way)
WHERE
m.highway IS NOT NULL
AND ((q.landuse IN ('forest', 'allotments', 'flowerbed', 'orchard', 'vineyard', 'recreation_ground', 'village_green'))
OR q.leisure IN ('garden', 'park', 'nature_reserve'))
GROUP BY
m.osm_id,
m.highway,
m.way
ORDER BY
green_factor DESC;
--
SELECT
y.osm_id losmid,
CASE WHEN y.green_factor < 0.1 THEN
NULL
WHEN y.green_factor < 0.3 THEN
'1'
WHEN y.green_factor < 0.6 THEN
'2'
WHEN y.green_factor < 0.9 THEN
'3'
WHEN y.green_factor < 1 THEN
'4'
WHEN y.green_factor < 1.3 THEN
'5'
ELSE
'6'
END AS forest_class INTO TABLE forest_tags
FROM
forest_tmp y
WHERE
y.green_factor > 0.1;
SELECT
COUNT(*)
FROM
forest_tags;
SELECT
forest_class,
COUNT(*)
FROM
forest_tags
GROUP BY
forest_class
ORDER BY
forest_class;
SELECT
NOW();
-- create "town" tags
-- get the highways which intersect the town
SELECT
m.osm_id losmid,
m.highway lhighway,
CASE WHEN q.population::decimal > '2000000' THEN
1
WHEN q.population::decimal > '1000000' THEN
0.8
WHEN q.population::decimal > '400000' THEN
0.6
WHEN q.population::decimal > '150000' THEN
0.4
WHEN q.population::decimal > '80000' THEN
0.2
ELSE
0.1
END AS town_factor INTO TABLE town_tmp
FROM
osm_line_buf_50 AS m
INNER JOIN cities_all AS q ON ST_Intersects (m.way, q.way)
WHERE
m.highway IS NOT NULL
AND q.population > '50000'
ORDER BY
town_factor DESC;
--
SELECT
losmid,
CASE WHEN y.town_factor = 0.1 THEN
'1'
WHEN y.town_factor = 0.2 THEN
'2'
WHEN y.town_factor = 0.4 THEN
'3'
WHEN y.town_factor = 0.6 THEN
'4'
WHEN y.town_factor = 0.8 THEN
'5'
ELSE
'6'
END AS town_class INTO TABLE town_tags
FROM (
SELECT
losmid,
MAX(town_factor) AS town_factor
FROM
town_tmp y
GROUP BY
losmid) y;
SELECT
COUNT(*)
FROM
town_tags;
SELECT
town_class,
COUNT(*)
FROM
town_tags
GROUP BY
town_class
ORDER BY
town_class;
--
-- substract the ways from town with a green tag (because administrative surface are some times too large)
--
DELETE FROM town_tags
WHERE losmid IN (
SELECT
losmid
FROM
forest_tags);
DELETE FROM town_tags
WHERE losmid IN (
SELECT
losmid
FROM
river_tags);
SELECT
COUNT(*)
FROM
town_tags;
SELECT
town_class,
COUNT(*)
FROM
town_tags
GROUP BY
town_class
ORDER BY
town_class;
SELECT
NOW();
-------------------------------------------
-- create tags for TRAFFIC
-----------------------------------------
-- OSM data used to calculate/estimate the traffic:
-- population of towns (+ distance from position to the towns)
-- industrial areas (landuse=industrial) (+ surface of the areas and distance from position)
-- motorway density (traffic on motorways decreases traffic on primary/secondary/tertiary) calculated on grid
-- highway density (traffic decreases when more primary/secondary/tertiary highways are available) calculated on grid
-- exceptions: near junctions between motorways and primary/secondary/tertiary the traffic increases on the primary/secondary/tertiary..
-- mountain-ranges (high peaks) traffic is generally on highways in such regions higher as only generated by local population or industrial areas
-- calculate traffic from the population (for each segment of type primary secondary tertiary)
-- SUM of (population of each town < 100 km) / ( town-radius + 2500 + dist(segment-position to the town) ** 2 )
-- town-radius is calculated as sqrt(population)
SELECT
NOW();
SELECT
m.osm_id losmid,
m.highway lhighway,
CASE WHEN m.highway = 'tertiary' THEN
SUM(10000 * q.population::numeric / POWER(((8 * SQRT(q.population::numeric)) + 500 + ST_Distance (m.way0, q.way0)), 2) * 0.4)
WHEN m.highway IN ('secondary', 'secondary_link') THEN
SUM(10000 * q.population::numeric / POWER(((8 * SQRT(q.population::numeric)) + 500 + ST_Distance (m.way0, q.way0)), 2) * 0.6)
ELSE
SUM(10000 * q.population::numeric / POWER(((8 * SQRT(q.population::numeric)) + 500 + ST_Distance (m.way0, q.way0)), 2))
END AS populate_factor INTO TABLE traffic_tmp
FROM
primsecter15k AS m
INNER JOIN cities_all AS q ON ST_DWithin (m.way0, q.way0, (5000 + (100000 * q.population / (q.population + 10000))))
WHERE
m.highway IS NOT NULL
--and m.highway in ('primary','primary_link','secondary', 'secondary_link', 'tertiary')
AND q.population > 200
GROUP BY
m.osm_id,
m.highway,
m.way
ORDER BY
populate_factor;
SELECT
NOW();
-- prepare some special tables
-- the intersections motorway_link with primary/secondary/tertiary deliver the motorway acccesses....
SELECT
m.osm_id losmid,
m.highway,
m.way,
ST_Expand (m.way, 1000) way2,
ST_Expand (m.way, 2000) way3 INTO TABLE motorway_access
FROM
lines AS m
INNER JOIN lines AS q ON ST_Intersects (m.way, q.way)
WHERE
q.highway IN ('motorway_link', 'trunk_link')
AND m.highway IN ('primary', 'secondary', 'tertiary')
GROUP BY
m.osm_id,
m.highway,
m.way;
CREATE INDEX motorway_access_idx ON public.motorway_access USING gist (way2) WITH (fillfactor = '100');
SELECT
NOW();
-- find out all the primary/secondary/tertiary within 1000 m and 2000 m from a motorway access
SELECT
NOW();
SELECT
m.osm_id losmid,
SUM(st_length (q.way) / (10000)) motorway_factor INTO TABLE motorway_access_1000
FROM
lines AS m
INNER JOIN motorway_access AS q ON ST_Intersects (m.way, q.way2)
WHERE
m.highway IN ('primary', 'primary_link', 'secondary', 'secondary_link', 'tertiary')
GROUP BY
m.osm_id,
m.way
ORDER BY
motorway_factor;
SELECT
NOW();
SELECT
m.osm_id losmid,
SUM(st_length (q.way) / (10000)) motorway_factor INTO TABLE motorway_access_2000
FROM
lines AS m
INNER JOIN motorway_access AS q ON ST_Intersects (m.way, q.way3)
WHERE
m.highway IN ('primary', 'primary_link', 'secondary', 'secondary_link', 'tertiary')
GROUP BY
m.osm_id,
m.way
ORDER BY
motorway_factor;
SELECT
NOW();
--
-- special regions: mountain_range with "peaks" ==> few highways ==> higher traffic !!!
-- calculate the "peak_density"
SELECT
NOW();
SELECT
m.osm_id losmid,
COUNT(q.*) AS peak_cnt,
SUM(q.ele::decimal) peak_sum_ele INTO TABLE peak_density
FROM
primsecter15k AS m
INNER JOIN peak AS q ON ST_Intersects (m.way2, q.way)
WHERE (q.ele ~ '^[0-9\.]+$')
AND q.ele::decimal > 400
GROUP BY
m.osm_id,
m.way
ORDER BY
peak_cnt DESC;
SELECT
NOW();
--
-- traffic due to industrial parcs ...
--
SELECT
NOW();
SELECT
name,
way,
ST_Centroid (way) way0,
st_area (way)
area,
SQRT(st_area (way)) sqrt_area INTO industri
FROM
polygons
WHERE
landuse = 'industrial'
AND st_area (way) > 20000;
SELECT
NOW();
SELECT
m.osm_id losmid,
m.highway lhighway,
CASE WHEN m.highway = 'tertiary' THEN
SUM(area / POWER((sqrt_area + 500 + ST_Distance (m.way0, q.way0)), 2) * 0.6)
WHEN m.highway IN ('secondary', 'secondary_link') THEN
SUM(area / POWER((sqrt_area + 500 + ST_Distance (m.way0, q.way0)), 2) * 0.8)
ELSE
SUM(area / POWER((sqrt_area + 500 + ST_Distance (m.way0, q.way0)), 2))
END AS industrial_factor INTO industri_tmp
FROM
primsecter15k AS m
INNER JOIN industri AS q ON ST_dwithin (m.way0, q.way0, 20000)
GROUP BY
m.osm_id,
m.highway,
m.way
ORDER BY
industrial_factor;
SELECT
NOW();
-- create a grid to allow a fast calculation for highway_density and motorway_density
CREATE OR REPLACE FUNCTION generate_grid (bound_polygon geometry, grid_step integer, srid integer DEFAULT 2180)
RETURNS TABLE (
id bigint,
geom geometry)
LANGUAGE plpgsql
AS $function$
DECLARE
Xmin int;
Xmax int;
Ymax int;
Ymin int;
query_text text;
BEGIN
Xmin := FLOOR(ST_XMin (bound_polygon));
Xmax := CEIL(ST_XMax (bound_polygon));
Ymin := FLOOR(ST_YMin (bound_polygon));
Ymax := CEIL(ST_YMax (bound_polygon));
query_text := 'select row_number() over() id, st_makeenvelope(s1, s2, s1+$5, s2+$5, $6) geom
from generate_series($1, $2+$5, $5) s1, generate_series ($3, $4+$5, $5) s2';
RETURN QUERY EXECUTE query_text
USING Xmin, Xmax, Ymin, Ymax, grid_step, srid;
END;
$function$;
CREATE TABLE grid1 AS
SELECT
id,
geom
FROM
generate_grid((ST_GeomFromText('POLYGON((0 9000000, 18000000 9000000, 18000000 -9000000, 0 -9000000, 0 9000000))')),10000,3857);
CREATE TABLE grid2 AS
SELECT
id,
geom
FROM
generate_grid((ST_GeomFromText('POLYGON((0 9000000, -18000000 9000000, -18000000 -9000000, 0 -9000000, 0 9000000))')),10000,3857);
SELECT
geom INTO TABLE grid
FROM ((
SELECT
geom
FROM
grid1)
UNION (
SELECT
geom
FROM
grid2)) a;
-- GRID HIGHWAY_DENSITY
SELECT
NOW();
SELECT
SUM(st_length (q.way) / (10000)) highway_factor,
m.geom way INTO TABLE grid_highway_density
FROM
lines AS q
INNER JOIN grid AS m ON ST_Intersects (q.way, m.geom)
WHERE
q.highway IN ('primary', 'primary_link', 'secondary', 'secondary_link', 'tertiary')
GROUP BY
m.geom
ORDER BY
highway_factor;
SELECT
NOW();
-- GRID MOTORWAY_DENSITY
SELECT
NOW();
SELECT
SUM(st_length (q.way) / (10000)) motorway_factor,
m.geom way INTO TABLE grid_motorway_density
FROM
lines AS q
INNER JOIN grid AS m ON ST_Intersects (q.way, m.geom)
WHERE
q.highway IN ('motorway', 'motorway_link', 'trunk', 'trunk_link')
GROUP BY
m.geom
ORDER BY
motorway_factor;
SELECT
NOW();
-- CREATE INDEX grid_idx ON public.grid USING gist (geom) WITH (fillfactor='100');
CREATE INDEX grid_hwd_idx ON public.grid_highway_density USING gist (way) WITH (fillfactor = '100');
CREATE INDEX grid_mwd_idx ON public.grid_motorway_density USING gist (way) WITH (fillfactor = '100');
-- collect all exceptions on 1 table
SELECT
NOW();
SELECT
y.osm_id losmid,
CASE WHEN q.motorway_factor IS NULL THEN
0
ELSE
q.motorway_factor
END AS motorway_factor,
CASE WHEN x.peak_sum_ele IS NULL THEN
0
WHEN x.peak_sum_ele > 500000 THEN
4
ELSE
x.peak_sum_ele / 125000
END AS peak_sum_ele,
CASE WHEN z.highway_factor IS NULL THEN
0
ELSE
z.highway_factor
END AS highway_factor,
CASE WHEN w.industrial_factor IS NULL THEN
0
WHEN w.industrial_factor > 1 THEN
(1500 * 50)
ELSE
(w.industrial_factor * 1500 * 50)
END AS industrial_factor INTO TABLE except_all_tmp
FROM
lines y
LEFT OUTER JOIN grid_motorway_density AS q ON st_dwithin (q.way, y.way, 5500)
LEFT OUTER JOIN peak_density AS x ON y.osm_id = x.losmid
LEFT OUTER JOIN industri_tmp AS w ON y.osm_id = w.losmid
LEFT OUTER JOIN grid_highway_density AS z ON st_dwithin (z.way, y.way, 5500)
WHERE
y.highway IN ('primary', 'primary_link', 'secondary', 'secondary_link', 'tertiary');
SELECT
NOW();
SELECT
losmid,
peak_sum_ele,
AVG(highway_factor) highway_factor,
AVG(motorway_factor) motorway_factor,
industrial_factor INTO TABLE except_all
FROM
except_all_tmp
GROUP BY
losmid,
peak_sum_ele,
industrial_factor;
SELECT
NOW();
-- Do not apply the positiv effect of "motorway density" in proximity of motorway accesses!!!!
UPDATE
except_all
SET
motorway_factor = 0
WHERE
losmid IN (
SELECT
losmid
FROM
motorway_access_2000);
-- quite direct at motorway accesses set a negativ effect !!!!
UPDATE
except_all
SET
motorway_factor = - 15
WHERE
losmid IN (
SELECT
losmid
FROM
motorway_access_1000);
SELECT
NOW();
-- class calculation with modifications using peaks, motorway_density and highway_density...
--
SELECT
y.losmid::bigint,
CASE WHEN ((y.populate_factor * 1200 * (1 + q.peak_sum_ele)) + q.industrial_factor) / ((30 + q.motorway_factor) * (50 + q.highway_factor)) < 6 THEN
'1'
WHEN ((y.populate_factor * 1200 * (1 + q.peak_sum_ele)) + q.industrial_factor) / ((30 + q.motorway_factor) * (50 + q.highway_factor)) < 10 THEN
'2'
WHEN ((y.populate_factor * 1200 * (1 + q.peak_sum_ele)) + q.industrial_factor) / ((30 + q.motorway_factor) * (50 + q.highway_factor)) < 19 THEN
'3'
WHEN ((y.populate_factor * 1200 * (1 + q.peak_sum_ele)) + q.industrial_factor) / ((30 + q.motorway_factor) * (50 + q.highway_factor)) < 35 THEN
'4'
WHEN ((y.populate_factor * 1200 * (1 + q.peak_sum_ele)) + q.industrial_factor) / ((30 + q.motorway_factor) * (50 + q.highway_factor)) < 70 THEN
'5'
ELSE
'6'
END AS traffic_class INTO TABLE traffic_tags
FROM
traffic_tmp y
LEFT OUTER JOIN except_all AS q ON y.losmid = q.losmid
ORDER BY
traffic_class DESC;
SELECT
NOW();
--statistics
SELECT
traffic_class,
COUNT(losmid) cnt
FROM
traffic_tags
GROUP BY
traffic_class
ORDER BY
traffic_class;
--
-- put all tags together in 1 table (1 "direct" access per way in mapcreator)
--
SELECT
losmid::bigint AS losmid,
noise_class,
river_class,
forest_class,
town_class,
traffic_class INTO TABLE all_tags
FROM
river_tags
NATURAL
FULL OUTER JOIN noise_tags
NATURAL
FULL OUTER JOIN forest_tags
NATURAL
FULL OUTER JOIN town_tags
NATURAL
FULL OUTER JOIN traffic_tags
ORDER BY
losmid;
CREATE INDEX all_tags_ind ON all_tags (losmid, noise_class, river_class, forest_class, town_class, traffic_class) WITH (fillfactor = '100');
ANALYSE;
SELECT
NOW();

View file

@ -0,0 +1,169 @@
-- special config to calcule pseudo-tags / "Brouter project"
local srid = 3857
-- 3857 SHOULD BE USED here for distance calculation ... (not srid = 4326 !)
-- https://gis.stackexchange.com/questions/48949/epsg-3857-or-4326-for-web-mapping
local tables = {}
tables.lines = osm2pgsql.define_way_table('lines', {
{ column = 'name', type = 'text' },
{ column = 'osm_id', type = 'text' },
{ column = 'highway', type = 'text' },
{ column = 'maxspeed', type = 'text' },
{ column = 'waterway', type = 'text' },
{ column = 'width', type = 'text' },
{ column = 'way', type = 'linestring', projection = srid, not_null = true },
})
tables.polygons = osm2pgsql.define_area_table('polygons', {
{ column = 'osm_id', type = 'text' },
{ column = 'type', type = 'text' },
{ column = 'boundary', type = 'text' },
{ column = 'name', type = 'text' },
{ column = 'place', type = 'text' },
{ column = 'population', type = 'text' },
{ column = 'landuse', type = 'text' },
{ column = 'leisure', type = 'text' },
{ column = 'natural', type = 'text' },
{ column = 'water', type = 'text' },
{ column = 'way', type = 'geometry', projection = srid, not_null = true },
})
tables.cities = osm2pgsql.define_node_table('cities', {
{ column = 'name', type = 'text' },
{ column = 'place', type = 'text' },
{ column = 'admin_level', type = 'text' },
{ column = 'osm_id', type = 'text' },
{ column = 'population', type = 'text' },
{ column = 'way', type = 'geometry', projection = srid, not_null = true },
})
-- create a table for cities from special relation
tables.cities_rel = osm2pgsql.define_relation_table('cities_rel', {
{ column = 'reltype', type = 'text' },
{ column = 'admin_level', type = 'text' },
{ column = 'boundary', type = 'text' },
{ column = 'name', type = 'text' },
{ column = 'place', type = 'text' },
{ column = 'osm_id', type = 'text' },
{ column = 'population', type = 'text' },
{ column = 'way', type = 'geometry', projection = srid, not_null = true },
})
-- create a table for peaks from nodes
tables.peak = osm2pgsql.define_node_table('peak', {
{ column = 'name', type = 'text' },
{ column = 'natural', type = 'text' },
{ column = 'osm_id', type = 'text' },
{ column = 'ele', type = 'text' },
{ column = 'way', type = 'geometry', projection = srid, not_null = true },
})
-- Helper function that looks at the tags and decides if this is possibly
-- an area.
function has_area_tags(tags)
if tags.area == 'yes' then
return true
end
if tags.area == 'no' then
return false
end
return tags.place
or tags.population
end
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
tables.cities:insert({
osm_id = object.id,
name = object.tags.name,
place = object.tags.place,
admin_level = object.tags.admin_level,
population = object.tags.population,
way = object:as_point()
})
end
if (object.tags.natural == 'peak') then
tables.peak:insert({
natural = object.tags.natural,
name = object.tags.name,
ele = object.tags.ele,
osm_id = object.id,
way = object:as_point()
})
end
end
function osm2pgsql.process_way(object)
local way_type = object:grab_tag('type')
if ( object.tags.natural == 'water') or (object.tags.landuse ~= nil ) or (object.tags.leisure ~= nil ) then
tables.polygons:insert({
name = object.tags.name,
osm_id = object.id,
type = way_type,
landuse = object.tags.landuse,
leisure = object.tags.leisure,
natural = object.tags.natural,
water = object.tags.water,
way = object:as_polygon()
})
end
if ( object.tags.highway ~= nil) or ( object.tags.waterway ~= nil) then
tables.lines:insert({
name = object.tags.name,
osm_id = object.id,
highway = object.tags.highway,
waterway = object.tags.waterway,
width = object.tags.width,
maxspeed = object.tags.maxspeed,
way = object:as_linestring()
})
end
end
function osm2pgsql.process_relation(object)
local relation_type = object:grab_tag('type')
tables.polygons:insert({
osm_id = object.id,
type = relation_type,
boundary = object.tags.boundary,
name = object.tags.name,
place = object.tags.place,
population = object.tags.population,
landuse = object.tags.landuse,
leisure = object.tags.leisure,
natural = object.tags.natural,
water = object.tags.water,
way = object:as_multipolygon()
})
-- if (relation_type == 'boundary') and has_area_tags(object.tags) then
if (relation_type == 'boundary') then
tables.cities_rel:insert({
reltype = object.tags.relation_type,
boundary = object.tags.boundary,
admin_level = object.tags.admin_level,
name = object.tags.name,
place = object.tags.place,
population = object.tags.population,
osm_id = object.id,
way = object:as_multipolygon()
})
end
end

View file

@ -0,0 +1,967 @@
---lookupversion:10
---minorversion:14
---context:way
highway;0029035962 residential
highway;0010319731 service
highway;0007688809 track
highway;0007656124 unclassified
highway;0004141444 footway
highway;0003493551 tertiary
highway;0002852601 path
highway;0002185240 secondary
highway;0001447719 primary
highway;0000699577 cycleway
highway;0000608469 trunk
highway;0000568118 living_street
highway;0000515044 motorway
highway;0000451760 motorway_link
highway;0000442502 steps
highway;0000360177 road
highway;0000318426 pedestrian
highway;0000210535 trunk_link
highway;0000192461 primary_link
highway;0000120758 secondary_link
highway;0000079637 tertiary_link
highway;0000070238 construction
highway;0000058257 bridleway
highway;0000039003 platform
highway;0000037192 proposed planned virtual
highway;0000010307 raceway
highway;0000003152 rest_area
highway;0000002942 abandoned disused razed demolished dismantled
highway;0000002631 services
highway;0000002133 corridor
highway;0000002093 crossing
highway;0000001440 bus_stop
highway;0000001274 yes
highway;0000000679 unsurfaced
highway;0000000108 byway
highway;0000000037 driveway
highway;0000000021 mini_roundabout
highway;0000000020 turning_loop
tracktype;0000887965 grade2
tracktype;0000868414 grade3
tracktype;0000595882 grade1
tracktype;0000568372 grade4
tracktype;0000405959 grade5
surface;0002497676 asphalt
surface;0001568957 paved
surface;0001562253 unpaved
surface;0000727427 gravel
surface;0000560191 ground
surface;0000350378 dirt
surface;0000237226 grass
surface;0000212587 concrete concrete:plates concrete:lanes
surface;0000188743 paving_stones paving_stones:30 paving_stones:20
surface;0000113800 cobblestone cobblestone:flattened
surface;0000093164 compacted
surface;0000091171 sand dirt/sand
surface;0000023293 wood
surface;0000019915 pebblestone
surface;0000012866 fine_gravel
surface;0000010681 earth
surface;0000007331 sett
surface;0000005778 mud
surface;0000004549 grass_paver
surface;0000004398 clay
surface;0000003760 metal
maxspeed;0001058313 50 30_mph 30mph
maxspeed;0000860780 30 20_mph 20mph
maxspeed;0000025232 10 5 7 15
maxspeed;0000083989 20 10_mph 10mph 15_mph 15mph
maxspeed;0000195097 40 45 25_mph 25mph
maxspeed;0000204646 60 35_mph 35mph 40_mph 40mph
maxspeed;0000130108 70 45_mph 45mph
maxspeed;0000225071 80 50_mph 50mph
maxspeed;0000106719 90 55_mph 55mph
maxspeed;0000134522 100 60_mph 60mph 65_mph 65mph
maxspeed;0000025242 110 70_mph 70mph
maxspeed;0000038763 120 75_mph 75mph
maxspeed;0000026953 130
maxspeed;0000138654 urban RO:urban RU:urban FR:urban IT:urban AT:urban DE:urban UA:urban
maxspeed;0000138654 rural RO:rural RU:rural FR:rural IT:rural AT:rural DE:rural UA:rural
service;0001433919 parking_aisle
service;0001305879 driveway
service;0000382788 alley
service;0000018777 drive-through drive_through
service;0000008290 emergency_access
service;0000003138 bus
service;0000001250 parking
service;0000001159 logging
lit;0000809223 yes
lanes;0002838405 2
lanes;0000718138 1
lanes;0000259502 3
lanes;0000141651 4
lanes;0000018473 -1
lanes;0000017934 5
lanes;0000008241 6
lanes;0000003643 1.5
lanes;0000001087 7
access;0002688349 private
access;0000319927 yes
access;0000144799 no
access;0000140215 permissive
access;0000108802 destination
access;0000099899 agricultural forestry
access;0000039934 designated official
access;0000011813 customers
access;0000004007 delivery
access;0000000100 psv
access;0000000100 hov
foot;0001659694 yes allowed Yes
foot;0000424847 designated official
foot;0000202364 no
foot;0000053031 permissive
foot;0000011661 destination
foot;0000007289 private
foot;0000000167 use_sidepath sidewalk
bicycle;0001245560 yes allowed
bicycle;0000452059 no
bicycle;0000324902 designated official
bicycle;0000025707 dismount
bicycle;0000020440 permissive
bicycle;0000008286 private
bicycle;0000001553 destination
bicycle;0000000719 use_sidepath use_cycleway
bicycle;0000000385 mtb
bicycle;0000000117 opposite
motorcar;0000135124 no
motorcar;0000045407 yes
motorcar;0000021494 agricultural forestry
motorcar;0000012090 destination
motorcar;0000008733 private
motorcar;0000005757 designated official
motorcar;0000004116 permissive
motorcar;0000000979 restricted
motorcar;0000000100 psv
motorcar;0000000100 hov
motor_vehicle;0000212692 no
motor_vehicle;0000184982 yes
motor_vehicle;0000045128 private
motor_vehicle;0000032622 agricultural forestry agricultural;forestry agricultural,forestry
motor_vehicle;0000025396 designated official
motor_vehicle;0000025092 destination
motor_vehicle;0000010895 permissive
motor_vehicle;0000000175 emergency Emergency
motor_vehicle;0000000100 psv
motor_vehicle;0000000100 hov
motorcycle;0000092079 no
motorcycle;0000027978 yes
motorcycle;0000014652 agricultural forestry
motorcycle;0000008862 destination
motorcycle;0000004877 designated official
motorcycle;0000003936 private
motorcycle;0000002209 permissive
motorcycle;0000000100 psv
motorcycle;0000000100 hov
vehicle;0000030218 no
vehicle;0000013333 destination
vehicle;0000011692 yes
vehicle;0000007147 agricultural forestry agricultural;forestry
vehicle;0000006305 private
vehicle;0000001294 permissive
vehicle;0000000105 designated
vehicle;0000000100 psv
vehicle;0000000100 hov
horse;0000227398 no
horse;0000144432 yes
horse;0000014566 designated
horse;0000007223 permissive
horse;0000004755 private
horse;0000000983 official
horse;0000000968 unknown
horse;0000000205 destination
wheelchair;0000036603 no
wheelchair;0000028451 yes
wheelchair;0000002713 limited
wheelchair;0000001043 unknown
wheelchair;0000000439 designated official
wheelchair;0000000184 destination
hgv;0000206836 designated
hgv;0000071222 yes
hgv;0000043783 no
hgv;0000019115 destination
hgv;0000005273 delivery
hgv;0000003055 local
hgv;0000001088 agricultural forestry
hgv;0000000461 private
hgv;0000000320 unsuitable
hgv;0000000306 permissive
cycleway;0000137526 no
cycleway;0000124777 lane
cycleway;0000106948 track
cycleway;0000044652 opposite
cycleway;0000011237 shared
cycleway;0000007312 opposite_lane
cycleway;0000005737 shared_lane
cycleway;0000002533 yes
cycleway;0000002356 opposite_track
cycleway;0000001945 share_busway
cycleway;0000001883 none
cycleway;0000001705 crossing
cycleway;0000001560 unmarked_lane
cycleway;0000001542 right
cycleway;0000001291 segregated
cycleway;0000001065 both
cycleway;0000000892 left
cycleway;0000000399 street
cycleway;0000000344 shoulder
cycleway;0000000326 designated
cycleway;0000000247 proposed planned virtual
cycleway;0000000224 cyclestreet
cycleway;0000000172 path
cycleway;0000000154 sidewalk
footway;0000104998 sidewalk
footway;0000065943 crossing
footway;0000012342 both
footway;0000008363 none
footway;0000005903 right
footway;0000004159 left
footway;0000003966 no
footway;0000001093 yes
footway;0000000558 separate
segregated;0000224960 no
segregated;0000051124 yes
sidewalk;0000194579 none
sidewalk;0000111468 both
sidewalk;0000052950 right
sidewalk;0000024489 left
sidewalk;0000012916 no
sidewalk;0000005725 separate
sidewalk;0000001950 yes
mtb:scale;0000114272 0
mtb:scale;0000068284 1
mtb:scale;0000027311 2
mtb:scale;0000011529 3
mtb:scale;0000003666 4
mtb:scale;0000001957 0+
mtb:scale;0000001472 5
mtb:scale;0000000498 1+
mtb:scale;0000000478 1-
mtb:scale;0000000268 0-
mtb:scale;0000000177 2-
mtb:scale;0000000131 2+
mtb:scale;0000000115 6
sac_scale;0000150704 hiking
sac_scale;0000070463 mountain_hiking
sac_scale;0000010993 demanding_mountain_hiking
sac_scale;0000004549 alpine_hiking
sac_scale;0000001620 demanding_alpine_hiking
sac_scale;0000000831 yes
sac_scale;0000000712 difficult_alpine_hiking
sac_scale;0000000265 T1-hiking
noexit;0000118665 yes
motorroad;0000056844 yes
oneway;0005387257 yes
oneway;0001455407 no
oneway;0000139188 -1
oneway;0000000892 reversible
oneway;0000000756 1
oneway;0000000481 true
junction;0000321066 roundabout
junction;0000002828 spui
junction;0000002134 jughandle
junction;0000001493 approach
junction;0000000100 circular
bridge;0001842517 yes viaduct true suspension
tunnel;0000247305 yes
tunnel;0000016890 building_passage
tunnel;0000004237 no
tunnel;0000000265 passage
tunnel;0000000241 culvert
tunnel;0000000122 avalanche_protector
tunnel;0000000114 covered
lcn;0000073956 yes
lcn;0000002631 proposed
oneway:bicycle;0000012034 no
oneway:bicycle;0000005217 yes
oneway:bicycle;0000000161 opposite
cycleway:right;0000012522 lane Lane
cycleway:right;0000006644 track
cycleway:right;0000000971 share_busway
cycleway:right;0000000686 sidepath
cycleway:right;0000000410 shared_lane
cycleway:right;0000000104 opposite_lane
cycleway:right;0000000058 opposite_track
cycleway:right;0000000045 no none
cycleway:right;0000000037 yes
cycleway:right;0000000004 opposite
cycleway:left;0000005134 lane Lane
cycleway:left;0000003169 track
cycleway:left;0000000656 share_busway
cycleway:left;0000000608 opposite_lane
cycleway:left;0000000475 sidepath
cycleway:left;0000000257 shared_lane
cycleway:left;0000000246 no none
cycleway:left;0000000130 opposite_track
cycleway:left;0000000053 opposite
cycleway:left;0000000014 yes
incline;0000052784 up
incline;0000035413 down
incline;0000001628 yes
incline;0000000779 steep
incline;0000000861 3% 0 1 2 3 0% 1% 2% 3%
incline;0000000724 5% 4 5 4%
incline;0000000530 8% 6 7 8 6% 7%
incline;0000003109 10% 9 10 9% 10°
incline;0000001297 15% 11 12 13 14 15 11% 12% 13% 14%
incline;0000000997 20% 16 17 18 19 20 16% 17% 18% 19%
incline;0000000409 25% 21 22 23 24 25 21% 22% 23% 24%
incline;0000000263 30% 30 40 50 40% 50%
incline;0000000861 -3% -1 -2 -3 -1% -2% -3%
incline;0000000724 -5% -4 -5 -4%
incline;0000000530 -8% -6 -7 -8 -6% -7%
incline;0000001515 -10% -9 -10 -9% -10°
incline;0000001297 -15% -11 -12 -13 -14 -15 -11% -12% -13% -14%
incline;0000000997 -20% -16 -17 -18 -19 -20 -16% -17% -18% -19%
incline;0000000409 -25% -21 -22 -23 -24 -25 -21% -22% -23% -24%
incline;0000000172 -30% -30 -40 -50 -40% -50%
toll;0000090536 yes true
railway;0000157547 rail
railway;0000019316 abandoned
railway;0000016982 tram
railway;0000014387 platform
railway;0000011143 disused
railway;0000004623 light_rail
railway;0000002982 subway
railway;0000002422 narrow_gauge
railway;0000001960 razed
railway;0000001859 preserved
seamark:type;0001564 recommended_track
seamark:type;0000522 fairway
waterway;0000016046 river
waterway;0000009496 canal
waterway;0000007876 riverbank
waterway;0000002202 weir
waterway;0000001364 dam
waterway;0000000386 lock
waterway;0000000321 tidal_flat_slough
waterway;0000000179 wadi
waterway;0000000126 dock
waterway;0000000113 fish_pass
waterway;0000000086 boatyard
waterway;0000000071 fairway
waterway;0000000059 lock_gate
boat;0000019888 no
boat;0000002718 yes
boat;0000000232 private
boat;0000000064 permissive
boat;0000000045 designated
motorboat;0000001077 yes
motorboat;0000000808 no
motorboat;0000000025 private privat
route;0000000850 ferry
route;0000000539 hiking
route;0000000505 bicycle
route;0000000454 ski
route;0000000413 mtb
route;0000000194 canoe
route;0000000151 road
route;0000000104 bus
smoothness;0000068136 good
smoothness;0000042124 bad Bad
smoothness;0000040763 intermediate
smoothness;0000033941 excellent
smoothness;0000012683 very_bad
smoothness;0000009837 horrible terrible
smoothness;0000003515 very_horrible
smoothness;0000000919 impassable
smoothness;0000000251 robust_wheels
smoothness;0000000221 high_clearance
smoothness;0000000132 very_good
smoothness;0000000083 off_road_wheels
smoothness;0000000057 medium Medium average
smoothness;0000000048 poor
smoothness;0000000039 rough
rcn;0000014518 yes
rcn;0000002862 proposed
ncn;0000002941 yes
ncn;0000001036 proposed
ford;0000020552 yes
ford;0000000289 stepping_stones
trail_visibility;0000067438 good
trail_visibility;0000041280 intermediate
trail_visibility;0000039801 excellent
trail_visibility;0000023482 bad
trail_visibility;0000005853 horrible
trail_visibility;0000002222 no
class:bicycle:mtb;0000002079 1 +1
class:bicycle:mtb;0000001191 0
class:bicycle:mtb;0000001089 2 +2
class:bicycle:mtb;0000000703 -1
class:bicycle:mtb;0000000234 -2
class:bicycle:mtb;0000000140 3 +3
class:bicycle:mtb;0000000068 -3
class:bicycle;0000002842 1 +1
class:bicycle;0000000595 -1
class:bicycle;0000000533 2 +2
class:bicycle;0000000516 -2
class:bicycle;0000000245 -3
class:bicycle;0000000170 0
class:bicycle;0000000108 3 +3
route_bicycle_icn;0000088753 yes
route_bicycle_icn;0000000001 proposed
route_bicycle_ncn;0000268180 yes
route_bicycle_ncn;00000000001 proposed
route_bicycle_rcn;0000718163 yes
route_bicycle_rcn;00000000001 proposed
route_bicycle_lcn;0000469215 yes
route_bicycle_lcn;00000000001 proposed
route_bicycle_;0000024662 yes
route_bicycle_radweit;0000004604 yes
route_hiking_iwn;0000056005 yes
route_hiking_nwn;0000315813 yes
route_hiking_rwn;0000343219 yes
route_hiking_lwn;0000359332 yes
route_hiking_;0000103733 yes
route_foot_nwn;0000047923 yes
route_foot_lwn;0000135371 yes
route_foot_rwn;0000115325 yes
route_foot_;0000070583 yes
route_mtb_;0000066263 yes
route_mtb_lcn;0000023718 yes
route_mtb_ncn;0000004853 yes
route_mtb_rcn;0000013321 yes
route_mtb_mtb;0000006853 yes
route_bicycle_mtb;0000002240 yes
brouter_route_placeholder_dummy_01;0000000001 dummy
brouter_route_placeholder_dummy_02;0000000001 dummy
brouter_route_placeholder_dummy_03;0000000001 dummy
brouter_route_placeholder_dummy_04;0000000001 dummy
brouter_route_placeholder_dummy_05;0000000001 dummy
brouter_route_placeholder_dummy_06;0000000001 dummy
brouter_route_placeholder_dummy_07;0000000001 dummy
brouter_route_placeholder_dummy_08;0000000001 dummy
brouter_route_placeholder_dummy_09;0000000001 dummy
brouter_route_placeholder_dummy_10;0000000001 dummy
brouter_route_placeholder_dummy_11;0000000001 dummy
brouter_route_placeholder_dummy_12;0000000001 dummy
brouter_route_placeholder_dummy_13;0000000001 dummy
brouter_route_placeholder_dummy_14;0000000001 dummy
brouter_route_placeholder_dummy_15;0000000001 dummy
brouter_route_placeholder_dummy_16;0000000001 dummy
brouter_route_placeholder_dummy_17;0000000001 dummy
brouter_route_placeholder_dummy_18;0000000001 dummy
brouter_route_placeholder_dummy_19;0000000001 dummy
brouter_route_placeholder_dummy_20;0000000001 dummy
brouter_route_placeholder_dummy_21;0000000001 dummy
ramp:bicycle;0000001305 yes both permissive right left
ramp:bicycle;0000000385 no
ramp:stroller;0000001099 yes
ramp:stroller;0000000326 no
ramp:wheelchair;0000000610 yes
ramp:wheelchair;0000000439 no
ramp:luggage;0000000162 no
ramp:luggage;0000000054 yes automatic manual
estimated_traffic_class;0000000001 1
estimated_traffic_class;0000000001 2
estimated_traffic_class;0000000001 3
estimated_traffic_class;0000000001 4
estimated_traffic_class;0000000001 5
estimated_traffic_class;0000000001 6
estimated_traffic_class;0000000001 7
mtb:scale:uphill;0000018869 0 0+ 0-
mtb:scale:uphill;0000015578 1 1+ 1-
mtb:scale:uphill;0000012338 2 2+ 2-
mtb:scale:uphill;0000009099 3 3+ 3-
mtb:scale:uphill;0000005825 4 4+ 4-
mtb:scale:uphill;0000004628 5 5+ 5-
crossing;0000101049 zebra
crossing;0000017509 unmarked
crossing;0000013817 traffic_signals
crossing;0000011062 uncontrolled
crossing;0000001722 yes
crossing;0000001678 island
crossing;0000000457 marked
crossing;0000000131 pedestrian_signals
crossing;0000000122 no
informal;0000002424 yes
indoor;0000058418 yes
indoor;0000025038 room
indoor;0000005295 wall
indoor;0000004322 corridor
indoor;0000002410 area
indoor;0000000816 column
indoor;0000000568 no
indoor;0000000129 shop
indoor;0000000099 steps
4wd_only;0000008129 yes Yes
4wd_only;0000000487 recommended
4wd_only;0000000041 no
concrete;0000000043 plates
concrete;0000000013 lanes
bus;0001178365 yes
bus;0000006419 designated
bus;0000005602 no
bus;0000001424 urban
psv;0000072077 yes
psv;0000007456 no
psv;0000007428 designated official
hov;0000006684 lane
hov;0000003258 designated
hov;0000002162 no
hov;0000001512 yes
busway;0000000000 opposite opposite_lane opposite_track
busway:left;0000000000 opposite opposite_lane opposite_track
busway:right;0000000000 opposite opposite_lane opposite_track
cycleway:left:oneway;0000000769 yes
cycleway:left:oneway;0000001595 no
cycleway:left:oneway;0000000927 -1
cycleway:right:oneway;0000003084 yes
cycleway:right:oneway;0000002499 no
cycleway:right:oneway;0000000017 -1
zone:maxspeed;0000001616 20 DE:20 FR:20
zone:maxspeed;0000063721 30 DE:30 FR:30 BE:30 HU:30 NO:30 AT:30 ES:30 NL:30
cycleway:surface;0000002609 asphalt
cycleway:surface;0000000150 paved
cycleway:surface;0000000012 unpaved
cycleway:surface;0000000010 gravel
cycleway:surface;0000000157 concrete concrete:plates concrete:lanes
cycleway:surface;0000002239 paving_stones paving_stones:30 paving_stones:20
cycleway:surface;0000000011 cobblestone cobblestone:flattened
cycleway:surface;0000000013 compacted
cycleway:surface;0000000006 fine_gravel
cycleway:surface;0000000011 sett
maxspeed:backward;0001058313 50 30_mph 30mph
maxspeed:backward;0000860780 30 20_mph 20mph
maxspeed:backward;0000025232 10 5 7 15
maxspeed:backward;0000083989 20 10_mph 10mph 15_mph 15mph
maxspeed:backward;0000195097 40 45 25_mph 25mph
maxspeed:backward;0000204646 60 35_mph 35mph 40_mph 40mph
maxspeed:backward;0000130108 70 45_mph 45mph
maxspeed:backward;0000225071 80 50_mph 50mph
maxspeed:backward;0000106719 90 55_mph 55mph
maxspeed:backward;0000134522 100 60_mph 60mph 65_mph 65mph
maxspeed:backward;0000025242 110 70_mph 70mph
maxspeed:backward;0000038763 120 75_mph 75mph
maxspeed:backward;0000026953 130
maxspeed:backward;0000138654 urban RO:urban RU:urban FR:urban IT:urban AT:urban DE:urban UA:urban
maxspeed:backward;0000138654 rural RO:rural RU:rural FR:rural IT:rural AT:rural DE:rural UA:rural
maxspeed:forward;0001058313 50 30_mph 30mph
maxspeed:forward;0000860780 30 20_mph 20mph
maxspeed:forward;0000025232 10 5 7 15
maxspeed:forward;0000083989 20 10_mph 10mph 15_mph 15mph
maxspeed:forward;0000195097 40 45 25_mph 25mph
maxspeed:forward;0000204646 60 35_mph 35mph 40_mph 40mph
maxspeed:forward;0000130108 70 45_mph 45mph
maxspeed:forward;0000225071 80 50_mph 50mph
maxspeed:forward;0000106719 90 55_mph 55mph
maxspeed:forward;0000134522 100 60_mph 60mph 65_mph 65mph
maxspeed:forward;0000025242 110 70_mph 70mph
maxspeed:forward;0000038763 120 75_mph 75mph
maxspeed:forward;0000026953 130
maxspeed:forward;0000138654 urban RO:urban RU:urban FR:urban IT:urban AT:urban DE:urban UA:urban
maxspeed:forward;0000138654 rural RO:rural RU:rural FR:rural IT:rural AT:rural DE:rural UA:rural
embedded_rails;0000000928 tram
embedded_rails;0000000007 yes
embedded_rails;0000000003 rail
living_street;0000000404 yes
sidewalk:bicycle;0000000439 yes designated
sidewalk:left:bicycle;0000001722 yes designated
sidewalk:right:bicycle;0000002667 yes designated
bicycle_road;0000006521 yes designated
construction;0000144871 yes
construction;0000008214 minor
construction;0029035962 residential
construction;0010319731 service
construction;0007688809 track
construction;0007656124 unclassified
construction;0004141444 footway
construction;0003493551 tertiary
construction;0002852601 path
construction;0002185240 secondary
construction;0001447719 primary
construction;0000699577 cycleway
construction;0000608469 trunk
construction;0000568118 living_street
construction;0000515044 motorway
construction;0000451760 motorway_link
construction;0000442502 steps
construction;0000360177 road
construction;0000318426 pedestrian
construction;0000210535 trunk_link
construction;0000192461 primary_link
construction;0000120758 secondary_link
construction;0000079637 tertiary_link
construction;0000070238 construction
construction;0000058257 bridleway
construction;0000039003 platform
construction;0000037192 proposed
construction;0000010307 raceway
construction;0000003152 rest_area
construction;0000002942 abandoned
construction;0000002631 services
construction;0000002133 corridor
construction;0000002093 crossing
construction;0000001440 bus_stop
construction;0000001274 yes
construction;0000000679 unsurfaced
construction;0000000108 byway
construction;0000000037 driveway
construction;0000000021 mini_roundabout
construction;0000000020 turning_loop
estimated_forest_class;0000000001 1
estimated_forest_class;0000000001 2
estimated_forest_class;0000000001 3
estimated_forest_class;0000000001 4
estimated_forest_class;0000000001 5
estimated_forest_class;0000000001 6
estimated_noise_class;0000000001 1
estimated_noise_class;0000000001 2
estimated_noise_class;0000000001 3
estimated_noise_class;0000000001 4
estimated_noise_class;0000000001 5
estimated_noise_class;0000000001 6
estimated_river_class;0000000001 1
estimated_river_class;0000000001 2
estimated_river_class;0000000001 3
estimated_river_class;0000000001 4
estimated_river_class;0000000001 5
estimated_river_class;0000000001 6
estimated_town_class;0000000001 1
estimated_town_class;0000000001 2
estimated_town_class;0000000001 3
estimated_town_class;0000000001 4
estimated_town_class;0000000001 5
estimated_town_class;0000000001 6
---context:node
highway;0001314954 bus_stop
highway;0001130090 crossing
highway;0001031274 turning_circle
highway;0000609262 traffic_signals
highway;0000306900 street_lamp
highway;0000136339 stop
highway;0000105097 motorway_junction
highway;0000058076 give_way
highway;0000049111 mini_roundabout
highway;0000030072 milestone
highway;0000017567 speed_camera
highway;0000013806 emergency_access_point
highway;0000009721 platform
highway;0000007369 passing_place
highway;0000005939 ford
highway;0000004831 rest_area
highway;0000003535 elevator
highway;0000002572 turning_loop
highway;0000002540 steps
highway;0000002493 services
highway;0000002133 emergency_bay
highway;0000001372 residential
highway;0000001324 street_light
highway;0000001147 incline_steep
highway;0000001101 stile
highway;0000000904 incline
highway;0000000819 service
highway;0000000817 traffic_calming
highway;0000000662 path
highway;0000000603 footway
highway;0000000438 track
highway;0000000436 no
highway;0000000353 door
highway;0000000283 level_crossing
highway;0000000267 yes
highway;0000000262 road
highway;0000000244 construction
highway;0000000214 unclassified
highway;0000000213 proposed
highway;0000000197 junction
highway;0000000176 distance_marker
highway;0000000158 noexit
highway;0000000155 unknown
highway;0000000134 traffic_sign
highway;0000000123 tertiary
highway;0000000115 trailhead
highway;0000000113 priority_to_right
highway;0000000113 culvert
highway;0000000100 <residential>
highway;0000000046 toll_bridge
highway;0000000037 city_entry
highway;0000002967 traffic_mirror
highway;0000001724 priority
barrier;0000606512 gate
barrier;0000164120 bollard
barrier;0000112184 lift_gate
barrier;0000046779 stile
barrier;0000046255 cycle_barrier
barrier;0000038597 entrance
barrier;0000027579 block
barrier;0000023074 toll_booth
barrier;0000016782 cattle_grid
barrier;0000016154 kissing_gate
barrier;0000003182 turnstile
barrier;0000003160 fence
barrier;0000002701 border_control
barrier;0000002536 sally_port
barrier;0000002504 chain
barrier;0000002470 door
barrier;0000002089 swing_gate
barrier;0000001912 bump_gate
barrier;0000001856 yes
barrier;0000001683 hampshire_gate
barrier;0000000445 wall
barrier;0000000440 bus_trap
barrier;0000000435 ditch
barrier;0000000420 debris
barrier;0000000381 log
barrier;0000000336 chicane
barrier;0000000316 kerb
barrier;0000000270 sump_buster
barrier;0000000268 obstacle
barrier;0000000223 no
barrier;0000000213 horse_stile
barrier;0000000210 full-height_turnstile
barrier;0000000176 windfall
barrier;0000000168 spikes
barrier;0000000168 checkpoint
barrier;0000000166 hedge
barrier;0000000164 footgate
barrier;0000000141 tree
barrier;0000000133 guard_rail
barrier;0000000129 bar
barrier;0000000124 fallen_tree
barrier;0000000118 jersey_barrier
barrier;0000000114 motorcycle_barrier
barrier;0000000114 barrier
barrier;0000000108 rope
barrier;0000000095 stone
barrier;0000000069 traffic_crossing_pole
access;0000078544 private
access;0000014933 yes public
access;0000014456 no
access;0000008670 permissive
access;0000006316 destination customers
access;0000000973 agricultural forestry
access;0000000942 designated official
foot;0000272169 yes
foot;0000036271 no
foot;0000001118 designated official
foot;0000000960 private
foot;0000000833 permissive
foot;0000000127 destination
bicycle;0000267569 yes
bicycle;0000067796 no
bicycle;0000004075 designated official
bicycle;0000002596 dismount
bicycle;0000000498 permissive
bicycle;0000000359 private
bicycle;0000000075 destination
motorcar;0000038901 yes
motorcar;0000009323 no
motorcar;0000000895 private
motorcar;0000000216 destination
motorcar;0000000214 permissive
motorcar;0000000093 agricultural forestry
motorcar;0000000084 designated official
motor_vehicle;0000000066 yes
motor_vehicle;0000000001 permissive
motor_vehicle;0000000000 designated official
motor_vehicle;0000000030 destination
motor_vehicle;0000000073 agricultural forestry
motor_vehicle;0000000136 private
motor_vehicle;0000000469 no
motorcycle;0000028697 yes
motorcycle;0000007061 no
motorcycle;0000000243 private
motorcycle;0000000237 designated
motorcycle;0000000117 destination
motorcycle;0000000080 permissive
motorcycle;0000000029 agricultural forestry
vehicle;0000002176 no
vehicle;0000000576 yes
vehicle;0000000556 private
vehicle;0000000262 destination
vehicle;0000000138 agricultural forestry
vehicle;0000000105 permissive
vehicle;0000000003 designated official
horse;0000021837 yes
horse;0000010811 no
horse;0000000105 private
horse;0000000065 permissive
horse;0000000053 designated official
horse;0000000009 critical
horse;0000000007 destination
wheelchair;0000203478 yes true
wheelchair;0000100082 no false
wheelchair;0000080430 limited
wheelchair;0000002769 designated official
wheelchair;0000000005 private
wheelchair;0000000005 permissive
wheelchair;0000000139 bad
wheelchair;0000000031 half
wheelchair;0000000005 partial
hgv;0000001141 no
hgv;0000000359 yes true
hgv;0000000111 destination
hgv;0000000108 designated official
hgv;0000000065 private
hgv;0000000053 delivery
hgv;0000000016 agricultural forestry
hgv;0000000010 permissive
crossing;0000251032 uncontrolled
crossing;0000200387 traffic_signals
crossing;0000029717 unmarked
crossing;0000022119 island
crossing;0000006981 zebra
crossing;0000003897 no
crossing;0000002166 yes
railway;0000312710 level_crossing
railway;0000078746 station
railway;0000067876 buffer_stop
railway;0000056184 switch
railway;0000049600 crossing
railway;0000037871 tram_stop
railway;0000024038 halt
railway;0000014285 subway_entrance
railway;0000010890 signal
waterway;0000004698 weir
waterway;0000001647 lock_gate
waterway;0000000425 waterfall
waterway;0000000337 take_right_side
waterway;0000000332 take_left_side
waterway;0000000219 milestone
waterway;0000000187 depth
waterway;0000000170 lock
noexit;0000195286 yes
entrance;0000301732 yes
entrance;0000159853 main
entrance;0000025621 staircase
entrance;0000006666 home
entrance;0000005428 service
entrance;0000001853 emergency
entrance;0000001144 exit
entrance;0000000953 residence
entrance;0000000620 garage
entrance;0000000558 entrance
entrance;0000000504 main_entrance
entrance;0000000439 secondary_entrance
entrance;0000000285 shop
entrance;0000000258 private
traffic_calming;0000045987 bump bump;choker
traffic_calming;0000040022 hump hump;choker
traffic_calming;0000012499 table table;choker
traffic_calming;0000006808 yes *
traffic_calming;0000005754 cushion cushion;choker
traffic_calming;0000005466 choker choker;cushion choker;hump choker;table choker;bump
traffic_calming;0000005305 island
traffic_calming;0000004686 chicane
traffic_calming;0000004032 rumble_strip
traffic_calming;0000000847 speed_bump
traffic_calming;0000000186 dip
ford;0000037927 yes
ford;0000000310 stepping_stones
direction;0000274642 forward
direction;0000249637 backward
direction;0000021634 both
traffic_signals:direction;0000062645 forward
traffic_signals:direction;0000033961 backward
traffic_signals:direction;0000007309 both

View file

@ -0,0 +1,51 @@
Import new tags for noise, green and water feature
- A PostgreSQL and a osm2pgsql installation is needed
see https://www.postgresql.org/
and https://osm2pgsql.org/
- and a jdbc driver
see https://jdbc.postgresql.org/download/
- prepare database
```
# postgres createdb --encoding=UTF8 -U postgres osm
# postgres psql -U postgres osm --command='CREATE EXTENSION postgis;'
```
- import to database and create
```
# osm2pgsql -c -s -d osm -U postgres -W -H localhost -P 5432 -O flex -S brouter_cfg.lua /path/to/file.pbf
```
- generate new tags inside the database
```
# psql -d osm -U postgres -H localhost -P 5432 -f brouter.sql
```
- prepare generation of pbf
- when using database and new tagging an other lookups.dat is needed, use lookups_db.dat and rename
- script needs a jdbc in the classpath
`... -cp ../postgresql-42.6.0.jar;../brouter_fc.jar ...`
- script needs a call with jdbc parameter
define the database parameter
`JDBC="jdbc:postgresql://localhost/osm?user=postgres&password=xyz&ssl=false"`
call it with OsmFastCutter as last parameter (behind pbf file)
`... btools.mapcreator.OsmFastCutter ... ../planet-new.osm.pbf $(JDBC)`