Last active
August 29, 2015 14:05
-
-
Save alex85k/96d831ee3c80357c1f67 to your computer and use it in GitHub Desktop.
regression-test.py
This file contains hidden or 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
Microsoft Windows [Version 6.3.9600] | |
(c) Корпорация Майкрософт (Microsoft Corporation), 2013. Все права защищены. | |
D:\osm>stresstest2.bat | |
osm2pgsql.exe -v -C5000 -c -d osm -U osm -W -H localhost -P 5432 -S default.style -s --hstore --number-processes=1 germany-latest.osm.pbf | |
D:\osm>osm2pgsql.exe -v -C5000 -c -d osm -U osm -W -H localhost -P 5432 -S defau | |
lt.style -s --hstore --number-processes=1 germany-latest.osm.pbf | |
osm2pgsql SVN version 0.85-win-cmake (64bit id space) | |
WARNING: osm2pgsql was compiled without fork, only using one process! | |
Password: | |
Using projection SRS 900913 (Spherical Mercator) | |
Setting up table: planet_osm_point | |
╨Ч╨Р╨Ь╨Х╨з╨Р╨Э╨Ш╨Х: ╤В╨░╨▒╨╗╨╕╤Ж╨░ "planet_osm_point" ╨╜╨╡ ╤Б╤Г╤Й╨╡╤Б╤В╨▓╤Г╨╡╤В | |
, ╨┐╤А╨╛╨┐╤Г╤Б╨║╨░╨╡╤В╤Б╤П | |
╨Ч╨Р╨Ь╨Х╨з╨Р╨Э╨Ш╨Х: ╤В╨░╨▒╨╗╨╕╤Ж╨░ "planet_osm_point_tmp" ╨╜╨╡ ╤Б╤Г╤Й╨╡╤Б╤В╨▓╤Г | |
╨╡╤В, ╨┐╤А╨╛╨┐╤Г╤Б╨║╨░╨╡╤В╤Б╤П | |
Setting up table: planet_osm_line | |
╨Ч╨Р╨Ь╨Х╨з╨Р╨Э╨Ш╨Х: ╤В╨░╨▒╨╗╨╕╤Ж╨░ "planet_osm_line" ╨╜╨╡ ╤Б╤Г╤Й╨╡╤Б╤В╨▓╤Г╨╡╤В, | |
╨┐╤А╨╛╨┐╤Г╤Б╨║╨░╨╡╤В╤Б╤П | |
╨Ч╨Р╨Ь╨Х╨з╨Р╨Э╨Ш╨Х: ╤В╨░╨▒╨╗╨╕╤Ж╨░ "planet_osm_line_tmp" ╨╜╨╡ ╤Б╤Г╤Й╨╡╤Б╤В╨▓╤Г╨ | |
╡╤В, ╨┐╤А╨╛╨┐╤Г╤Б╨║╨░╨╡╤В╤Б╤П | |
Setting up table: planet_osm_polygon | |
╨Ч╨Р╨Ь╨Х╨з╨Р╨Э╨Ш╨Х: ╤В╨░╨▒╨╗╨╕╤Ж╨░ "planet_osm_polygon" ╨╜╨╡ ╤Б╤Г╤Й╨╡╤Б╤В╨▓╤Г╨╡ | |
╤В, ╨┐╤А╨╛╨┐╤Г╤Б╨║╨░╨╡╤В╤Б╤П | |
╨Ч╨Р╨Ь╨Х╨з╨Р╨Э╨Ш╨Х: ╤В╨░╨▒╨╗╨╕╤Ж╨░ "planet_osm_polygon_tmp" ╨╜╨╡ ╤Б╤Г╤Й╨╡╤Б╤В╨▓ | |
╤Г╨╡╤В, ╨┐╤А╨╛╨┐╤Г╤Б╨║╨░╨╡╤В╤Б╤П | |
Setting up table: planet_osm_roads | |
╨Ч╨Р╨Ь╨Х╨з╨Р╨Э╨Ш╨Х: ╤В╨░╨▒╨╗╨╕╤Ж╨░ "planet_osm_roads" ╨╜╨╡ ╤Б╤Г╤Й╨╡╤Б╤В╨▓╤Г╨╡╤В | |
, ╨┐╤А╨╛╨┐╤Г╤Б╨║╨░╨╡╤В╤Б╤П | |
╨Ч╨Р╨Ь╨Х╨з╨Р╨Э╨Ш╨Х: ╤В╨░╨▒╨╗╨╕╤Ж╨░ "planet_osm_roads_tmp" ╨╜╨╡ ╤Б╤Г╤Й╨╡╤Б╤В╨▓╤Г | |
╨╡╤В, ╨┐╤А╨╛╨┐╤Г╤Б╨║╨░╨╡╤В╤Б╤П | |
Using built-in tag processing pipeline | |
Allocating memory for sparse node cache | |
Node-cache: cache=5000MB, maxblocks=640000*zd, allocation method=8192 | |
Mid: pgsql, scale=100 cache=5000 | |
Setting up table: planet_osm_nodes | |
Setting up table: planet_osm_ways | |
Setting up table: planet_osm_rels | |
Reading in file: germany-latest.osm.pbf | |
Processing: Node(182758k 130.4k/s) Way(28543k 9.16k/s) Relation(418380 5.25/s) | |
parse time: 84232s | |
Node stats: total(182758416), max(3017093736) in 1401s | |
Way stats: total(28543383), max(297801285) in 3117s | |
Relation stats: total(418386), max(3961177) in 79714s | |
Committing transaction for planet_osm_point | |
Committing transaction for planet_osm_line | |
Committing transaction for planet_osm_polygon | |
Committing transaction for planet_osm_roads | |
Going over pending ways... | |
^CЗавершить выполнение пакетного файла [Y(да)/N(нет)]? y | |
D:\osm> |
This file contains hidden or 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
#!/usr/bin/env python | |
import unittest | |
import psycopg2 | |
import os | |
# from pwd import getpwnam | |
import subprocess | |
tmp_table = os.getcwd()+"/tmp" if (os.name is 'nt') else os.path.join(os.environ['temp'], 'psql-tablespace') | |
usr, pwd = 'postgres', 'MY_PASSWORD' | |
credentials = ['--username', usr] | |
conn_str = "user={} password={} ".format(usr, pwd) | |
full_import_file="liechtenstein-2013-08-03.osm.pbf" | |
multipoly_import_file="test_multipolygon.osm" #This file contains a number of different multi-polygon test cases | |
diff_import_file="000466354.osc.gz" | |
diff_multipoly_import_file="test_multipolygon_diff.osc" #This file contains a number of different multi-polygon diff processing test cases | |
created_tablespace = 0 | |
sql_test_statements=[ | |
( 0, 'Basic point count', 'SELECT count(*) FROM planet_osm_point;', 1342 ), | |
( 1, 'Basic line count', 'SELECT count(*) FROM planet_osm_line;', 3300 ), | |
( 2, 'Basic road count', 'SELECT count(*) FROM planet_osm_roads;', 375 ), | |
( 3, 'Basic polygon count', 'SELECT count(*) FROM planet_osm_polygon;', 4128 ), | |
( 4, 'Basic latlon line count', 'SELECT count(*) FROM planet_osm_line;', 3298 ), | |
( 5, 'Basic latlon road count', 'SELECT count(*) FROM planet_osm_roads;', 374 ), | |
( 6, 'Basic post-diff point count', 'SELECT count(*) FROM planet_osm_point;', 1457 ), | |
( 7, 'Basic post-diff line count', 'SELECT count(*) FROM planet_osm_line;', 3344 ), | |
( 8, 'Basic post-diff road count', 'SELECT count(*) FROM planet_osm_roads;', 381 ), | |
( 9, 'Basic post-diff polygon count', 'SELECT count(*) FROM planet_osm_polygon;', 4275 ), | |
( 10, 'Absence of nodes table', 'SELECT count(*) FROM pg_tables WHERE tablename = \'planet_osm_nodes\'', 0), | |
( 11, 'Absence of way table', 'SELECT count(*) FROM pg_tables WHERE tablename = \'planet_osm_ways\'', 0), | |
( 12, 'Absence of rel line', 'SELECT count(*) FROM pg_tables WHERE tablename = \'planet_osm_rels\'', 0), | |
( 13, 'Basic polygon area', 'SELECT round(sum(cast(ST_Area(way) as numeric)),0) FROM planet_osm_polygon;', 1223800814), | |
( 14, 'Gazetteer place count', 'SELECT count(*) FROM place', 4499), | |
( 15, 'Gazetteer place node count', 'SELECT count(*) FROM place WHERE osm_type = \'N\'', 779), | |
( 16, 'Gazetteer place way count', 'SELECT count(*) FROM place WHERE osm_type = \'W\'', 3697), | |
( 17, 'Gazetteer place rel count', 'SELECT count(*) FROM place WHERE osm_type = \'R\'', 23), | |
( 18, 'Gazetteer post-diff place count', 'SELECT count(*) FROM place', 4553), | |
( 19, 'Gazetteer post-diff place node count', 'SELECT count(*) FROM place WHERE osm_type = \'N\'', 788), | |
( 20, 'Gazetteer post-diff place way count', 'SELECT count(*) FROM place WHERE osm_type = \'W\'', 3742), | |
( 21, 'Gazetteer post-diff place rel count', 'SELECT count(*) FROM place WHERE osm_type = \'R\'', 23), | |
( 22, 'Gazetteer housenumber count', 'SELECT count(*) FROM place WHERE housenumber is not null', 199), | |
( 23, 'Gazetteer post-diff housenumber count count', 'SELECT count(*) FROM place WHERE housenumber is not null', 199), | |
( 24, 'Gazetteer isin count', 'SELECT count(*) FROM place WHERE isin is not null', 239), | |
( 25, 'Gazetteer post-diff isin count count', 'SELECT count(*) FROM place WHERE isin is not null', 239), | |
( 26, 'Multipolygon basic case (Tags from outer way)', | |
'SELECT round(ST_Area(way)) FROM planet_osm_polygon WHERE osm_id = -15 and landuse = \'residential\' and name = \'Name_way\'', 12894), | |
( 27, 'Multipolygon basic case (Tags from relation)', | |
'SELECT round(ST_Area(way)) FROM planet_osm_polygon WHERE osm_id = -1 and landuse = \'residential\' and name = \'Name_rel\'', 12895), | |
( 28, 'Multipolygon named inner - outer (Tags from way)', | |
'SELECT round(ST_Area(way)) FROM planet_osm_polygon WHERE osm_id = -16 and landuse = \'residential\' and name = \'Name_way2\'', 12895), | |
( 29, 'Multipolygon named inner - inner way', | |
'SELECT round(ST_Area(way)) FROM planet_osm_polygon WHERE osm_id = 4 and landuse = \'farmland\' and name = \'Name_way3\'', 3144), | |
( 30, 'Multipolygon named inner - outer (Tags from relation)', | |
'SELECT round(ST_Area(way)) FROM planet_osm_polygon WHERE osm_id = -8 and landuse = \'residential\' and name = \'Name_rel2\'', 12894), | |
( 31, 'Multipolygon named inner - inner way', | |
'SELECT round(ST_Area(way)) FROM planet_osm_polygon WHERE osm_id = 5 and landuse = \'farmland\' and name = \'Name_way4\'', 3144), | |
( 32, 'Multipolygon named same inner - outer (Tags from way)', | |
'SELECT round(ST_Area(way)) FROM planet_osm_polygon WHERE osm_id = -17 and landuse = \'residential\' and name = \'Name_way16\'', 12895), | |
( 33, 'Multipolygon named same inner - inner way absent', | |
'SELECT count(*) FROM planet_osm_polygon WHERE osm_id = 15', 0), | |
( 34, 'Multipolygon non-area inner - outer (Tags from relation)', | |
'SELECT round(ST_Area(way)) FROM planet_osm_polygon WHERE osm_id = -14 and landuse = \'residential\' and name = \'Name_way5\'', 12893), | |
( 35, 'Multipolygon non-area inner - inner (Tags from way)', | |
'SELECT round(ST_Length(way)) FROM planet_osm_line WHERE osm_id = 6 and highway = \'residential\' and name = \'Name_way6\'', 228), | |
( 36, 'Multipolygon 2 holes (Tags from way)', | |
'SELECT round(ST_Area(way)) FROM planet_osm_polygon WHERE osm_id = -18 and landuse = \'residential\' and name = \'Name_way7\'', 11823), | |
( 37, 'Multipolygon 2 holes (Tags from way)', | |
'SELECT ST_NumInteriorRing(way) FROM planet_osm_polygon WHERE osm_id = -18 and landuse = \'residential\' and name = \'Name_way7\'', 2), | |
( 38, 'Multipolygon from multiple outer ways 0 holes (Tags from relation)', | |
'SELECT round(ST_Area(way)) FROM planet_osm_polygon WHERE osm_id = -11 and landuse = \'residential\' and name = \'Name_rel6\'', 11528), | |
( 39, 'Multipolygon from multiple outer and multiple inner ways 2 holes (Tags from relation)', | |
'SELECT round(ST_Area(way)) FROM planet_osm_polygon WHERE osm_id = -3 and landuse = \'residential\' and name = \'Name_rel11\'', 9286), | |
( 40, 'Multipolygon 2 holes (Tags from way)', | |
'SELECT ST_NumInteriorRing(way) FROM planet_osm_polygon WHERE osm_id = -3 and landuse = \'residential\' and name = \'Name_rel11\'', 2), | |
( 41, 'Multipolygon with touching inner ways 1 hole (Tags from way)', | |
'SELECT round(ST_Area(way)) FROM planet_osm_polygon WHERE osm_id = -19 and landuse = \'residential\' and name = \'Name_way8\'', 12167), | |
( 42, 'Multipolygon with touching inner ways 1 hole (Tags from way)', | |
'SELECT ST_NumInteriorRing(way) FROM planet_osm_polygon WHERE osm_id = -19 and landuse = \'residential\' and name = \'Name_way8\'', 1), | |
( 43, 'Multipolygon with 2 outer ways (Tags from relation)', | |
'SELECT round(sum(ST_Area(way))) FROM planet_osm_polygon WHERE osm_id = -13 and landuse = \'farmland\' and name = \'Name_rel9\'', 17581), | |
( 44, 'Multipolygon with 2 outer ways (Tags from relation)', | |
'SELECT count(*) FROM planet_osm_polygon WHERE osm_id = -13 and landuse = \'farmland\' and name = \'Name_rel9\'', 2), | |
( 45, 'Multipolygon with 2 outer ways (multigeometry)', | |
'SELECT count(*) FROM planet_osm_polygon WHERE osm_id = -13 and landuse = \'farmland\' and name = \'Name_rel9\'', 1), | |
( 46, 'Multipolygon with 2 outer ways (multigeometry)', | |
'SELECT ST_NumGeometries(way) FROM planet_osm_polygon WHERE osm_id = -13 and landuse = \'farmland\' and name = \'Name_rel9\'', 2), | |
( 47, 'Multipolygon nested outer ways. Both outer and inner ways are from multiple ways (Tags from relation)', | |
'SELECT round(sum(ST_Area(way))) FROM planet_osm_polygon WHERE osm_id = -7 and landuse = \'farmland\' and name = \'Name_rel15\'', 16169), | |
( 48, 'Multipolygon nested outer ways. Both outer and inner ways are from multiple ways (Tags from relation)', | |
'SELECT count(*) FROM planet_osm_polygon WHERE osm_id = -7 and landuse = \'farmland\' and name = \'Name_rel15\'', 2), | |
( 49, 'Multipolygon nested outer ways. Both outer and inner ways are from multiple ways (multigeometry)', | |
'SELECT count(*) FROM planet_osm_polygon WHERE osm_id = -7 and landuse = \'farmland\' and name = \'Name_rel15\'', 1), | |
( 50, 'Multipolygon nested outer ways. Both outer and inner ways are from multiple ways (multigeometry)', | |
'SELECT ST_NumGeometries(way) FROM planet_osm_polygon WHERE osm_id = -7 and landuse = \'farmland\' and name = \'Name_rel15\'', 2), | |
( 51, 'Basic hstore point count', 'SELECT count(*) FROM planet_osm_point;', 1360 ), | |
( 52, 'Basic hstore line count', 'SELECT count(*) FROM planet_osm_line;', 3323 ), | |
( 53, 'Basic hstore road count', 'SELECT count(*) FROM planet_osm_roads;', 375 ), | |
( 54, 'Basic hstore polygon count', 'SELECT count(*) FROM planet_osm_polygon;', 4128 ), | |
( 55, 'Basic post-diff point count', 'SELECT count(*) FROM planet_osm_point;', 1475 ), | |
( 56, 'Basic post-diff line count', 'SELECT count(*) FROM planet_osm_line;', 3367 ), | |
( 57, 'Basic post-diff road count', 'SELECT count(*) FROM planet_osm_roads;', 381 ), | |
( 58, 'Basic post-diff polygon count', 'SELECT count(*) FROM planet_osm_polygon;', 4275 ), | |
( 59, 'Extra hstore full tags point count', | |
'SELECT count(*) FROM planet_osm_point WHERE tags ? \'osm_user\' and tags ? \'osm_version\' and tags ? \'osm_uid\' and tags ? \'osm_changeset\'', 1360), | |
( 60, 'Extra hstore full tags line count', | |
'SELECT count(*) FROM planet_osm_line WHERE tags ? \'osm_user\' and tags ? \'osm_version\' and tags ? \'osm_uid\' and tags ? \'osm_changeset\'', 3323), | |
( 61, 'Extra hstore full tags polygon count', | |
'SELECT count(*) FROM planet_osm_polygon WHERE tags ? \'osm_user\' and tags ? \'osm_version\' and tags ? \'osm_uid\' and tags ? \'osm_changeset\'', 4128), | |
( 62, 'Multipolygon copying of tags from outer with extra tags on relation', | |
'SELECT round(ST_Area(way)) FROM planet_osm_polygon WHERE osm_id = -22', 20879), | |
( 63, 'Multipolygon copying of tags from outer with extra tags on relation (abscence of way)', | |
'SELECT count(*) FROM planet_osm_polygon WHERE osm_id = 84', 0), | |
( 64, 'Multipolygon non copying of tags from outer with polygon tags on relation', | |
'SELECT round(ST_Area(way)) FROM planet_osm_polygon WHERE osm_id = -24 and "natural" = \'water\'', 18501), | |
( 65, 'Multipolygon non copying of tags from outer with polygon tags on relation (presence of way)', | |
'SELECT round(ST_Area(way)) FROM planet_osm_polygon WHERE osm_id = 83 and "landuse" = \'farmland\'', 24859), | |
( 66, 'Multipolygon diff moved point of outer way case (Tags from outer way)', | |
'SELECT round(ST_Area(way)) FROM planet_osm_polygon WHERE osm_id = -15 and landuse = \'residential\' and name = \'Name_way\'', 24751), | |
( 67, 'Multipolygon diff moved point of inner way case (Tags from relation)', | |
'SELECT round(ST_Area(way)) FROM planet_osm_polygon WHERE osm_id = -1 and landuse = \'residential\' and name = \'Name_rel\'', 13949), | |
( 68, 'Multipolygon point of inner way case (Tags from relation)', | |
'SELECT round(ST_Area(way)) FROM planet_osm_polygon WHERE osm_id = -25 and landuse = \'farmland\' and name = \'my name\'', 23886), | |
( 69, 'Multipolygon point of inner way case (Tags from relation)', | |
'SELECT count(*) FROM planet_osm_polygon WHERE osm_id = 90', 0), | |
( 70, 'Multipolygon diff remove relation (tagged outer way gets re added)', | |
'SELECT round(ST_Area(way)) FROM planet_osm_polygon WHERE osm_id = 90 and landuse = \'farmland\'', 32626), | |
( 71, 'Multipolygon diff remove relation', | |
'SELECT count(*) FROM planet_osm_polygon WHERE osm_id = -25', 0), | |
( 72, 'Multipolygon tags on both inner and outer (presence of relation)', | |
'SELECT round(ST_Area(way)) FROM planet_osm_polygon WHERE osm_id = -34 and "natural" = \'water\'', 15246), | |
( 73, 'Multipolygon tags on both inner and outer (abscence of outer)', | |
'SELECT count(*) FROM planet_osm_polygon WHERE osm_id = 113', 0), | |
( 74, 'Multipolygon tags on both inner and outer (abscence of inner)', | |
'SELECT count(*) FROM planet_osm_polygon WHERE osm_id = 118', 0), | |
( 75, 'Multipolygon tags on both inner and outer diff change outer (presence of relation)', | |
'SELECT round(ST_Area(way)) FROM planet_osm_polygon WHERE osm_id = -34 and "landuse" = \'farmland\'', 15246), | |
( 76, 'Multipolygon tags on both inner and outer diff change outer (abscence of outer)', | |
'SELECT count(*) FROM planet_osm_polygon WHERE osm_id = 113', 0), | |
( 77, 'Multipolygon tags on both inner and outer diff change on outer (creation of inner)', | |
'SELECT round(ST_Area(way)) FROM planet_osm_polygon WHERE osm_id = 118 and "natural" = \'water\'', 1234), | |
( 78, 'Multipolygon tags on outer (presence of relation)', | |
'SELECT round(ST_Area(way)) FROM planet_osm_polygon WHERE osm_id = -33 and "natural" = \'water\'', 15612), | |
( 79, 'Multipolygon tags on outer (abscence of outer)', | |
'SELECT count(*) FROM planet_osm_polygon WHERE osm_id = 114', 0), | |
( 80, 'Multipolygon tags on outer change of way tags (presence of relation)', | |
'SELECT round(ST_Area(way)) FROM planet_osm_polygon WHERE osm_id = -33 and "landuse" = \'cemetery\'', 15612), | |
( 81, 'Multipolygon tags on outer (abscence of old relation)', | |
'SELECT count(*) FROM planet_osm_polygon WHERE osm_id = -33 and "natural" = \'water\'', 0), | |
( 82, 'Multipolygon tags on relation two outer (presence of relation)', | |
'SELECT round(sum(ST_Area(way))) FROM planet_osm_polygon WHERE osm_id = -29 and "natural" = \'water\'', 68492), | |
( 83, 'Multipolygon tags on relation two outer (abscence of outer)', | |
'SELECT count(*) FROM planet_osm_polygon WHERE osm_id = 109', 0), | |
( 84, 'Multipolygon tags on relation two outer (abscence of outer)', | |
'SELECT count(*) FROM planet_osm_polygon WHERE osm_id = 104', 0), | |
( 85, 'Multipolygon tags on relation two outer diff delete way (presence of relation)', | |
'SELECT round(ST_Area(way)) FROM planet_osm_polygon WHERE osm_id = -29 and "natural" = \'water\'', 29154), | |
( 86, 'Multipolygon tags on relation two outer (presence of relation)', | |
'SELECT round(sum(ST_Area(way))) FROM planet_osm_polygon WHERE osm_id = -35 and "natural" = \'water\'', 28730), | |
( 87, 'Multipolygon tags on relation two outer (abscence of outer)', | |
'SELECT count(*) FROM planet_osm_polygon WHERE osm_id = 107', 0), | |
( 88, 'Multipolygon tags on relation two outer (abscence of outer)', | |
'SELECT count(*) FROM planet_osm_polygon WHERE osm_id = 102', 0), | |
( 89, 'Multipolygon tags on relation two outer diff remove way from relation (presence of relation)', | |
'SELECT round(ST_Area(way)) FROM planet_osm_polygon WHERE osm_id = -35 and "natural" = \'water\'', 15736), | |
( 90, 'Multipolygon tags on relation two outer diff remove way from relation (presence of single way)', | |
'SELECT round(ST_Area(way)) FROM planet_osm_polygon WHERE osm_id = 102 and "natural" = \'water\'', 12994), | |
( 91, 'Basic line length', 'SELECT round(sum(ST_Length(way))) FROM planet_osm_line;', 4269394), | |
( 92, 'Basic line length', 'SELECT round(sum(ST_Length(way))) FROM planet_osm_roads;', 2032023), | |
( 93, 'Basic number of hstore points tags', 'SELECT sum(array_length(akeys(tags),1)) FROM planet_osm_point;', 4228), | |
( 94, 'Basic number of hstore roads tags', 'SELECT sum(array_length(akeys(tags),1)) FROM planet_osm_roads;', 2316), | |
( 95, 'Basic number of hstore lines tags', 'SELECT sum(array_length(akeys(tags),1)) FROM planet_osm_line;', 10897), | |
( 96, 'Basic number of hstore polygons tags', 'SELECT sum(array_length(akeys(tags),1)) FROM planet_osm_polygon;', 9540), | |
( 97, 'Diff import number of hstore points tags', 'SELECT sum(array_length(akeys(tags),1)) FROM planet_osm_point;', 4352), | |
( 98, 'Diff import number of hstore roads tags', 'SELECT sum(array_length(akeys(tags),1)) FROM planet_osm_roads;', 2340), | |
( 99, 'Diff import number of hstore lines tags', 'SELECT sum(array_length(akeys(tags),1)) FROM planet_osm_line;', 11020), | |
( 100, 'Diff import number of hstore polygons tags', 'SELECT sum(array_length(akeys(tags),1)) FROM planet_osm_polygon;', 9834), | |
#**** Tests to check if inner polygon appears when outer tags change after initially identicall inner and outer way tags in a multi-polygon **** | |
#**** These tests are currently broken and noted in trac ticket #2853 **** | |
( 101, 'Multipolygon identical tags on inner and outer (presence of relation)', | |
'SELECT round(sum(ST_Area(way))) FROM planet_osm_polygon WHERE osm_id = -31 and "natural" = \'heath\'', 32702), | |
( 102, 'Multipolygon identical tags on inner and outer (abscence of outer)', | |
'SELECT count(*) FROM planet_osm_polygon WHERE osm_id = 120', 0), | |
( 103, 'Multipolygon identical tags on inner and outer (abscence of inner)', | |
'SELECT count(*) FROM planet_osm_polygon WHERE osm_id = 112', 0), | |
( 104, 'Multipolygon identical tags on inner and outer (presence of relation), post diff', | |
'SELECT round(sum(ST_Area(way))) FROM planet_osm_polygon WHERE osm_id = -31 and "natural" = \'water\'', 32702), | |
( 105, 'Multipolygon identical tags on inner and outer (presece of inner)', | |
'SELECT round(sum(ST_Area(way))) FROM planet_osm_polygon WHERE osm_id = 112 and "natural" = \'heath\'', 1234), | |
#**** Test to check that only polygon tags that are present on all outer ways get copied over to the multi-polygon relation **** | |
( 106, 'Multipolygon copy outer tags (presence of relation)', | |
'SELECT round(sum(ST_Area(way))) FROM planet_osm_polygon WHERE osm_id = -38 and "natural" = \'water\'', 29340), | |
( 107, 'Multipolygon copy outer tags (absence of partial outer tags)', | |
'SELECT count(*) FROM planet_osm_polygon WHERE osm_id = -38 and "natural" = \'water\' and "man_made" = \'pier\'', 0), | |
( 108, 'Multipolygon copy outer tags (absence of multi-polygon tagged outer way)', | |
'SELECT count(*) FROM planet_osm_line WHERE osm_id = 134 OR osm_id = 133', 0), | |
( 109, 'Multipolygon copy outer tags (presence of additionally tagged outer way)', | |
'SELECT round(sum(ST_length(way))) FROM planet_osm_line WHERE (osm_id = 136 OR osm_id = 132) AND "man_made" = \'pier\'', 407), | |
( 110, 'Multipolygon copy outer tags (presence of relation)', | |
'SELECT round(sum(ST_Area(way))) FROM planet_osm_polygon WHERE osm_id = -37 and "natural" = \'water\'', 29952), | |
( 111, 'Multipolygon copy outer tags (absence of partial outer tags)', | |
'SELECT count(*) FROM planet_osm_polygon WHERE osm_id = -37 and "natural" = \'water\' and "man_made" = \'pier\'', 0), | |
( 112, 'Multipolygon copy outer tags (absence of multi-polygon tagged outer way)', | |
'SELECT count(*) FROM planet_osm_line WHERE osm_id = 128 OR osm_id = 125', 0), | |
( 113, 'Multipolygon copy outer tags (presence of additionally tagged outer way)', | |
'SELECT round(sum(ST_length(way))) FROM planet_osm_line WHERE (osm_id = 126 OR osm_id = 124) AND "man_made" = \'pier\'', 276), | |
( 114, 'Multipolygon copy outer tags (absence of multi-polygon tagged inner way)', | |
'SELECT count(*) FROM planet_osm_line WHERE osm_id = 123 OR osm_id = 121', 0), | |
( 115, 'Multipolygon copy outer tags (presence of additionally tagged inner way)', | |
'SELECT round(sum(ST_length(way))) FROM planet_osm_line WHERE (osm_id = 127 OR osm_id = 122) AND "man_made" = \'pier\'', 318), | |
#**** Test to check that if polygon tags are on both outer ways and relation, polygons don't get duplicated in the db **** | |
( 116, 'Multipolygon tags on both outer and relation (presence of relation)', | |
'SELECT round(sum(ST_Area(way))) FROM planet_osm_polygon WHERE osm_id = -39 and "landuse" = \'forest\'', 10379), | |
( 117, 'Multipolygon tags on both outer and relation (absence of outer way)', | |
'SELECT count(*) FROM planet_osm_polygon WHERE osm_id = 138', 0), | |
( 118, 'Multipolygon tags on both outer and relation with additional tags on relation (presence of relation)', | |
'SELECT round(sum(ST_Area(way))) FROM planet_osm_polygon WHERE osm_id = -40 and "landuse" = \'forest\'', 12397), | |
( 119, 'Multipolygon tags on both outer and relation with additional tags on relation (absence of outer way)', | |
'SELECT count(*) FROM planet_osm_polygon WHERE osm_id = 140', 0), | |
] | |
class NonSlimRenderingTestSuite(unittest.TestSuite): | |
def __init__(self): | |
unittest.TestSuite.__init__(self,map(ThirdTestCase, | |
("testOne", | |
"testTwo"))) | |
self.addTest(BasicNonSlimTestCase("basic case",[], [0,1,2,3,10,13, 91, 92])) | |
self.addTest(BasicNonSlimTestCase("slim --drop case",["--slim","--drop"], [0,1,2,3, 10, 11, 12, 13, 91, 92])) | |
self.addTest(BasicNonSlimTestCase("Hstore index drop", ["--slim", "--hstore", "--hstore-add-index", "--drop"], [51,52,53,54])) | |
self.addTest(BasicNonSlimTestCase("lat lon projection",["-l"], [0,4,5,3,10, 11, 12])) | |
#Failing test 3,13 due to difference in handling mixture of tags on ways and relations, where the correct behaviour is non obvious | |
#self.addTest(BasicNonSlimTestCase("--tag-transform-script", ["--tag-transform-script", "style.lua"], [0,1,2,3,10,13,91,92])) | |
self.addTest(BasicNonSlimTestCase("--tag-transform-script", ["--tag-transform-script", "style.lua"], [0,1,2,10,91,92])) | |
class SlimRenderingTestSuite(unittest.TestSuite): | |
def __init__(self): | |
unittest.TestSuite.__init__(self,map(ThirdTestCase, | |
("testOne", | |
"testTwo"))) | |
self.addTest(BasicSlimTestCase("basic case", [], [0,1,2,3,13, 91, 92],[6,7,8,9])) | |
self.addTest(BasicSlimTestCase("Parallel processing", ["--number-processes", "8", "-C100"], [0,1,2,3,13,91,92],[6,7,8,9])) | |
self.addTest(BasicSlimTestCase("Parallel processing with non 100% node-cache", ["--number-processes", "8", "-C1", "--cache-strategy=dense"], [0,1,2,3,13,91,92],[6,7,8,9])) | |
self.addTest(BasicSlimTestCase("Parallel processing with disabled node-cache", ["-C0"], [0,1,2,3,13,91,92],[6,7,8,9])) | |
# Failes to do correct error checking. This needs fixing in osm2pgsql | |
# self.addTest(BasicSlimTestCase("Parallel processing with failing database conneciton (connection limit exceeded)", ["--number-processes", "32", "-C100"], [0,1,2,3],[6,7,8,9])) | |
# Counts are expected to be different in hstore, needs adjusted tests | |
self.addTest(BasicSlimTestCase("Hstore match only", ["-k", "--hstore-match-only"], [0,1,2,3],[6,7,8,9])) | |
self.addTest(BasicSlimTestCase("Hstore name column", ["-z", "name:"], [0,1,2,3],[6,7,8,9])) | |
self.addTest(BasicSlimTestCase("Hstore", ["-k"], [51,52,53,54],[55,56,57,58])) | |
self.addTest(BasicSlimTestCase("Hstore all", ["-j"], [51,52,53,54,93,94,95,96],[55,56,57,58, 97, 98, 99, 100])) | |
self.addTest(BasicSlimTestCase("Hstore index", ["--hstore", "--hstore-add-index"], [51,52,53,54],[55,56,57,58])) | |
#tests dont check for osm_timestamp which is currently missing in the pbf parser | |
self.addTest(BasicSlimTestCase("Extra tags hstore match only", ["-x", "-k", "--hstore-match-only"], [0,1,2,3],[6,7,8,9])) | |
self.addTest(BasicSlimTestCase("Extra tags hstore all", ["-j", "-x"], [51,52,53,54,59,60,61],[55,56,57,58])) | |
self.addTest(BasicSlimTestCase("--tablespace-main-data", ["--tablespace-main-data", "tablespacetest"], [0,1,2,3,13,91,92],[6,7,8,9])) | |
self.addTest(BasicSlimTestCase("--tablespace-main-index", ["--tablespace-main-index", "tablespacetest"], [0,1,2,3,13,91,92],[6,7,8,9])) | |
self.addTest(BasicSlimTestCase("--tablespace-slim-data", ["--tablespace-slim-data", "tablespacetest"], [0,1,2,3,13,91,92],[6,7,8,9])) | |
self.addTest(BasicSlimTestCase("--tablespace-slim-index", ["--tablespace-slim-index", "tablespacetest"], [0,1,2,3,13,91,92],[6,7,8,9])) | |
#Failing test 3,13,9 due to difference in handling mixture of tags on ways and relations, where the correct behaviour is non obvious | |
#self.addTest(BasicNonSlimTestCase("--tag-transform-script", ["--tag-transform-script", "style.lua"], [0,1,2,3,10,13,91,92])) | |
self.addTest(BasicSlimTestCase("--tag-transform-script", ["--tag-transform-script", "style.lua"], [0,1,2,91,92],[6,7,8])) | |
class SlimGazetteerTestSuite(unittest.TestSuite): | |
def __init__(self): | |
unittest.TestSuite.__init__(self,map(ThirdTestCase, | |
("testOne", | |
"testTwo"))) | |
self.addTest(BasicGazetteerTestCase("basic case", [], [14,15,16,17,22,24],[18,19,20,21,23,25])) | |
class MultiPolygonSlimRenderingTestSuite(unittest.TestSuite): | |
def __init__(self): | |
unittest.TestSuite.__init__(self,map(ThirdTestCase, | |
("testOne", | |
"testTwo"))) | |
#Case 77 currently doesn't work | |
self.addTest(MultipolygonSlimTestCase("basic case", [], | |
[26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42, 43, 44, 47, 48, 62, 63, 64, 65, 68, 69, 72, 73, 74, 78, 79, 82, 83, 84, 86, 87, 88, | |
106,107,108,109,110,111,112,113,114,115,116,117,118,119], | |
[28,29,30,31,32,33,34,35,36,37,38,39,40,41,42, 43, 44, 47, 48, 62, 63, 64, 65, 66, 67, 70, 71, 75, 76, 79, 80, 81, 83, 84, 85, 87, 89, 90])) | |
self.addTest(MultipolygonSlimTestCase("multi geometry", ["-G"], | |
[26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42, 43, 45, 46, 47, 49, 50, 62, 63, 64, 65, 68, 69, 72, 73, 74, 78, 79, 82, 83, 84, 86, 87, 88, | |
106,107,108,109,110,111,112,113,114,115,116,117,118,119], | |
[28,29,30,31,32,33,34,35,36,37,38,39,40,41,42, 43, 45, 46, 47, 49, 50, 62, 63, 64, 65, 66, 67, 70, 71, 75, 76, 79, 80, 81, 83, 84, 85, 87, 89, 90])) | |
self.addTest(MultipolygonSlimTestCase("hstore case", ["-k"], | |
[26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,47,48,62,63,64,65,68,69, 72, 73, 74, 78, 79, 82, 83, 84, 86, 87, 88, | |
106,107,108,109,110,111,112,113,114,115,116,117,118,119], | |
[28,29,30,31,32,33,34,35,36,37,38,39,40,41,42, 43, 44, 47, 48, 62, 63, 64, 65, 66, 67, 70, 71, 75, 76, 79, 80, 81, 83, 84, 85, 87, 89, 90])) | |
self.addTest(MultipolygonSlimTestCase("hstore case", ["-k", "--hstore-match-only"], | |
[26,27,28,29,30,31,32,33,34,35,36,37,38, 39, 40,41,42, 43, 44, 47, 48, 62, 63, 64, 65, 68, 69, 72, 73, 74, 78, 79, 82, 83, 84, 86, 87, 88, | |
106,107,108,109,110,111,112,113,114,115,116,117,118,119], | |
[28,29,30,31,32,33,34,35,36,37,38,39,40,41,42, 43, 44, 47, 48, 62, 63, 64, 65, 66, 67, 70, 71, 75, 76, 79, 80, 81, 83, 84, 85, 87, 89, 90])) | |
self.addTest(MultipolygonSlimTestCase("Extra tags hstore match only", ["-x", "-k", "--hstore-match-only"], | |
[26,27,28,29,30,31,32,33,34,35,36,37,38, 39, 40,41,42, 43, 44, 47, 48, 62, 63, 64, 65, 68, 69, 72, 73, 74, 78, 79, 82, 83, 84, 86, 87, 88, | |
106,107,108,109,110,111,112,113,114,115,116,117,118,119], | |
[28,29,30,31,32,33,34,35,36,37,38,39,40,41,42, 43, 44, 47, 48, 62, 63, 64, 65, 66, 67, 70, 71, 75, 76, 79, 80, 81, 83, 84, 85, 87, 89, 90])) | |
self.addTest(MultipolygonSlimTestCase("Extra tags hstore match only", ["-x", "-j"], | |
[26,27,28,29,30,31,32,33,34,35,36,37,38, 39, 40,41,42, 43, 44, 47, 48, 62, 63, 64, 65, 68, 69, 72, 73, 74, 78, 79, 82, 83, 84, 86, 87, 88, | |
106,107,108,109,110,111,112,113,114,115,116,117,118,119], | |
[28,29,30,31,32,33,34,35,36,37,38,39,40,41,42, 43, 44, 47, 48, 62, 63, 64, 65, 66, 67, 70, 71, 75, 76, 79, 80, 81, 83, 84, 85, 87, 89, 90])) | |
self.addTest(MultipolygonSlimTestCase("lua tagtransform case", ["--tag-transform-script", "style.lua"], | |
[26,27,28,29,30,31,32,33,34,35,36,37,38, 39, 40, 41, 42, 43, 44, 47, 48, 62, 64, 65,68,69, 72, 73, 74, 78, 79, 82, 83, 84, 86, 87, 88,116,117,118,119], | |
[28,29,30,31,32,33,34,35,36,37,38,39,40,41,42, 43, 44, 47, 48, 62, 63,64, 65, 66, 67, 70, 71, 75, 76, 79, 80, 81, 83, 84, 85, 87, 89, 90])) | |
self.addTest(MultipolygonSlimTestCase("lua tagtransform case with hstore", ["--tag-transform-script", "style.lua", "-k"], | |
[26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,47,48,62,63,64,65,68,69,72,73,74,78,79,82,83,84,86,87,88,116,117,118,119], | |
[28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,47,48,62,63,64,65,66,67,70,71,75,76,79,80,81,83,84,85,87,89,90])) | |
class CompleteTestSuite(unittest.TestSuite): | |
def __init__(self): | |
unittest.TestSuite.__init__(self, map(ThirdTestCase, | |
("testOne", | |
"testTwo"))) | |
self.addTest(NonSlimRenderingTestSuite()) | |
self.addTest(SlimRenderingTestSuite()) | |
self.addTest(MultiPolygonSlimRenderingTestSuite()) | |
self.addTest(SlimGazetteerTestSuite()) | |
class ThirdTestCase(unittest.TestCase): | |
def testOne(self): | |
assert 1 == 1 | |
def testTwo(self): | |
assert 2 == 2 | |
class BaseTestCase(unittest.TestCase): | |
def dbConnect(self): | |
try: | |
self.conn=psycopg2.connect(conn_str + "dbname='osm2pgsql-test'") | |
self.conn.autocommit = True | |
self.cur = self.conn.cursor() | |
except Exception, e: | |
print "I am unable to connect to the database." + e | |
def dbClose(self): | |
self.cur.close() | |
self.conn.close() | |
def executeStatements(self, seq): | |
print "*********************************" | |
self.dbConnect() | |
try: | |
for i in seq: | |
self.assertEqual(sql_test_statements[i][0], i, "test case numbers don't match up: " + str(i) + " =/=" + str(sql_test_statements[i][0])) | |
try: | |
self.cur.execute(sql_test_statements[i][2]) | |
res = self.cur.fetchall() | |
except Exception, e: | |
self.assertEqual(0, 1, str(sql_test_statements[i][0]) + ": Failed to execute " + sql_test_statements[i][1] + | |
" (" + sql_test_statements[i][2] + ") {" + str(self.parameters) +"}") | |
if (res == None): | |
self.assertEqual(0, 1, str(sql_test_statements[i][0]) + ": Sql statement returned no results: " + | |
sql_test_statements[i][1] + " (" + sql_test_statements[i][2] + ") {" + str(self.parameters) +"}") | |
self.assertEqual(len(res), 1, str(sql_test_statements[i][0]) + ": Sql statement returned more than one result: " + | |
str(res) + " -- " + sql_test_statements[i][1] + " (" + sql_test_statements[i][2] + ") {" + str(self.parameters) +"}") | |
self.assertEqual( res[0][0], sql_test_statements[i][3], | |
str(sql_test_statements[i][0]) + ": Failed " + sql_test_statements[i][1] + ", expected " + str(sql_test_statements[i][3]) + " but was " + str(res[0][0]) + | |
" (" + sql_test_statements[i][2] + ") {" + str(self.parameters) +"}") | |
finally: | |
self.dbClose() | |
class BaseNonSlimTestCase(BaseTestCase): | |
def setUpGeneric(self, parameters, file): | |
proc = subprocess.Popen(["osm2pgsql", "-Sdefault.style", "-dosm2pgsql-test", "-C100"] + credentials + parameters + [full_import_file], stdout=subprocess.PIPE, stderr=subprocess.PIPE) | |
(outp, outerr) = proc.communicate() | |
self.assertEqual (proc.returncode, 0, "Execution of osm2pgsql with options: '%s' failed:\n%s\n%s\n" % (str(parameters), outp, outerr)) | |
class BaseSlimTestCase(BaseTestCase): | |
def setUpGeneric(self, parameters, file): | |
proc = subprocess.Popen(["osm2pgsql", "--slim", "-Sdefault.style", "-dosm2pgsql-test", "-C100"] + credentials + parameters + [file], stdout=subprocess.PIPE, stderr=subprocess.PIPE) | |
(outp, outerr) = proc.communicate() | |
self.assertEqual (proc.returncode, 0, "Execution of osm2pgsql --slim with options: '%s' failed:\n%s\n%s\n" % (str(parameters), outp, outerr)) | |
def updateGeneric(self, parameters, file): | |
proc = subprocess.Popen(["osm2pgsql", "--slim", "--append", "-Sdefault.style", "-dosm2pgsql-test", "-C100"] + credentials + parameters + [file], stdout=subprocess.PIPE, stderr=subprocess.PIPE) | |
(outp, outerr) = proc.communicate() | |
self.assertEqual (proc.returncode, 0, "Execution of osm2pgsql --slim --append with options: '%s' failed:\n%s\n%s\n" % (str(parameters), outp, outerr)) | |
class BaseGazetteerTestCase(BaseTestCase): | |
def setUpGeneric(self, parameters, file): | |
proc = subprocess.Popen(["osm2pgsql", "--slim", "-Ogazetteer", "-Sdefault.style", "-dosm2pgsql-test"] + credentials + parameters + [file], stdout=subprocess.PIPE, stderr=subprocess.PIPE) | |
(outp, outerr) = proc.communicate() | |
self.assertEqual (proc.returncode, 0, "Execution of osm2pgsql --slim gazetteer options: '%s' failed:\n%s\n%s\n" % (str(parameters), outp, outerr)) | |
def updateGeneric(self, parameters, file): | |
proc = subprocess.Popen(["osm2pgsql", "--slim", "-Ogazetteer", "--append", "-Sdefault.style", "-dosm2pgsql-test"] + credentials + parameters + [file], stdout=subprocess.PIPE, stderr=subprocess.PIPE) | |
(outp, outerr) = proc.communicate() | |
self.assertEqual (proc.returncode, 0, "Execution of osm2pgsql --slim --append gazetteer options: '%s' failed:\n%s\n%s\n" % (str(parameters), outp, outerr)) | |
class BasicNonSlimTestCase(BaseNonSlimTestCase): | |
def __init__(self, name, parameters, initialStatements): | |
BaseNonSlimTestCase.__init__(self) | |
self.name = name | |
self.parameters = parameters | |
self.initialStatements = initialStatements | |
def setUp(self): | |
self.setUpGeneric(self.parameters, full_import_file) | |
def runTest(self): | |
print "****************************************" | |
print "Running initial import for " + self.name | |
self.executeStatements(self.initialStatements) | |
class BasicSlimTestCase(BaseSlimTestCase): | |
def __init__(self, name, parameters, initialStatements, postDiffStatements): | |
BaseSlimTestCase.__init__(self) | |
self.name = name | |
self.parameters = parameters | |
self.initialStatements = initialStatements | |
self.postDiffStatements = postDiffStatements | |
def setUp(self): | |
self.setUpGeneric(self.parameters, full_import_file) | |
def runTest(self): | |
print "****************************************" | |
print "Running initial import for " + self.name | |
self.executeStatements(self.initialStatements) | |
print "Running diff-import for " + self.name | |
self.updateGeneric(self.parameters, diff_import_file) | |
self.executeStatements(self.postDiffStatements) | |
class MultipolygonSlimTestCase(BaseSlimTestCase): | |
def __init__(self, name, parameters, initialStatements, postDiffStatements): | |
BaseSlimTestCase.__init__(self) | |
self.name = name | |
self.parameters = parameters | |
self.initialStatements = initialStatements | |
self.postDiffStatements = postDiffStatements | |
def setUp(self): | |
self.setUpGeneric(self.parameters, multipoly_import_file) | |
def runTest(self): | |
print "****************************************" | |
print "Running initial import for " + self.name | |
self.executeStatements(self.initialStatements) | |
print "Running diff-import for " + self.name | |
self.updateGeneric(self.parameters, diff_multipoly_import_file) | |
self.executeStatements(self.postDiffStatements) | |
class BasicGazetteerTestCase(BaseGazetteerTestCase): | |
def __init__(self, name, parameters, initialStatements, postDiffStatements): | |
BaseGazetteerTestCase.__init__(self) | |
self.name = name | |
self.parameters = parameters | |
self.initialStatements = initialStatements | |
self.postDiffStatements = postDiffStatements | |
def setUp(self): | |
self.setUpGeneric(self.parameters, full_import_file) | |
def runTest(self): | |
print "****************************************" | |
print "Running initial import in gazetteer mode for " + self.name | |
self.executeStatements(self.initialStatements) | |
print "Running diff-import in gazetteer mode for " + self.name | |
self.updateGeneric(self.parameters, diff_import_file) | |
self.executeStatements(self.postDiffStatements) | |
def setupDB(): | |
print "Setting up test database" | |
try: | |
gen_conn=psycopg2.connect(conn_str + "dbname='template1'") | |
gen_conn.autocommit = True | |
except Exception, e: | |
print "I am unable to connect to the database." | |
exit() | |
try: | |
gen_cur = gen_conn.cursor() | |
except Exception, e: | |
gen_conn.close() | |
print "I am unable to connect to the database." | |
exit() | |
try: | |
gen_cur.execute("""DROP DATABASE IF EXISTS \"osm2pgsql-test\"""") | |
gen_cur.execute("""CREATE DATABASE \"osm2pgsql-test\" WITH ENCODING 'UTF8'""") | |
except Exception, e: | |
print "Failed to create osm2pgsql-test db" + e.pgerror | |
exit(); | |
finally: | |
gen_cur.close() | |
gen_conn.close() | |
try: | |
test_conn=psycopg2.connect(conn_str + "dbname='osm2pgsql-test'") | |
test_conn.autocommit = True | |
except Exception, e: | |
print "I am unable to connect to the database." + e | |
exit() | |
try: | |
test_cur = test_conn.cursor() | |
except Exception, e: | |
print "I am unable to connect to the database." + e | |
gen_conn.close() | |
exit() | |
try: | |
try: | |
global created_tablespace | |
test_cur.execute("""SELECT spcname FROM pg_tablespace WHERE spcname = 'tablespacetest'""") | |
if test_cur.fetchone(): | |
print "We already have a tablespace, can use that" | |
created_tablespace = 0 | |
else: | |
print "For the test, we need to create a tablespace. This needs root privileges" | |
created_tablespace = 1 | |
### This makes postgresql read from /tmp | |
## Does this have security implications like opening this to a possible symlink attack? | |
try: | |
os.mkdir(tmp_table) | |
if not os.name is 'nt': | |
returncode = subprocess.call(["/usr/bin/sudo", "/bin/chown", "postgres.postgres", tmp_table]) | |
test_cur.execute("""CREATE TABLESPACE tablespacetest LOCATION '{}'""".format(tmp_table)) | |
except Exception, e: | |
os.rmdir(tmp_table) | |
self.assertEqual(0, 1, msg="Failed to create tablespace") | |
except Exception, e: | |
print "Failed to create directory for tablespace" + str(e) | |
try: | |
test_cur.execute("""CREATE EXTENSION postgis;""") | |
except: | |
test_conn.rollback() | |
# Guess the directory from the postgres version. | |
# TODO: make the postgisdir configurable. Probably | |
# only works on Debian-based distributions at the moment. | |
if not os.name is 'nt': | |
postgisdir = ('/usr/share/postgresql/%d.%d/contrib' % | |
(test_conn.server_version / 10000, (test_conn.server_version / 100) % 100)) | |
for fl in os.listdir(postgisdir): | |
if fl.startswith('postgis'): | |
newdir = os.path.join(postgisdir, fl) | |
if os.path.isdir(newdir): | |
postgisdir = newdir | |
break | |
else: | |
raise Exception('Cannot find postgis directory.') | |
pgscript = open(os.path.join(postgisdir, 'postgis.sql'),'r').read() | |
test_cur.execute(pgscript) | |
pgscript = open(os.path.join(postgisdir, 'spatial_ref_sys.sql'), 'r').read() | |
test_cur.execute(pgscript) | |
try: | |
test_cur.execute("""CREATE EXTENSION hstore;""") | |
except Exception, e: | |
print "I am unable to create extensions: " + e.pgerror | |
exit() | |
finally: | |
test_cur.close() | |
test_conn.close() | |
def tearDownDB(): | |
print "Cleaning up test database" | |
try: | |
gen_conn=psycopg2.connect(conn_str + "dbname='template1'") | |
gen_conn.autocommit = True | |
gen_cur = gen_conn.cursor() | |
except Exception, e: | |
print "I am unable to connect to the database." | |
exit() | |
try: | |
gen_cur.execute("""DROP DATABASE IF EXISTS \"osm2pgsql-test\"""") | |
if (created_tablespace == 1): | |
gen_cur.execute("""DROP TABLESPACE IF EXISTS \"tablespacetest\"""") | |
except Exception, e: | |
print "Failed to clean up osm2pgsql-test db" + e.pgerror | |
exit(); | |
gen_cur.close() | |
gen_conn.close() | |
if (created_tablespace == 1): | |
if os.name is 'nt': | |
if os.path.exists(tmp_table): | |
os.rmdir(tmp_table) | |
else: | |
returncode = subprocess.call(["/usr/bin/sudo", "/bin/rmdir", tmp_table]) | |
if __name__ == "__main__": | |
from optparse import OptionParser | |
parser = OptionParser() | |
parser.add_option("-f", dest="osm_file", action="store", metavar="FILE", | |
default=full_import_file, | |
help="Import a specific osm file [default=%default]") | |
(options, args) = parser.parse_args() | |
if options.osm_file: | |
full_import_file = options.osm_file | |
ts2 = CompleteTestSuite() | |
try: | |
setupDB() | |
runner = unittest.TextTestRunner() | |
runner.run(ts2) | |
finally: | |
tearDownDB() |
This file contains hidden or 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
Microsoft Windows [Version 6.3.9600] | |
(c) Корпорация Майкрософт (Microsoft Corporation), 2013. Все права защищены. | |
V:\build18_r>test | |
V:\build18_r>rem set PATH=V:\build18_r\osm2pgsql-bin;C:\Python34 | |
V:\build18_r>set PATH=V:\build18_r\osm2pgsql-bin;C:\Python27 | |
V:\build18_r>echo V:\build18_r | |
V:\build18_r | |
V:\build18_r>cd osm2pgsql/tests | |
V:\build18_r\osm2pgsql\tests>rem python tests/regression-test3.py | |
V:\build18_r\osm2pgsql\tests>copy /y ..\style.lua . | |
Скопировано файлов: 1. | |
V:\build18_r\osm2pgsql\tests>copy /y ..\default.style . | |
Скопировано файлов: 1. | |
V:\build18_r\osm2pgsql\tests>copy /y ..\..\*.py . | |
..\..\regression-test.py | |
..\..\regression-test3.py | |
Скопировано файлов: 2. | |
V:\build18_r\osm2pgsql\tests>rem osm2pgsql -l liechtenstein-2013-08-03.osm.pbf -U postgres -d osm | |
V:\build18_r\osm2pgsql\tests>python regression-test.py | |
Setting up test database | |
We already have a tablespace, can use that | |
....**************************************** | |
Running initial import for basic case | |
********************************* | |
.**************************************** | |
Running initial import for slim --drop case | |
********************************* | |
.**************************************** | |
Running initial import for Hstore index drop | |
********************************* | |
.**************************************** | |
Running initial import for lat lon projection | |
********************************* | |
.**************************************** | |
Running initial import for --tag-transform-script | |
********************************* | |
...**************************************** | |
Running initial import for basic case | |
********************************* | |
Running diff-import for basic case | |
********************************* | |
.**************************************** | |
Running initial import for Parallel processing | |
********************************* | |
Running diff-import for Parallel processing | |
********************************* | |
.**************************************** | |
Running initial import for Parallel processing with non 100% node-cache | |
********************************* | |
Running diff-import for Parallel processing with non 100% node-cache | |
********************************* | |
.**************************************** | |
Running initial import for Parallel processing with disabled node-cache | |
********************************* | |
Running diff-import for Parallel processing with disabled node-cache | |
********************************* | |
.**************************************** | |
Running initial import for Hstore match only | |
********************************* | |
Running diff-import for Hstore match only | |
********************************* | |
.**************************************** | |
Running initial import for Hstore name column | |
********************************* | |
Running diff-import for Hstore name column | |
********************************* | |
.**************************************** | |
Running initial import for Hstore | |
********************************* | |
Running diff-import for Hstore | |
********************************* | |
.**************************************** | |
Running initial import for Hstore all | |
********************************* | |
Running diff-import for Hstore all | |
********************************* | |
.**************************************** | |
Running initial import for Hstore index | |
********************************* | |
Running diff-import for Hstore index | |
********************************* | |
.**************************************** | |
Running initial import for Extra tags hstore match only | |
********************************* | |
Running diff-import for Extra tags hstore match only | |
********************************* | |
.**************************************** | |
Running initial import for Extra tags hstore all | |
********************************* | |
Running diff-import for Extra tags hstore all | |
********************************* | |
.**************************************** | |
Running initial import for --tablespace-main-data | |
********************************* | |
Running diff-import for --tablespace-main-data | |
********************************* | |
.**************************************** | |
Running initial import for --tablespace-main-index | |
********************************* | |
Running diff-import for --tablespace-main-index | |
********************************* | |
.**************************************** | |
Running initial import for --tablespace-slim-data | |
********************************* | |
Running diff-import for --tablespace-slim-data | |
********************************* | |
.**************************************** | |
Running initial import for --tablespace-slim-index | |
********************************* | |
Running diff-import for --tablespace-slim-index | |
********************************* | |
.**************************************** | |
Running initial import for --tag-transform-script | |
********************************* | |
Running diff-import for --tag-transform-script | |
********************************* | |
...**************************************** | |
Running initial import for basic case | |
********************************* | |
Running diff-import for basic case | |
********************************* | |
F**************************************** | |
Running initial import for multi geometry | |
********************************* | |
Running diff-import for multi geometry | |
********************************* | |
F**************************************** | |
Running initial import for hstore case | |
********************************* | |
Running diff-import for hstore case | |
********************************* | |
F**************************************** | |
Running initial import for hstore case | |
********************************* | |
Running diff-import for hstore case | |
********************************* | |
F**************************************** | |
Running initial import for Extra tags hstore match only | |
********************************* | |
Running diff-import for Extra tags hstore match only | |
********************************* | |
F**************************************** | |
Running initial import for Extra tags hstore match only | |
********************************* | |
Running diff-import for Extra tags hstore match only | |
********************************* | |
F**************************************** | |
Running initial import for lua tagtransform case | |
********************************* | |
Running diff-import for lua tagtransform case | |
********************************* | |
F**************************************** | |
Running initial import for lua tagtransform case with hstore | |
********************************* | |
Running diff-import for lua tagtransform case with hstore | |
********************************* | |
F..**************************************** | |
Running initial import in gazetteer mode for basic case | |
********************************* | |
Running diff-import in gazetteer mode for basic case | |
********************************* | |
. | |
====================================================================== | |
FAIL: runTest (__main__.MultipolygonSlimTestCase) | |
---------------------------------------------------------------------- | |
Traceback (most recent call last): | |
File "regression-test.py", line 464, in runTest | |
self.executeStatements(self.postDiffStatements) | |
File "regression-test.py", line 367, in executeStatements | |
" (" + sql_test_statements[i][2] + ") {" + str(self.parameters) +"}") | |
AssertionError: 66: Failed Multipolygon diff moved point of outer way case (Tags from outer way), expected 24751 but was 24750.0 (SELECT rou | |
nd(ST_Area(way)) FROM planet_osm_polygon WHERE osm_id = -15 and landuse = 'residential' and name = 'Name_way') {[]} | |
====================================================================== | |
FAIL: runTest (__main__.MultipolygonSlimTestCase) | |
---------------------------------------------------------------------- | |
Traceback (most recent call last): | |
File "regression-test.py", line 464, in runTest | |
self.executeStatements(self.postDiffStatements) | |
File "regression-test.py", line 367, in executeStatements | |
" (" + sql_test_statements[i][2] + ") {" + str(self.parameters) +"}") | |
AssertionError: 66: Failed Multipolygon diff moved point of outer way case (Tags from outer way), expected 24751 but was 24750.0 (SELECT rou | |
nd(ST_Area(way)) FROM planet_osm_polygon WHERE osm_id = -15 and landuse = 'residential' and name = 'Name_way') {['-G']} | |
====================================================================== | |
FAIL: runTest (__main__.MultipolygonSlimTestCase) | |
---------------------------------------------------------------------- | |
Traceback (most recent call last): | |
File "regression-test.py", line 464, in runTest | |
self.executeStatements(self.postDiffStatements) | |
File "regression-test.py", line 367, in executeStatements | |
" (" + sql_test_statements[i][2] + ") {" + str(self.parameters) +"}") | |
AssertionError: 66: Failed Multipolygon diff moved point of outer way case (Tags from outer way), expected 24751 but was 24750.0 (SELECT rou | |
nd(ST_Area(way)) FROM planet_osm_polygon WHERE osm_id = -15 and landuse = 'residential' and name = 'Name_way') {['-k']} | |
====================================================================== | |
FAIL: runTest (__main__.MultipolygonSlimTestCase) | |
---------------------------------------------------------------------- | |
Traceback (most recent call last): | |
File "regression-test.py", line 464, in runTest | |
self.executeStatements(self.postDiffStatements) | |
File "regression-test.py", line 367, in executeStatements | |
" (" + sql_test_statements[i][2] + ") {" + str(self.parameters) +"}") | |
AssertionError: 66: Failed Multipolygon diff moved point of outer way case (Tags from outer way), expected 24751 but was 24750.0 (SELECT rou | |
nd(ST_Area(way)) FROM planet_osm_polygon WHERE osm_id = -15 and landuse = 'residential' and name = 'Name_way') {['-k', '--hstore-match-only' | |
]} | |
====================================================================== | |
FAIL: runTest (__main__.MultipolygonSlimTestCase) | |
---------------------------------------------------------------------- | |
Traceback (most recent call last): | |
File "regression-test.py", line 464, in runTest | |
self.executeStatements(self.postDiffStatements) | |
File "regression-test.py", line 367, in executeStatements | |
" (" + sql_test_statements[i][2] + ") {" + str(self.parameters) +"}") | |
AssertionError: 66: Failed Multipolygon diff moved point of outer way case (Tags from outer way), expected 24751 but was 24750.0 (SELECT rou | |
nd(ST_Area(way)) FROM planet_osm_polygon WHERE osm_id = -15 and landuse = 'residential' and name = 'Name_way') {['-x', '-k', '--hstore-match | |
-only']} | |
====================================================================== | |
FAIL: runTest (__main__.MultipolygonSlimTestCase) | |
---------------------------------------------------------------------- | |
Traceback (most recent call last): | |
File "regression-test.py", line 464, in runTest | |
self.executeStatements(self.postDiffStatements) | |
File "regression-test.py", line 367, in executeStatements | |
" (" + sql_test_statements[i][2] + ") {" + str(self.parameters) +"}") | |
AssertionError: 66: Failed Multipolygon diff moved point of outer way case (Tags from outer way), expected 24751 but was 24750.0 (SELECT rou | |
nd(ST_Area(way)) FROM planet_osm_polygon WHERE osm_id = -15 and landuse = 'residential' and name = 'Name_way') {['-x', '-j']} | |
====================================================================== | |
FAIL: runTest (__main__.MultipolygonSlimTestCase) | |
---------------------------------------------------------------------- | |
Traceback (most recent call last): | |
File "regression-test.py", line 464, in runTest | |
self.executeStatements(self.postDiffStatements) | |
File "regression-test.py", line 367, in executeStatements | |
" (" + sql_test_statements[i][2] + ") {" + str(self.parameters) +"}") | |
AssertionError: 66: Failed Multipolygon diff moved point of outer way case (Tags from outer way), expected 24751 but was 24750.0 (SELECT rou | |
nd(ST_Area(way)) FROM planet_osm_polygon WHERE osm_id = -15 and landuse = 'residential' and name = 'Name_way') {['--tag-transform-script', ' | |
style.lua']} | |
====================================================================== | |
FAIL: runTest (__main__.MultipolygonSlimTestCase) | |
---------------------------------------------------------------------- | |
Traceback (most recent call last): | |
File "regression-test.py", line 464, in runTest | |
self.executeStatements(self.postDiffStatements) | |
File "regression-test.py", line 367, in executeStatements | |
" (" + sql_test_statements[i][2] + ") {" + str(self.parameters) +"}") | |
AssertionError: 66: Failed Multipolygon diff moved point of outer way case (Tags from outer way), expected 24751 but was 24750.0 (SELECT rou | |
nd(ST_Area(way)) FROM planet_osm_polygon WHERE osm_id = -15 and landuse = 'residential' and name = 'Name_way') {['--tag-transform-script', ' | |
style.lua', '-k']} | |
---------------------------------------------------------------------- | |
Ran 40 tests in 296.079s | |
FAILED (failures=8) | |
Cleaning up test database | |
V:\build18_r\osm2pgsql\tests> |
This file contains hidden or 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
V:\>cd build18rel | |
V:\build18rel>test | |
V:\build18rel>rem set PATH=V:\build18rel\osm2pgsql-bin;C:\Python34 | |
V:\build18rel>set PATH=V:\build18rel\osm2pgsql-bin;C:\Python27 | |
V:\build18rel>echo V:\build18rel | |
V:\build18rel | |
V:\build18rel>cd osm2pgsql/tests | |
V:\build18rel\osm2pgsql\tests>rem python tests/regression-test3.py | |
V:\build18rel\osm2pgsql\tests>copy /y ..\style.lua . | |
Скопировано файлов: 1. | |
V:\build18rel\osm2pgsql\tests>copy /y ..\default.style . | |
Скопировано файлов: 1. | |
V:\build18rel\osm2pgsql\tests>copy /y ..\..\*.py . | |
..\..\regression-test.py | |
..\..\regression-test3.py | |
Скопировано файлов: 2. | |
V:\build18rel\osm2pgsql\tests>rem osm2pgsql -l liechtenstein-2013-08-03.osm.pbf -U postgres -d osm | |
V:\build18rel\osm2pgsql\tests>python regression-test.py | |
Setting up test database | |
We already have a tablespace, can use that | |
....**************************************** | |
Running initial import for basic case | |
********************************* | |
.**************************************** | |
Running initial import for slim --drop case | |
********************************* | |
.**************************************** | |
Running initial import for Hstore index drop | |
********************************* | |
.**************************************** | |
Running initial import for lat lon projection | |
********************************* | |
.**************************************** | |
Running initial import for --tag-transform-script | |
********************************* | |
...**************************************** | |
Running initial import for basic case | |
********************************* | |
Running diff-import for basic case | |
********************************* | |
.**************************************** | |
Running initial import for Parallel processing | |
********************************* | |
Running diff-import for Parallel processing | |
********************************* | |
.**************************************** | |
Running initial import for Parallel processing with non 100% node-cache | |
********************************* | |
Running diff-import for Parallel processing with non 100% node-cache | |
********************************* | |
.**************************************** | |
Running initial import for Parallel processing with disabled node-cache | |
********************************* | |
Running diff-import for Parallel processing with disabled node-cache | |
********************************* | |
.**************************************** | |
Running initial import for Hstore match only | |
********************************* | |
Running diff-import for Hstore match only | |
********************************* | |
.**************************************** | |
Running initial import for Hstore name column | |
********************************* | |
Running diff-import for Hstore name column | |
********************************* | |
.**************************************** | |
Running initial import for Hstore | |
********************************* | |
Running diff-import for Hstore | |
********************************* | |
.**************************************** | |
Running initial import for Hstore all | |
********************************* | |
Running diff-import for Hstore all | |
********************************* | |
.**************************************** | |
Running initial import for Hstore index | |
********************************* | |
Running diff-import for Hstore index | |
********************************* | |
.**************************************** | |
Running initial import for Extra tags hstore match only | |
********************************* | |
Running diff-import for Extra tags hstore match only | |
********************************* | |
.**************************************** | |
Running initial import for Extra tags hstore all | |
********************************* | |
Running diff-import for Extra tags hstore all | |
********************************* | |
.EEEE**************************************** | |
Running initial import for --tag-transform-script | |
********************************* | |
Running diff-import for --tag-transform-script | |
********************************* | |
...**************************************** | |
Running initial import for basic case | |
********************************* | |
Running diff-import for basic case | |
********************************* | |
F**************************************** | |
Running initial import for multi geometry | |
********************************* | |
Running diff-import for multi geometry | |
********************************* | |
F**************************************** | |
Running initial import for hstore case | |
********************************* | |
Running diff-import for hstore case | |
********************************* | |
F**************************************** | |
Running initial import for hstore case | |
********************************* | |
Running diff-import for hstore case | |
********************************* | |
F**************************************** | |
Running initial import for Extra tags hstore match only | |
********************************* | |
Running diff-import for Extra tags hstore match only | |
********************************* | |
F**************************************** | |
Running initial import for Extra tags hstore match only | |
********************************* | |
Running diff-import for Extra tags hstore match only | |
********************************* | |
F**************************************** | |
Running initial import for lua tagtransform case | |
********************************* | |
Running diff-import for lua tagtransform case | |
********************************* | |
F**************************************** | |
Running initial import for lua tagtransform case with hstore | |
********************************* | |
Running diff-import for lua tagtransform case with hstore | |
********************************* | |
F..**************************************** | |
Running initial import in gazetteer mode for basic case | |
********************************* | |
Running diff-import in gazetteer mode for basic case | |
********************************* | |
. | |
====================================================================== | |
ERROR: runTest (__main__.BasicSlimTestCase) | |
---------------------------------------------------------------------- | |
Traceback (most recent call last): | |
File "regression-test.py", line 433, in setUp | |
self.setUpGeneric(self.parameters, full_import_file) | |
File "regression-test.py", line 385, in setUpGeneric | |
self.assertEqual (proc.returncode, 0, "Execution of osm2pgsql --slim with options: '%s' failed:\n%s\n%s\n" % (str(parameters), outp, out | |
err)) | |
AssertionError: Execution of osm2pgsql --slim with options: '['--tablespace-main-data', 'tablespacetest']' failed: | |
╨Ч╨Р╨Ь╨Х╨з╨Р╨Э╨Ш╨Х: ╤В╨░╨▒╨╗╨╕╤Ж╨░ "planet_osm_point_tmp" ╨╜╨╡ ╤Б╤Г╤Й╨╡╤Б╤В╨▓╤Г╨╡╤В, ╨┐╤А╨╛╨┐╤Г╤Б╨║╨░╨╡╤В╤Б╤П | |
osm2pgsql SVN version 0.85-win-cmake (64bit id space) | |
Using projection SRS 900913 (Spherical Mercator) | |
Setting up table: planet_osm_point | |
CREATE TABLE planet_osm_point ( osm_id int8,"access" text,"addr:housename" text,"addr:housenumber" text,"addr:interpolation" text,"admin_lev | |
el" text,"aerialway" text,"aeroway" text,"amenity" text,"area" text,"barrier" text,"bicycle" text,"brand" text,"bridge" text,"boundary" text | |
,"building" text,"capital" text,"construction" text,"covered" text,"culvert" text,"cutting" text,"denomination" text,"disused" text,"ele" te | |
xt,"embankment" text,"foot" text,"generator:source" text,"harbour" text,"highway" text,"historic" text,"horse" text,"intermittent" text,"jun | |
ction" text,"landuse" text,"layer" text,"leisure" text,"lock" text,"man_made" text,"military" text,"motorcar" text,"name" text,"natural" tex | |
t,"office" text,"oneway" text,"operator" text,"place" text,"poi" text,"population" text,"power" text,"power_source" text,"public_transport" | |
text,"railway" text,"ref" text,"religion" text,"route" text,"service" text,"shop" text,"sport" text,"surface" text,"toll" text,"tourism" tex | |
t,"tower:type" text,"tunnel" text,"water" text,"waterway" text,"wetland" text,"width" text,"wood" text,"z_order" int4) TABLESPACE tablespace | |
test | |
failed: ╨Ю╨и╨Ш╨С╨Ъ╨Р: ╨╜╨╡ ╤Г╨┤╨░╨╗╨╛╤Б╤М ╤Б╨╛╨╖╨┤╨░╤В╤М ╨║╨░╤В╨░╨╗╨╛╨│ "pg_tblspc/140014/PG_9.3_201306121/166191": No such file or direct | |
ory | |
Error occurred, cleaning up | |
====================================================================== | |
ERROR: runTest (__main__.BasicSlimTestCase) | |
---------------------------------------------------------------------- | |
Traceback (most recent call last): | |
File "regression-test.py", line 433, in setUp | |
self.setUpGeneric(self.parameters, full_import_file) | |
File "regression-test.py", line 385, in setUpGeneric | |
self.assertEqual (proc.returncode, 0, "Execution of osm2pgsql --slim with options: '%s' failed:\n%s\n%s\n" % (str(parameters), outp, out | |
err)) | |
AssertionError: Execution of osm2pgsql --slim with options: '['--tablespace-main-index', 'tablespacetest']' failed: | |
╨Ч╨Р╨Ь╨Х╨з╨Р╨Э╨Ш╨Х: ╤В╨░╨▒╨╗╨╕╤Ж╨░ "planet_osm_point" ╨╜╨╡ ╤Б╤Г╤Й╨╡╤Б╤В╨▓╤Г╨╡╤В, ╨┐╤А╨╛╨┐╤Г╤Б╨║╨░╨╡╤В╤Б╤П | |
╨Ч╨Р╨Ь╨Х╨з╨Р╨Э╨Ш╨Х: ╤В╨░╨▒╨╗╨╕╤Ж╨░ "planet_osm_point_tmp" ╨╜╨╡ ╤Б╤Г╤Й╨╡╤Б╤В╨▓╤Г╨╡╤В, ╨┐╤А╨╛╨┐╤Г╤Б╨║╨░╨╡╤В╤Б╤П | |
osm2pgsql SVN version 0.85-win-cmake (64bit id space) | |
Using projection SRS 900913 (Spherical Mercator) | |
Setting up table: planet_osm_point | |
CREATE INDEX planet_osm_point_pkey ON planet_osm_point USING BTREE (osm_id) TABLESPACE tablespacetest | |
failed: ╨Ю╨и╨Ш╨С╨Ъ╨Р: ╨╜╨╡ ╤Г╨┤╨░╨╗╨╛╤Б╤М ╤Б╨╛╨╖╨┤╨░╤В╤М ╨║╨░╤В╨░╨╗╨╛╨│ "pg_tblspc/140014/PG_9.3_201306121/166191": No such file or direct | |
ory | |
Error occurred, cleaning up | |
====================================================================== | |
ERROR: runTest (__main__.BasicSlimTestCase) | |
---------------------------------------------------------------------- | |
Traceback (most recent call last): | |
File "regression-test.py", line 433, in setUp | |
self.setUpGeneric(self.parameters, full_import_file) | |
File "regression-test.py", line 385, in setUpGeneric | |
self.assertEqual (proc.returncode, 0, "Execution of osm2pgsql --slim with options: '%s' failed:\n%s\n%s\n" % (str(parameters), outp, out | |
err)) | |
AssertionError: Execution of osm2pgsql --slim with options: '['--tablespace-slim-data', 'tablespacetest']' failed: | |
╨Ч╨Р╨Ь╨Х╨з╨Р╨Э╨Ш╨Х: ╤В╨░╨▒╨╗╨╕╤Ж╨░ "planet_osm_point" ╨╜╨╡ ╤Б╤Г╤Й╨╡╤Б╤В╨▓╤Г╨╡╤В, ╨┐╤А╨╛╨┐╤Г╤Б╨║╨░╨╡╤В╤Б╤П | |
╨Ч╨Р╨Ь╨Х╨з╨Р╨Э╨Ш╨Х: ╤В╨░╨▒╨╗╨╕╤Ж╨░ "planet_osm_point_tmp" ╨╜╨╡ ╤Б╤Г╤Й╨╡╤Б╤В╨▓╤Г╨╡╤В, ╨┐╤А╨╛╨┐╤Г╤Б╨║╨░╨╡╤В╤Б╤П | |
╨Ч╨Р╨Ь╨Х╨з╨Р╨Э╨Ш╨Х: ╤В╨░╨▒╨╗╨╕╤Ж╨░ "planet_osm_line_tmp" ╨╜╨╡ ╤Б╤Г╤Й╨╡╤Б╤В╨▓╤Г╨╡╤В, ╨┐╤А╨╛╨┐╤Г╤Б╨║╨░╨╡╤В╤Б╤П | |
╨Ч╨Р╨Ь╨Х╨з╨Р╨Э╨Ш╨Х: ╤В╨░╨▒╨╗╨╕╤Ж╨░ "planet_osm_polygon_tmp" ╨╜╨╡ ╤Б╤Г╤Й╨╡╤Б╤В╨▓╤Г╨╡╤В, ╨┐╤А╨╛╨┐╤Г╤Б╨║╨░╨╡╤В╤Б╤П | |
╨Ч╨Р╨Ь╨Х╨з╨Р╨Э╨Ш╨Х: ╤В╨░╨▒╨╗╨╕╤Ж╨░ "planet_osm_roads_tmp" ╨╜╨╡ ╤Б╤Г╤Й╨╡╤Б╤В╨▓╤Г╨╡╤В, ╨┐╤А╨╛╨┐╤Г╤Б╨║╨░╨╡╤В╤Б╤П | |
osm2pgsql SVN version 0.85-win-cmake (64bit id space) | |
Using projection SRS 900913 (Spherical Mercator) | |
Setting up table: planet_osm_point | |
Setting up table: planet_osm_line | |
Setting up table: planet_osm_polygon | |
Setting up table: planet_osm_roads | |
Using built-in tag processing pipeline | |
Allocating memory for sparse node cache | |
Node-cache: cache=100MB, maxblocks=12800*zd, allocation method=8192 | |
Mid: pgsql, scale=100 cache=100 | |
Setting up table: planet_osm_nodes | |
CREATE TABLE planet_osm_nodes (id int8 PRIMARY KEY , lat int4 not null, lon int4 not null, tags text[]) TABLESPACE tablespacetest; | |
failed: ╨Ю╨и╨Ш╨С╨Ъ╨Р: ╨╜╨╡ ╤Г╨┤╨░╨╗╨╛╤Б╤М ╤Б╨╛╨╖╨┤╨░╤В╤М ╨║╨░╤В╨░╨╗╨╛╨│ "pg_tblspc/140014/PG_9.3_201306121/166191": No such file or direct | |
ory | |
Error occurred, cleaning up | |
====================================================================== | |
ERROR: runTest (__main__.BasicSlimTestCase) | |
---------------------------------------------------------------------- | |
Traceback (most recent call last): | |
File "regression-test.py", line 433, in setUp | |
self.setUpGeneric(self.parameters, full_import_file) | |
File "regression-test.py", line 385, in setUpGeneric | |
self.assertEqual (proc.returncode, 0, "Execution of osm2pgsql --slim with options: '%s' failed:\n%s\n%s\n" % (str(parameters), outp, out | |
err)) | |
AssertionError: Execution of osm2pgsql --slim with options: '['--tablespace-slim-index', 'tablespacetest']' failed: | |
╨Ч╨Р╨Ь╨Х╨з╨Р╨Э╨Ш╨Х: ╤В╨░╨▒╨╗╨╕╤Ж╨░ "planet_osm_point" ╨╜╨╡ ╤Б╤Г╤Й╨╡╤Б╤В╨▓╤Г╨╡╤В, ╨┐╤А╨╛╨┐╤Г╤Б╨║╨░╨╡╤В╤Б╤П | |
╨Ч╨Р╨Ь╨Х╨з╨Р╨Э╨Ш╨Х: ╤В╨░╨▒╨╗╨╕╤Ж╨░ "planet_osm_point_tmp" ╨╜╨╡ ╤Б╤Г╤Й╨╡╤Б╤В╨▓╤Г╨╡╤В, ╨┐╤А╨╛╨┐╤Г╤Б╨║╨░╨╡╤В╤Б╤П | |
╨Ч╨Р╨Ь╨Х╨з╨Р╨Э╨Ш╨Х: ╤В╨░╨▒╨╗╨╕╤Ж╨░ "planet_osm_line" ╨╜╨╡ ╤Б╤Г╤Й╨╡╤Б╤В╨▓╤Г╨╡╤В, ╨┐╤А╨╛╨┐╤Г╤Б╨║╨░╨╡╤В╤Б╤П | |
╨Ч╨Р╨Ь╨Х╨з╨Р╨Э╨Ш╨Х: ╤В╨░╨▒╨╗╨╕╤Ж╨░ "planet_osm_line_tmp" ╨╜╨╡ ╤Б╤Г╤Й╨╡╤Б╤В╨▓╤Г╨╡╤В, ╨┐╤А╨╛╨┐╤Г╤Б╨║╨░╨╡╤В╤Б╤П | |
╨Ч╨Р╨Ь╨Х╨з╨Р╨Э╨Ш╨Х: ╤В╨░╨▒╨╗╨╕╤Ж╨░ "planet_osm_polygon" ╨╜╨╡ ╤Б╤Г╤Й╨╡╤Б╤В╨▓╤Г╨╡╤В, ╨┐╤А╨╛╨┐╤Г╤Б╨║╨░╨╡╤В╤Б╤П | |
╨Ч╨Р╨Ь╨Х╨з╨Р╨Э╨Ш╨Х: ╤В╨░╨▒╨╗╨╕╤Ж╨░ "planet_osm_polygon_tmp" ╨╜╨╡ ╤Б╤Г╤Й╨╡╤Б╤В╨▓╤Г╨╡╤В, ╨┐╤А╨╛╨┐╤Г╤Б╨║╨░╨╡╤В╤Б╤П | |
╨Ч╨Р╨Ь╨Х╨з╨Р╨Э╨Ш╨Х: ╤В╨░╨▒╨╗╨╕╤Ж╨░ "planet_osm_roads" ╨╜╨╡ ╤Б╤Г╤Й╨╡╤Б╤В╨▓╤Г╨╡╤В, ╨┐╤А╨╛╨┐╤Г╤Б╨║╨░╨╡╤В╤Б╤П | |
╨Ч╨Р╨Ь╨Х╨з╨Р╨Э╨Ш╨Х: ╤В╨░╨▒╨╗╨╕╤Ж╨░ "planet_osm_roads_tmp" ╨╜╨╡ ╤Б╤Г╤Й╨╡╤Б╤В╨▓╤Г╨╡╤В, ╨┐╤А╨╛╨┐╤Г╤Б╨║╨░╨╡╤В╤Б╤П | |
╨Ч╨Р╨Ь╨Х╨з╨Р╨Э╨Ш╨Х: ╤В╨░╨▒╨╗╨╕╤Ж╨░ "planet_osm_nodes" ╨╜╨╡ ╤Б╤Г╤Й╨╡╤Б╤В╨▓╤Г╨╡╤В, ╨┐╤А╨╛╨┐╤Г╤Б╨║╨░╨╡╤В╤Б╤П | |
osm2pgsql SVN version 0.85-win-cmake (64bit id space) | |
Using projection SRS 900913 (Spherical Mercator) | |
Setting up table: planet_osm_point | |
Setting up table: planet_osm_line | |
Setting up table: planet_osm_polygon | |
Setting up table: planet_osm_roads | |
Using built-in tag processing pipeline | |
Allocating memory for sparse node cache | |
Node-cache: cache=100MB, maxblocks=12800*zd, allocation method=8192 | |
Mid: pgsql, scale=100 cache=100 | |
Setting up table: planet_osm_nodes | |
CREATE TABLE planet_osm_nodes (id int8 PRIMARY KEY USING INDEX TABLESPACE tablespacetest, lat int4 not null, lon int4 not null, tags text[] | |
) ; | |
failed: ╨Ю╨и╨Ш╨С╨Ъ╨Р: ╨╜╨╡ ╤Г╨┤╨░╨╗╨╛╤Б╤М ╤Б╨╛╨╖╨┤╨░╤В╤М ╨║╨░╤В╨░╨╗╨╛╨│ "pg_tblspc/140014/PG_9.3_201306121/166191": No such file or direct | |
ory | |
Error occurred, cleaning up | |
====================================================================== | |
FAIL: runTest (__main__.MultipolygonSlimTestCase) | |
---------------------------------------------------------------------- | |
Traceback (most recent call last): | |
File "regression-test.py", line 464, in runTest | |
self.executeStatements(self.postDiffStatements) | |
File "regression-test.py", line 367, in executeStatements | |
" (" + sql_test_statements[i][2] + ") {" + str(self.parameters) +"}") | |
AssertionError: 66: Failed Multipolygon diff moved point of outer way case (Tags from outer way), expected 24751 but was 24750.0 (SELECT rou | |
nd(ST_Area(way)) FROM planet_osm_polygon WHERE osm_id = -15 and landuse = 'residential' and name = 'Name_way') {[]} | |
====================================================================== | |
FAIL: runTest (__main__.MultipolygonSlimTestCase) | |
---------------------------------------------------------------------- | |
Traceback (most recent call last): | |
File "regression-test.py", line 464, in runTest | |
self.executeStatements(self.postDiffStatements) | |
File "regression-test.py", line 367, in executeStatements | |
" (" + sql_test_statements[i][2] + ") {" + str(self.parameters) +"}") | |
AssertionError: 66: Failed Multipolygon diff moved point of outer way case (Tags from outer way), expected 24751 but was 24750.0 (SELECT rou | |
nd(ST_Area(way)) FROM planet_osm_polygon WHERE osm_id = -15 and landuse = 'residential' and name = 'Name_way') {['-G']} | |
====================================================================== | |
FAIL: runTest (__main__.MultipolygonSlimTestCase) | |
---------------------------------------------------------------------- | |
Traceback (most recent call last): | |
File "regression-test.py", line 464, in runTest | |
self.executeStatements(self.postDiffStatements) | |
File "regression-test.py", line 367, in executeStatements | |
" (" + sql_test_statements[i][2] + ") {" + str(self.parameters) +"}") | |
AssertionError: 66: Failed Multipolygon diff moved point of outer way case (Tags from outer way), expected 24751 but was 24750.0 (SELECT rou | |
nd(ST_Area(way)) FROM planet_osm_polygon WHERE osm_id = -15 and landuse = 'residential' and name = 'Name_way') {['-k']} | |
====================================================================== | |
FAIL: runTest (__main__.MultipolygonSlimTestCase) | |
---------------------------------------------------------------------- | |
Traceback (most recent call last): | |
File "regression-test.py", line 464, in runTest | |
self.executeStatements(self.postDiffStatements) | |
File "regression-test.py", line 367, in executeStatements | |
" (" + sql_test_statements[i][2] + ") {" + str(self.parameters) +"}") | |
AssertionError: 66: Failed Multipolygon diff moved point of outer way case (Tags from outer way), expected 24751 but was 24750.0 (SELECT rou | |
nd(ST_Area(way)) FROM planet_osm_polygon WHERE osm_id = -15 and landuse = 'residential' and name = 'Name_way') {['-k', '--hstore-match-only' | |
]} | |
====================================================================== | |
FAIL: runTest (__main__.MultipolygonSlimTestCase) | |
---------------------------------------------------------------------- | |
Traceback (most recent call last): | |
File "regression-test.py", line 464, in runTest | |
self.executeStatements(self.postDiffStatements) | |
File "regression-test.py", line 367, in executeStatements | |
" (" + sql_test_statements[i][2] + ") {" + str(self.parameters) +"}") | |
AssertionError: 66: Failed Multipolygon diff moved point of outer way case (Tags from outer way), expected 24751 but was 24750.0 (SELECT rou | |
nd(ST_Area(way)) FROM planet_osm_polygon WHERE osm_id = -15 and landuse = 'residential' and name = 'Name_way') {['-x', '-k', '--hstore-match | |
-only']} | |
====================================================================== | |
FAIL: runTest (__main__.MultipolygonSlimTestCase) | |
---------------------------------------------------------------------- | |
Traceback (most recent call last): | |
File "regression-test.py", line 464, in runTest | |
self.executeStatements(self.postDiffStatements) | |
File "regression-test.py", line 367, in executeStatements | |
" (" + sql_test_statements[i][2] + ") {" + str(self.parameters) +"}") | |
AssertionError: 66: Failed Multipolygon diff moved point of outer way case (Tags from outer way), expected 24751 but was 24750.0 (SELECT rou | |
nd(ST_Area(way)) FROM planet_osm_polygon WHERE osm_id = -15 and landuse = 'residential' and name = 'Name_way') {['-x', '-j']} | |
====================================================================== | |
FAIL: runTest (__main__.MultipolygonSlimTestCase) | |
---------------------------------------------------------------------- | |
Traceback (most recent call last): | |
File "regression-test.py", line 464, in runTest | |
self.executeStatements(self.postDiffStatements) | |
File "regression-test.py", line 367, in executeStatements | |
" (" + sql_test_statements[i][2] + ") {" + str(self.parameters) +"}") | |
AssertionError: 66: Failed Multipolygon diff moved point of outer way case (Tags from outer way), expected 24751 but was 24750.0 (SELECT rou | |
nd(ST_Area(way)) FROM planet_osm_polygon WHERE osm_id = -15 and landuse = 'residential' and name = 'Name_way') {['--tag-transform-script', ' | |
style.lua']} | |
====================================================================== | |
FAIL: runTest (__main__.MultipolygonSlimTestCase) | |
---------------------------------------------------------------------- | |
Traceback (most recent call last): | |
File "regression-test.py", line 464, in runTest | |
self.executeStatements(self.postDiffStatements) | |
File "regression-test.py", line 367, in executeStatements | |
" (" + sql_test_statements[i][2] + ") {" + str(self.parameters) +"}") | |
AssertionError: 66: Failed Multipolygon diff moved point of outer way case (Tags from outer way), expected 24751 but was 24750.0 (SELECT rou | |
nd(ST_Area(way)) FROM planet_osm_polygon WHERE osm_id = -15 and landuse = 'residential' and name = 'Name_way') {['--tag-transform-script', ' | |
style.lua', '-k']} | |
---------------------------------------------------------------------- | |
Ran 40 tests in 526.023s | |
FAILED (failures=8, errors=4) | |
Cleaning up test database | |
V:\build18rel\osm2pgsql\tests>regression-test.py |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment