Merge commit '6eb4f090f98f6b17a23c57768c16b7716b6c9cbd' as 'third_party/libosmium'

This commit is contained in:
Patrick Niklaus
2017-08-30 09:30:27 +00:00
434 changed files with 81367 additions and 0 deletions
+48
View File
@@ -0,0 +1,48 @@
#-----------------------------------------------------------------------------
#
# CMake Config
#
# Libosmium example tests
#
#-----------------------------------------------------------------------------
message(STATUS "Configuring example tests")
set(EXAMPLE_TESTS
amenity_list
area_test
change_tags
convert
count
create_pois
debug
dump_internal
filter_discussions
index_lookup
location_cache
pub_names
read
read_with_progress
road_length
tiles
)
# This is the list of all tests that are in the repository. It should be the
# same as the configured list above, if not we'll find out about that below
# and create a fatal error.
file(GLOB _dirs RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}/t ${CMAKE_CURRENT_SOURCE_DIR}/t/*)
foreach(_dir ${EXAMPLE_TESTS})
message(STATUS " adding test: ${_dir}")
add_subdirectory("t/${_dir}")
list(REMOVE_ITEM _dirs ${_dir})
endforeach()
if(NOT ${_dirs} STREQUAL "")
message(FATAL_ERROR "Found example tests that are not configured: ${_dirs}")
endif()
message(STATUS "Configuring example tests - done")
#-----------------------------------------------------------------------------
@@ -0,0 +1,13 @@
add_test(NAME examples_amenity_list_node
COMMAND osmium_amenity_list ${CMAKE_CURRENT_SOURCE_DIR}/node.osm)
set_tests_properties(examples_amenity_list_node PROPERTIES
PASS_REGULAR_EXPRESSION " 8\\.8721, 53\\.0966 post_office")
add_test(NAME examples_amenity_list_area
COMMAND osmium_amenity_list ${CMAKE_CURRENT_SOURCE_DIR}/area.osm)
set_tests_properties(examples_amenity_list_area PROPERTIES
PASS_REGULAR_EXPRESSION " 8\\.5839, 53\\.5602 restaurant")
@@ -0,0 +1,18 @@
<?xml version='1.0' encoding='UTF-8'?>
<osm version="0.6">
<node id="2791512283" visible="true" version="1" changeset="21695983" timestamp="2014-04-14T20:45:22Z" user="Gerd Taddicken" uid="25464" lat="53.5601034" lon="8.5840408"/>
<node id="2791512284" visible="true" version="1" changeset="21695983" timestamp="2014-04-14T20:45:22Z" user="Gerd Taddicken" uid="25464" lat="53.5601127" lon="8.5837753"/>
<node id="2791512287" visible="true" version="1" changeset="21695983" timestamp="2014-04-14T20:45:22Z" user="Gerd Taddicken" uid="25464" lat="53.5602544" lon="8.5837933"/>
<node id="2791512289" visible="true" version="1" changeset="21695983" timestamp="2014-04-14T20:45:22Z" user="Gerd Taddicken" uid="25464" lat="53.5602464" lon="8.5840476"/>
<way id="274425514" visible="true" version="4" changeset="41519398" timestamp="2016-08-17T19:16:40Z" user="Lutalica_1974" uid="2096672">
<nd ref="2791512283"/>
<nd ref="2791512284"/>
<nd ref="2791512287"/>
<nd ref="2791512289"/>
<nd ref="2791512283"/>
<tag k="amenity" v="restaurant"/>
<tag k="building" v="house"/>
<tag k="cuisine" v="american"/>
<tag k="name" v="Seamen's Club"/>
</way>
</osm>
@@ -0,0 +1,7 @@
<?xml version='1.0' encoding='UTF-8'?>
<osm version="0.6">
<node id="24960505" version="5" timestamp="2013-02-28T23:26:39Z" uid="715371" user="cracklinrain" changeset="15203542" lat="53.096629" lon="8.8720536">
<tag k="amenity" v="post_office"/>
<tag k="wheelchair" v="yes"/>
</node>
</osm>
@@ -0,0 +1,25 @@
add_test(NAME examples_area_test_help
COMMAND osmium_area_test -h)
set_tests_properties(examples_area_test_help PROPERTIES
PASS_REGULAR_EXPRESSION "^osmium_area_test .* OSMFILE")
add_test(NAME examples_area_test_data
COMMAND osmium_area_test ${CMAKE_CURRENT_SOURCE_DIR}/data.osm)
set_tests_properties(examples_area_test_data PROPERTIES
PASS_REGULAR_EXPRESSION "\nWarning! Some member ways missing for these multipolygon relations: 701901\n$")
add_test(NAME examples_area_test_dump
COMMAND osmium_area_test -o ${CMAKE_CURRENT_SOURCE_DIR}/data.osm)
set_tests_properties(examples_area_test_dump PROPERTIES
PASS_REGULAR_EXPRESSION " id=1403801")
add_test(NAME examples_area_test_wkt
COMMAND osmium_area_test -w ${CMAKE_CURRENT_SOURCE_DIR}/data.osm)
set_tests_properties(examples_area_test_wkt PROPERTIES
PASS_REGULAR_EXPRESSION "MULTIPOLYGON\\(\\(\\(7.11 1.01,7.14 1.01,7.14 1.04,7.11 1.04,7.11 1.01\\)\\)\\)\n")
@@ -0,0 +1,34 @@
<?xml version='1.0' encoding='UTF-8'?>
<osm version="0.6" generator="testdata" upload="false">
<node id="701000" version="1" timestamp="2014-01-01T00:00:00Z" uid="1" user="test" changeset="1" lon="7.11" lat="1.01"/>
<node id="701001" version="1" timestamp="2014-01-01T00:00:00Z" uid="1" user="test" changeset="1" lon="7.11" lat="1.04"/>
<node id="701002" version="1" timestamp="2014-01-01T00:00:00Z" uid="1" user="test" changeset="1" lon="7.14" lat="1.04"/>
<node id="701003" version="1" timestamp="2014-01-01T00:00:00Z" uid="1" user="test" changeset="1" lon="7.14" lat="1.01"/>
<way id="701800" version="1" timestamp="2014-01-01T00:00:00Z" uid="1" user="test" changeset="1">
<nd ref="701000"/>
<nd ref="701001"/>
<nd ref="701002"/>
<tag k="test:section" v="mp-geom"/>
<tag k="test:id" v="701"/>
</way>
<way id="701801" version="1" timestamp="2014-01-01T00:00:00Z" uid="1" user="test" changeset="1">
<nd ref="701002"/>
<nd ref="701003"/>
<nd ref="701000"/>
<tag k="test:section" v="mp-geom"/>
<tag k="test:id" v="701"/>
</way>
<relation id="701900" version="1" timestamp="2014-01-01T00:00:00Z" uid="1" user="test" changeset="1">
<member type="way" ref="701800" role="outer"/>
<member type="way" ref="701801" role="outer"/>
<tag k="type" v="multipolygon"/>
<tag k="test:section" v="mp-geom"/>
<tag k="test:id" v="701"/>
<tag k="landuse" v="forest"/>
</relation>
<relation id="701901" version="1" timestamp="2014-01-01T00:00:00Z" uid="1" user="test" changeset="1">
<member type="way" ref="701802" role="outer"/> <!-- missing member -->
<tag k="type" v="multipolygon"/>
<tag k="landuse" v="forest"/>
</relation>
</osm>
@@ -0,0 +1 @@
result.osm text eol=lf
@@ -0,0 +1,9 @@
add_test(NAME examples_change_tags
COMMAND osmium_change_tags ${CMAKE_CURRENT_SOURCE_DIR}/data.osm ${CMAKE_CURRENT_BINARY_DIR}/result.osm)
add_test(NAME examples_change_tags_compare
COMMAND ${CMAKE_COMMAND} -E compare_files ${CMAKE_CURRENT_SOURCE_DIR}/result.osm ${CMAKE_CURRENT_BINARY_DIR}/result.osm)
set_tests_properties(examples_change_tags_compare PROPERTIES DEPENDS example_change_tags)
@@ -0,0 +1,20 @@
<?xml version='1.0' encoding='UTF-8'?>
<osm version="0.6" generator="testdata" upload="false">
<node id="10" version="1" timestamp="2014-01-01T00:00:00Z" uid="1" user="test" changeset="1" lat="1.01" lon="7.11">
<tag k="created_by" v="some editor"/>
</node>
<node id="11" version="1" timestamp="2014-01-01T00:00:00Z" uid="1" user="test" changeset="1" lat="1.04" lon="7.11"/>
<node id="12" version="1" timestamp="2014-01-01T00:00:00Z" uid="1" user="test" changeset="1" lat="1.04" lon="7.14"/>
<way id="20" version="1" timestamp="2014-01-01T00:00:00Z" uid="1" user="test" changeset="1">
<nd ref="10"/>
<nd ref="11"/>
<nd ref="12"/>
<tag k="created_by" v="some editor"/>
<tag k="landuse" v="forest"/>
<tag k="name" v="Example Forest"/>
</way>
<relation id="30" version="1" timestamp="2014-01-01T00:00:00Z" uid="1" user="test" changeset="1">
<tag k="created_by" v="some editor"/>
<tag k="note" v=" relation without members"/>
</relation>
</osm>
@@ -0,0 +1,16 @@
<?xml version='1.0' encoding='UTF-8'?>
<osm version="0.6" generator="osmium_change_tags">
<node id="10" version="1" timestamp="2014-01-01T00:00:00Z" uid="1" user="test" changeset="1" lat="1.01" lon="7.11"/>
<node id="11" version="1" timestamp="2014-01-01T00:00:00Z" uid="1" user="test" changeset="1" lat="1.04" lon="7.11"/>
<node id="12" version="1" timestamp="2014-01-01T00:00:00Z" uid="1" user="test" changeset="1" lat="1.04" lon="7.14"/>
<way id="20" version="1" timestamp="2014-01-01T00:00:00Z" uid="1" user="test" changeset="1">
<nd ref="10"/>
<nd ref="11"/>
<nd ref="12"/>
<tag k="natural" v="wood"/>
<tag k="name" v="Example Forest"/>
</way>
<relation id="30" version="1" timestamp="2014-01-01T00:00:00Z" uid="1" user="test" changeset="1">
<tag k="note" v=" relation without members"/>
</relation>
</osm>
@@ -0,0 +1,46 @@
add_test(NAME examples_convert_help
COMMAND osmium_convert -h)
set_tests_properties(examples_convert_help PROPERTIES
PASS_REGULAR_EXPRESSION "^osmium_convert .*OUTFILE")
add_test(NAME examples_convert_xml_debug
COMMAND osmium_convert -t debug ${CMAKE_CURRENT_SOURCE_DIR}/data.osm)
set_tests_properties(examples_convert_xml_debug PROPERTIES
PASS_REGULAR_EXPRESSION "node 701000\n version: 1 visible")
add_test(NAME examples_convert_xml_opl
COMMAND osmium_convert -f osm -t opl ${CMAKE_CURRENT_SOURCE_DIR}/data.osm)
set_tests_properties(examples_convert_xml_opl PROPERTIES
PASS_REGULAR_EXPRESSION "n701001 v1 dV c1 t2014-01-01T00:00:00Z i1 utest T x7.11 y1.04")
add_test(NAME examples_convert_xml_pbf
COMMAND osmium_convert -t pbf ${CMAKE_CURRENT_SOURCE_DIR}/data.osm -)
add_test(NAME examples_convert_xml_xml
COMMAND osmium_convert -t xml ${CMAKE_CURRENT_SOURCE_DIR}/data.osm)
set_tests_properties(examples_convert_xml_xml PROPERTIES
PASS_REGULAR_EXPRESSION "<node id=\"701001\" ")
# Should give a warning when converting from history to non-history file
add_test(NAME examples_convert_osh_xml
COMMAND osmium_convert -f osh -t osm ${CMAKE_CURRENT_SOURCE_DIR}/data.osm)
set_tests_properties(examples_convert_osh_xml PROPERTIES
PASS_REGULAR_EXPRESSION "Warning! You are converting from an OSM file")
# Should fail when an unknown command line option is used
add_test(NAME examples_convert_unknown_option
COMMAND osmium_convert --unknown)
set_tests_properties(examples_convert_unknown_option PROPERTIES
WILL_FAIL true)
+34
View File
@@ -0,0 +1,34 @@
<?xml version='1.0' encoding='UTF-8'?>
<osm version="0.6" generator="testdata" upload="false">
<node id="701000" version="1" timestamp="2014-01-01T00:00:00Z" uid="1" user="test" changeset="1" lon="7.11" lat="1.01"/>
<node id="701001" version="1" timestamp="2014-01-01T00:00:00Z" uid="1" user="test" changeset="1" lon="7.11" lat="1.04"/>
<node id="701002" version="1" timestamp="2014-01-01T00:00:00Z" uid="1" user="test" changeset="1" lon="7.14" lat="1.04"/>
<node id="701003" version="1" timestamp="2014-01-01T00:00:00Z" uid="1" user="test" changeset="1" lon="7.14" lat="1.01"/>
<way id="701800" version="1" timestamp="2014-01-01T00:00:00Z" uid="1" user="test" changeset="1">
<nd ref="701000"/>
<nd ref="701001"/>
<nd ref="701002"/>
<tag k="test:section" v="mp-geom"/>
<tag k="test:id" v="701"/>
</way>
<way id="701801" version="1" timestamp="2014-01-01T00:00:00Z" uid="1" user="test" changeset="1">
<nd ref="701002"/>
<nd ref="701003"/>
<nd ref="701000"/>
<tag k="test:section" v="mp-geom"/>
<tag k="test:id" v="701"/>
</way>
<relation id="701900" version="1" timestamp="2014-01-01T00:00:00Z" uid="1" user="test" changeset="1">
<member type="way" ref="701800" role="outer"/>
<member type="way" ref="701801" role="outer"/>
<tag k="type" v="multipolygon"/>
<tag k="test:section" v="mp-geom"/>
<tag k="test:id" v="701"/>
<tag k="landuse" v="forest"/>
</relation>
<relation id="701901" version="1" timestamp="2014-01-01T00:00:00Z" uid="1" user="test" changeset="1">
<member type="way" ref="701802" role="outer"/> <!-- missing member -->
<tag k="type" v="multipolygon"/>
<tag k="landuse" v="forest"/>
</relation>
</osm>
@@ -0,0 +1,8 @@
add_test(NAME examples_count
COMMAND osmium_count ${CMAKE_CURRENT_SOURCE_DIR}/data.osm)
set_tests_properties(examples_count PROPERTIES
PASS_REGULAR_EXPRESSION "^Nodes: 2\nWays: 1\nRelations: 1\n\nMemory used:"
)
+12
View File
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<osm version="0.6">
<node id="1" version="1" changeset="1" timestamp="2000-01-01T10:11:12Z" user="test" uid="1" lat="51.0271601" lon="13.7252197"/>
<node id="2" version="1" changeset="1" timestamp="2000-01-01T10:11:12Z" user="test" uid="1" lat="51.0288568" lon="13.7248159"/>
<way id="10" version="1" changeset="1" timestamp="2000-01-01T10:11:12Z" user="test" uid="1">
<nd ref="1"/>
<nd ref="2"/>
</way>
<relation id="20" version="1" changeset="1" timestamp="2000-01-01T10:11:12Z" user="test" uid="1">
<member type="way" ref="10" role=""/>
</relation>
</osm>
@@ -0,0 +1,13 @@
add_test(NAME examples_create_pois_okay
COMMAND osmium_create_pois -)
set_tests_properties(examples_create_pois_okay PROPERTIES
PASS_REGULAR_EXPRESSION "^n-1 v1 dV c0 t....-..-..T..:..:..Z i0 u Tamenity=post_box x1\\.23 y3\\.45\nn-2 v1 dV c0 t....-..-..T..:..:..Z i0 u Tamenity=restaurant,name=Chez%20%OSM x1\\.24 y3\\.46\n$"
)
add_test(NAME examples_create_pois_unknown_file_type
COMMAND osmium_create_pois foo)
set_tests_properties(examples_create_pois_unknown_file_type PROPERTIES WILL_FAIL true)
@@ -0,0 +1,55 @@
add_test(NAME examples_debug_all
COMMAND osmium_debug ${CMAKE_CURRENT_SOURCE_DIR}/data.osm)
set_tests_properties(examples_debug_all PROPERTIES
PASS_REGULAR_EXPRESSION " id=1\n.* id=2\n.* id=10\n.* id=20\n"
)
add_test(NAME examples_debug_nodes
COMMAND osmium_debug ${CMAKE_CURRENT_SOURCE_DIR}/data.osm n)
set_tests_properties(examples_debug_nodes PROPERTIES
PASS_REGULAR_EXPRESSION "id=1\n.* id=2\n"
)
set_tests_properties(examples_debug_nodes PROPERTIES
FAIL_REGULAR_EXPRESSION "id=10\n"
)
add_test(NAME examples_debug_ways
COMMAND osmium_debug ${CMAKE_CURRENT_SOURCE_DIR}/data.osm w)
set_tests_properties(examples_debug_ways PROPERTIES
PASS_REGULAR_EXPRESSION " id=10\n"
)
set_tests_properties(examples_debug_ways PROPERTIES
FAIL_REGULAR_EXPRESSION "id=20\n"
)
add_test(NAME examples_debug_relations
COMMAND osmium_debug ${CMAKE_CURRENT_SOURCE_DIR}/data.osm r)
set_tests_properties(examples_debug_relations PROPERTIES
PASS_REGULAR_EXPRESSION " id=20\n"
)
set_tests_properties(examples_debug_relations PROPERTIES
FAIL_REGULAR_EXPRESSION "id=10\n"
)
add_test(NAME examples_debug_changesets
COMMAND osmium_debug ${CMAKE_CURRENT_SOURCE_DIR}/changesets.osm c)
set_tests_properties(examples_debug_changesets PROPERTIES
PASS_REGULAR_EXPRESSION " id=15449962\n"
)
set_tests_properties(examples_debug_changesets PROPERTIES
FAIL_REGULAR_EXPRESSION "id=10\n"
)
@@ -0,0 +1,7 @@
<?xml version='1.0' encoding='UTF-8'?>
<osm version="0.6" generator="Osmosis 0.41">
<changeset id="15449962" created_at="2013-03-22T02:10:17Z" num_changes="140" closed_at="2013-03-22T02:10:24Z" open="false" min_lon="106.8146927" min_lat="-6.1207748" max_lon="106.8212512" max_lat="-6.1133246" user="Vivianecahen" uid="1241761">
<tag k="comment" v="Adding Initial buildings and roads"/>
<tag k="created_by" v="JOSM/1.5 (5697 en)"/>
</changeset>
</osm>
+13
View File
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<osm version="0.6">
<bounds minlon="13.7248159" minlat="51.0271601" maxlon="13.7252197" maxlat="51.0288568"/>
<node id="1" version="1" changeset="1" timestamp="2000-01-01T10:11:12Z" user="test" uid="1" lat="51.0271601" lon="13.7252197"/>
<node id="2" version="1" changeset="1" timestamp="2000-01-01T10:11:12Z" user="test" uid="1" lat="51.0288568" lon="13.7248159"/>
<way id="10" version="1" changeset="1" timestamp="2000-01-01T10:11:12Z" user="test" uid="1">
<nd ref="1"/>
<nd ref="2"/>
</way>
<relation id="20" version="1" changeset="1" timestamp="2000-01-01T10:11:12Z" user="test" uid="1">
<member type="way" ref="10" role=""/>
</relation>
</osm>
@@ -0,0 +1,36 @@
add_test(NAME examples_dump_internal
COMMAND osmium_dump_internal ${CMAKE_CURRENT_SOURCE_DIR}/data.osm ${CMAKE_CURRENT_BINARY_DIR}/out)
add_test(NAME examples_dump_internal_index_nodes
COMMAND osmium_index_lookup --list=${CMAKE_CURRENT_BINARY_DIR}/out/nodes.idx --type=offset --dump)
set_tests_properties(examples_dump_internal_index_nodes PROPERTIES
DEPENDS examples_dump_internal
PASS_REGULAR_EXPRESSION "^701000 .*\n701001 .*\n")
add_test(NAME examples_dump_internal_index_ways
COMMAND osmium_index_lookup --list=${CMAKE_CURRENT_BINARY_DIR}/out/ways.idx --type=offset --dump)
set_tests_properties(examples_dump_internal_index_ways PROPERTIES
DEPENDS examples_dump_internal
PASS_REGULAR_EXPRESSION "^701800 .*\n701801 .*\n")
add_test(NAME examples_dump_internal_map_node2way_dump
COMMAND osmium_index_lookup --list=${CMAKE_CURRENT_BINARY_DIR}/out/node2way.map --type=id --dump)
set_tests_properties(examples_dump_internal_map_node2way_dump PROPERTIES
DEPENDS examples_dump_internal
PASS_REGULAR_EXPRESSION "^701000 701800\n701000 701801\n701001 701800\n")
add_test(NAME examples_dump_internal_map_node2way_search
COMMAND osmium_index_lookup --list=${CMAKE_CURRENT_BINARY_DIR}/out/node2way.map --type=id --search=701002)
set_tests_properties(examples_dump_internal_map_node2way_search PROPERTIES
DEPENDS examples_dump_internal
PASS_REGULAR_EXPRESSION "^701002 701800\n701002 701801\n$")
@@ -0,0 +1,34 @@
<?xml version='1.0' encoding='UTF-8'?>
<osm version="0.6" generator="testdata" upload="false">
<node id="701000" version="1" timestamp="2014-01-01T00:00:00Z" uid="1" user="test" changeset="1" lon="7.11" lat="1.01"/>
<node id="701001" version="1" timestamp="2014-01-01T00:00:00Z" uid="1" user="test" changeset="1" lon="7.11" lat="1.04"/>
<node id="701002" version="1" timestamp="2014-01-01T00:00:00Z" uid="1" user="test" changeset="1" lon="7.14" lat="1.04"/>
<node id="701003" version="1" timestamp="2014-01-01T00:00:00Z" uid="1" user="test" changeset="1" lon="7.14" lat="1.01"/>
<way id="701800" version="1" timestamp="2014-01-01T00:00:00Z" uid="1" user="test" changeset="1">
<nd ref="701000"/>
<nd ref="701001"/>
<nd ref="701002"/>
<tag k="test:section" v="mp-geom"/>
<tag k="test:id" v="701"/>
</way>
<way id="701801" version="1" timestamp="2014-01-01T00:00:00Z" uid="1" user="test" changeset="1">
<nd ref="701002"/>
<nd ref="701003"/>
<nd ref="701000"/>
<tag k="test:section" v="mp-geom"/>
<tag k="test:id" v="701"/>
</way>
<relation id="701900" version="1" timestamp="2014-01-01T00:00:00Z" uid="1" user="test" changeset="1">
<member type="way" ref="701800" role="outer"/>
<member type="way" ref="701801" role="outer"/>
<tag k="type" v="multipolygon"/>
<tag k="test:section" v="mp-geom"/>
<tag k="test:id" v="701"/>
<tag k="landuse" v="forest"/>
</relation>
<relation id="701901" version="1" timestamp="2014-01-01T00:00:00Z" uid="1" user="test" changeset="1">
<member type="way" ref="701802" role="outer"/> <!-- missing member -->
<tag k="type" v="multipolygon"/>
<tag k="landuse" v="forest"/>
</relation>
</osm>
@@ -0,0 +1,10 @@
add_test(NAME examples_filter_discussions
COMMAND osmium_filter_discussions ${CMAKE_CURRENT_SOURCE_DIR}/changesets.osm -)
set_tests_properties(examples_filter_discussions PROPERTIES
FAIL_REGULAR_EXPRESSION "<changeset id=\"402757\"")
set_tests_properties(examples_filter_discussions PROPERTIES
PASS_REGULAR_EXPRESSION "<changeset id=\"402758\"")
@@ -0,0 +1,11 @@
<?xml version='1.0' encoding='UTF-8'?>
<osm version="0.6" generator="Osmosis 0.41">
<changeset id="402757" created_at="2008-12-15T12:57:57Z" closed_at="2008-12-15T14:00:54Z" open="false" user="mrettig" uid="38842" min_lat="50.8899870" min_lon="8.0981539" max_lat="50.9508652" max_lon="8.1665031" num_changes="33" comments_count="0"/>
<changeset id="402758" created_at="2008-07-05T11:17:12Z" closed_at="2008-07-05T12:17:12Z" open="false" user="Jaycos" uid="45048" min_lat="51.7305590" min_lon="6.5904108" max_lat="51.7305590" max_lon="6.5904108" num_changes="1" comments_count="1">
<discussion>
<comment uid="123" user="foobar" date="2008-07-05T11:17:13Z">
<text>fake comment</text>
</comment>
</discussion>
</changeset>
</osm>
@@ -0,0 +1,46 @@
add_test(NAME examples_index_lookup_help
COMMAND osmium_index_lookup -h)
set_tests_properties(examples_index_lookup_help PROPERTIES
PASS_REGULAR_EXPRESSION "^Usage: osmium_index_lookup")
# Fails with message if index file doesn't exist
add_test(NAME examples_index_lookup_no_file
COMMAND osmium_index_lookup --list=file_does_not_exist --type=location --dump)
set_tests_properties(examples_index_lookup_no_file PROPERTIES
PASS_REGULAR_EXPRESSION "^Can not open file")
# Fails with message if --type option is not used
add_test(NAME examples_index_lookup_no_type_option
COMMAND osmium_index_lookup --list=file_does_not_exist --dump)
set_tests_properties(examples_index_lookup_no_type_option PROPERTIES
PASS_REGULAR_EXPRESSION "^Need --type argument.")
# Fails with message if --type option is used with unknown type
add_test(NAME examples_index_lookup_unknown_type
COMMAND osmium_index_lookup --list=file_does_not_exist --type=UNKNOWN --dump)
set_tests_properties(examples_index_lookup_unknown_type PROPERTIES
PASS_REGULAR_EXPRESSION "^Unknown type 'UNKNOWN'")
# Fails with message when combining options --array and --list
add_test(NAME examples_index_lookup_array_list
COMMAND osmium_index_lookup --list=a --array=b)
set_tests_properties(examples_index_lookup_array_list PROPERTIES
PASS_REGULAR_EXPRESSION "^Need option --array or --list, but not both\n$")
# Fails with message when combining options --dump and --search
add_test(NAME examples_index_lookup_dump_search
COMMAND osmium_index_lookup --list=x --dump --search=123)
set_tests_properties(examples_index_lookup_dump_search PROPERTIES
PASS_REGULAR_EXPRESSION "Need option --dump or --search, but not both")
@@ -0,0 +1,36 @@
add_test(NAME examples_location_cache_create
COMMAND osmium_location_cache_create ${CMAKE_CURRENT_SOURCE_DIR}/data.osm ${CMAKE_CURRENT_BINARY_DIR}/locations.idx)
# Fails with message if index file doesn't exist
add_test(NAME examples_location_cache_no_file
COMMAND osmium_location_cache_use ${CMAKE_CURRENT_SOURCE_DIR}/way.osm ${CMAKE_CURRENT_BINARY_DIR}/file_does_not_exist)
set_tests_properties(examples_location_cache_no_file PROPERTIES
PASS_REGULAR_EXPRESSION "Can not open location cache file")
add_test(NAME examples_location_cache_use
COMMAND osmium_location_cache_use ${CMAKE_CURRENT_SOURCE_DIR}/way.osm ${CMAKE_CURRENT_BINARY_DIR}/locations.idx)
set_tests_properties(examples_location_cache_use PROPERTIES
DEPENDS examples_location_cache_create
PASS_REGULAR_EXPRESSION "^way 20\n node 10 \\(7.11,1.01\\)\n node 11 \\(7.11,1.04\\)\n node 12 \\(7.14,1.04\\)\n$")
add_test(NAME examples_location_cache_dump
COMMAND osmium_index_lookup --list=${CMAKE_CURRENT_BINARY_DIR}/locations.idx --type=location --dump)
set_tests_properties(examples_location_cache_dump PROPERTIES
DEPENDS examples_location_cache_create
PASS_REGULAR_EXPRESSION "^10 \\(7.11,1.01\\)\n11 \\(7.11,1.04\\)\n12 \\(7.14,1.04\\)\n13 \\(7.14,1.01\\)\n$")
add_test(NAME examples_location_cache_search
COMMAND osmium_index_lookup --list=${CMAKE_CURRENT_BINARY_DIR}/locations.idx --type=location --search=12)
set_tests_properties(examples_location_cache_search PROPERTIES
DEPENDS examples_location_cache_create
PASS_REGULAR_EXPRESSION "^12 \\(7.14,1.04\\)\n$")
@@ -0,0 +1,7 @@
<?xml version='1.0' encoding='UTF-8'?>
<osm version="0.6" generator="testdata" upload="false">
<node id="10" version="1" timestamp="2014-01-01T00:00:00Z" uid="1" user="test" changeset="1" lon="7.11" lat="1.01"/>
<node id="11" version="1" timestamp="2014-01-01T00:00:00Z" uid="1" user="test" changeset="1" lon="7.11" lat="1.04"/>
<node id="12" version="1" timestamp="2014-01-01T00:00:00Z" uid="1" user="test" changeset="1" lon="7.14" lat="1.04"/>
<node id="13" version="1" timestamp="2014-01-01T00:00:00Z" uid="1" user="test" changeset="1" lon="7.14" lat="1.01"/>
</osm>
@@ -0,0 +1,9 @@
<?xml version='1.0' encoding='UTF-8'?>
<osm version="0.6" generator="testdata" upload="false">
<way id="20" version="1" timestamp="2014-01-01T00:00:00Z" uid="1" user="test" changeset="1">
<nd ref="10"/>
<nd ref="11"/>
<nd ref="12"/>
<tag k="highway" v="primary"/>
</way>
</osm>
@@ -0,0 +1,21 @@
add_test(NAME examples_pub_names_node
COMMAND osmium_pub_names ${CMAKE_CURRENT_SOURCE_DIR}/pub-node.osm)
set_tests_properties(examples_pub_names_node PROPERTIES
PASS_REGULAR_EXPRESSION "^Im Holze\n$")
add_test(NAME examples_pub_names_way
COMMAND osmium_pub_names ${CMAKE_CURRENT_SOURCE_DIR}/pub-way.osm)
set_tests_properties(examples_pub_names_way PROPERTIES
PASS_REGULAR_EXPRESSION "^Vereinsheim\n$")
add_test(NAME examples_pub_names_noname
COMMAND osmium_pub_names ${CMAKE_CURRENT_SOURCE_DIR}/pub-noname.osm)
set_tests_properties(examples_pub_names_noname PROPERTIES
PASS_REGULAR_EXPRESSION "^pub with unknown name\n$")
add_test(NAME examples_pub_names_addr
COMMAND osmium_pub_names ${CMAKE_CURRENT_SOURCE_DIR}/pub-addr.osm)
set_tests_properties(examples_pub_names_addr PROPERTIES
PASS_REGULAR_EXPRESSION "^Im Holze\n addr:city: Bremen\n")
@@ -0,0 +1,10 @@
<?xml version='1.0' encoding='UTF-8'?>
<osm version="0.6">
<node id="167199652" version="3" timestamp="2010-12-27T13:15:02Z" uid="57645" user="KartoGrapHiti" changeset="6777507" lat="53.0526516" lon="8.8919477">
<tag k="addr:city" v="Bremen"/>
<tag k="addr:housenumber" v="28"/>
<tag k="addr:street" v="Kleine Westerholzstraße"/>
<tag k="amenity" v="pub"/>
<tag k="name" v="Im Holze"/>
</node>
</osm>
@@ -0,0 +1,7 @@
<?xml version='1.0' encoding='UTF-8'?>
<osm version="0.6">
<node id="167199652" version="3" timestamp="2010-12-27T13:15:02Z" uid="57645" user="KartoGrapHiti" changeset="6777507" lat="53.0526516" lon="8.8919477">
<tag k="amenity" v="pub"/>
<tag k="name" v="Im Holze"/>
</node>
</osm>
@@ -0,0 +1,6 @@
<?xml version='1.0' encoding='UTF-8'?>
<osm version="0.6">
<node id="167199652" version="3" timestamp="2010-12-27T13:15:02Z" uid="57645" user="KartoGrapHiti" changeset="6777507" lat="53.0526516" lon="8.8919477">
<tag k="amenity" v="pub"/>
</node>
</osm>
@@ -0,0 +1,21 @@
<?xml version='1.0' encoding='UTF-8'?>
<osm version="0.6">
<node id="498785553" version="4" timestamp="2012-08-05T19:02:18Z" uid="342705" user="KonB" changeset="12624818" lat="53.5657289" lon="8.5727548"/>
<node id="498785555" version="4" timestamp="2012-08-05T19:02:18Z" uid="342705" user="KonB" changeset="12624818" lat="53.5657308" lon="8.5730408"/>
<node id="498785556" version="4" timestamp="2012-08-05T19:02:18Z" uid="342705" user="KonB" changeset="12624818" lat="53.5656184" lon="8.5730429"/>
<node id="498785558" version="4" timestamp="2012-08-05T19:02:18Z" uid="342705" user="KonB" changeset="12624818" lat="53.5656176" lon="8.5729218"/>
<node id="498785560" version="4" timestamp="2012-08-05T19:02:18Z" uid="342705" user="KonB" changeset="12624818" lat="53.5654994" lon="8.572924"/>
<node id="498785561" version="4" timestamp="2012-08-05T19:02:18Z" uid="342705" user="KonB" changeset="12624818" lat="53.5654983" lon="8.5727591"/>
<way id="40948654" version="2" timestamp="2009-09-17T09:27:41Z" uid="42429" user="42429" changeset="2509937">
<nd ref="498785553"/>
<nd ref="498785555"/>
<nd ref="498785556"/>
<nd ref="498785558"/>
<nd ref="498785560"/>
<nd ref="498785561"/>
<nd ref="498785553"/>
<tag k="name" v="Vereinsheim"/>
<tag k="amenity" v="pub"/>
<tag k="building" v="yes"/>
</way>
</osm>
@@ -0,0 +1,4 @@
add_test(NAME examples_read
COMMAND osmium_read ${CMAKE_CURRENT_SOURCE_DIR}/data.osm)
+29
View File
@@ -0,0 +1,29 @@
<?xml version='1.0' encoding='UTF-8'?>
<osm version="0.6" generator="testdata" upload="false">
<node id="701000" version="1" timestamp="2014-01-01T00:00:00Z" uid="1" user="test" changeset="1" lon="7.11" lat="1.01"/>
<node id="701001" version="1" timestamp="2014-01-01T00:00:00Z" uid="1" user="test" changeset="1" lon="7.11" lat="1.04"/>
<node id="701002" version="1" timestamp="2014-01-01T00:00:00Z" uid="1" user="test" changeset="1" lon="7.14" lat="1.04"/>
<node id="701003" version="1" timestamp="2014-01-01T00:00:00Z" uid="1" user="test" changeset="1" lon="7.14" lat="1.01"/>
<way id="701800" version="1" timestamp="2014-01-01T00:00:00Z" uid="1" user="test" changeset="1">
<nd ref="701000"/>
<nd ref="701001"/>
<nd ref="701002"/>
<tag k="test:section" v="mp-geom"/>
<tag k="test:id" v="701"/>
</way>
<way id="701801" version="1" timestamp="2014-01-01T00:00:00Z" uid="1" user="test" changeset="1">
<nd ref="701002"/>
<nd ref="701003"/>
<nd ref="701000"/>
<tag k="test:section" v="mp-geom"/>
<tag k="test:id" v="701"/>
</way>
<relation id="701900" version="1" timestamp="2014-01-01T00:00:00Z" uid="1" user="test" changeset="1">
<member type="way" ref="701800" role="outer"/>
<member type="way" ref="701801" role="outer"/>
<tag k="type" v="multipolygon"/>
<tag k="test:section" v="mp-geom"/>
<tag k="test:id" v="701"/>
<tag k="landuse" v="forest"/>
</relation>
</osm>
@@ -0,0 +1,4 @@
add_test(NAME examples_read_with_progress
COMMAND osmium_read_with_progress ${CMAKE_CURRENT_SOURCE_DIR}/data.osm)
@@ -0,0 +1,29 @@
<?xml version='1.0' encoding='UTF-8'?>
<osm version="0.6" generator="testdata" upload="false">
<node id="701000" version="1" timestamp="2014-01-01T00:00:00Z" uid="1" user="test" changeset="1" lon="7.11" lat="1.01"/>
<node id="701001" version="1" timestamp="2014-01-01T00:00:00Z" uid="1" user="test" changeset="1" lon="7.11" lat="1.04"/>
<node id="701002" version="1" timestamp="2014-01-01T00:00:00Z" uid="1" user="test" changeset="1" lon="7.14" lat="1.04"/>
<node id="701003" version="1" timestamp="2014-01-01T00:00:00Z" uid="1" user="test" changeset="1" lon="7.14" lat="1.01"/>
<way id="701800" version="1" timestamp="2014-01-01T00:00:00Z" uid="1" user="test" changeset="1">
<nd ref="701000"/>
<nd ref="701001"/>
<nd ref="701002"/>
<tag k="test:section" v="mp-geom"/>
<tag k="test:id" v="701"/>
</way>
<way id="701801" version="1" timestamp="2014-01-01T00:00:00Z" uid="1" user="test" changeset="1">
<nd ref="701002"/>
<nd ref="701003"/>
<nd ref="701000"/>
<tag k="test:section" v="mp-geom"/>
<tag k="test:id" v="701"/>
</way>
<relation id="701900" version="1" timestamp="2014-01-01T00:00:00Z" uid="1" user="test" changeset="1">
<member type="way" ref="701800" role="outer"/>
<member type="way" ref="701801" role="outer"/>
<tag k="type" v="multipolygon"/>
<tag k="test:section" v="mp-geom"/>
<tag k="test:id" v="701"/>
<tag k="landuse" v="forest"/>
</relation>
</osm>
@@ -0,0 +1,8 @@
add_test(NAME examples_road_length
COMMAND osmium_road_length ${CMAKE_CURRENT_SOURCE_DIR}/road.osm)
set_tests_properties(examples_road_length PROPERTIES
PASS_REGULAR_EXPRESSION "^Length: 0\\.405.*km\n$"
)
@@ -0,0 +1,59 @@
<?xml version="1.0" encoding="UTF-8"?>
<osm version="0.6" generator="CGImap 0.3.3 (31041 thorn-01.openstreetmap.org)" copyright="OpenStreetMap and contributors" attribution="http://www.openstreetmap.org/copyright" license="http://opendatacommons.org/licenses/odbl/1-0/">
<node id="5599384" visible="true" version="5" changeset="829716" timestamp="2009-03-18T17:16:26Z" user="burts" uid="97529" lat="51.0271601" lon="13.7252197"/>
<node id="250384970" visible="true" version="3" changeset="855544" timestamp="2009-01-30T21:58:37Z" user="saftl" uid="7989" lat="51.0288568" lon="13.7248159">
<tag k="created_by" v="JOSM"/>
</node>
<node id="250996316" visible="true" version="5" changeset="838711" timestamp="2009-03-21T13:10:39Z" user="burts" uid="97529" lat="51.0274683" lon="13.7251464"/>
<node id="250996321" visible="true" version="3" changeset="855544" timestamp="2009-01-30T21:59:14Z" user="saftl" uid="7989" lat="51.0284283" lon="13.7249179">
<tag k="created_by" v="JOSM"/>
</node>
<node id="252587568" visible="true" version="3" changeset="855544" timestamp="2009-01-30T21:58:45Z" user="saftl" uid="7989" lat="51.0275477" lon="13.7251275">
<tag k="created_by" v="JOSM"/>
</node>
<node id="5599381" visible="true" version="6" changeset="15768585" timestamp="2013-04-18T01:20:26Z" user="Wolle DD" uid="1161559" lat="51.0307642" lon="13.7243263"/>
<node id="1122039499" visible="true" version="2" changeset="26063898" timestamp="2014-10-14T04:09:11Z" user="Seandebasti" uid="550560" lat="51.0285248" lon="13.7248970"/>
<node id="1122039521" visible="true" version="2" changeset="12753110" timestamp="2012-08-16T17:03:47Z" user="TEAM_CN_TUD" uid="716608" lat="51.0277456" lon="13.7250806"/>
<node id="5599382" visible="true" version="6" changeset="8191054" timestamp="2011-05-19T16:19:51Z" user="stw1701" uid="102899" lat="51.0297991" lon="13.7245892"/>
<node id="1299329303" visible="true" version="1" changeset="8242335" timestamp="2011-05-25T07:46:01Z" user="bigbug21" uid="15748" lat="51.0290875" lon="13.7247628"/>
<node id="1868844753" visible="true" version="2" changeset="13260925" timestamp="2012-09-26T15:26:31Z" user="TEAM_CN_TUD" uid="716608" lat="51.0289617" lon="13.7247917"/>
<node id="1868844765" visible="true" version="2" changeset="13260925" timestamp="2012-09-26T15:26:31Z" user="TEAM_CN_TUD" uid="716608" lat="51.0292872" lon="13.7247140"/>
<node id="1868844782" visible="true" version="2" changeset="13260925" timestamp="2012-09-26T15:26:31Z" user="TEAM_CN_TUD" uid="716608" lat="51.0295717" lon="13.7246429"/>
<node id="1922091528" visible="true" version="2" changeset="13260925" timestamp="2012-09-26T15:26:31Z" user="TEAM_CN_TUD" uid="716608" lat="51.0281700" lon="13.7249813"/>
<node id="1953249124" visible="true" version="1" changeset="13418280" timestamp="2012-10-08T20:18:35Z" user="TEAM_CN_TUD" uid="716608" lat="51.0292437" lon="13.7247246"/>
<node id="2015120752" visible="true" version="1" changeset="13883494" timestamp="2012-11-15T14:22:31Z" user="TEAM_CN_TUD" uid="716608" lat="51.0293536" lon="13.7246974"/>
<node id="2056871900" visible="true" version="1" changeset="14207491" timestamp="2012-12-09T00:03:11Z" user="bigbug21" uid="15748" lat="51.0305821" lon="13.7243895"/>
<node id="2458246647" visible="true" version="1" changeset="17836591" timestamp="2013-09-14T17:05:06Z" user="bigbug21" uid="15748" lat="51.0295979" lon="13.7246367"/>
<node id="250384969" visible="true" version="4" changeset="17857555" timestamp="2013-09-15T20:17:55Z" user="4b696d" uid="1420318" lat="51.0282021" lon="13.7249734"/>
<node id="3128723784" visible="true" version="1" changeset="26063898" timestamp="2014-10-14T04:09:07Z" user="Seandebasti" uid="550560" lat="51.0281018" lon="13.7249973"/>
<way id="4428564" visible="true" version="21" changeset="26063898" timestamp="2014-10-14T04:09:13Z" user="Seandebasti" uid="550560">
<nd ref="5599381"/>
<nd ref="2056871900"/>
<nd ref="5599382"/>
<nd ref="2458246647"/>
<nd ref="1868844782"/>
<nd ref="2015120752"/>
<nd ref="1868844765"/>
<nd ref="1953249124"/>
<nd ref="1299329303"/>
<nd ref="1868844753"/>
<nd ref="250384970"/>
<nd ref="1122039499"/>
<nd ref="250996321"/>
<nd ref="250384969"/>
<nd ref="1922091528"/>
<nd ref="3128723784"/>
<nd ref="1122039521"/>
<nd ref="252587568"/>
<nd ref="250996316"/>
<nd ref="5599384"/>
<tag k="highway" v="residential"/>
<tag k="lit" v="yes"/>
<tag k="maxspeed" v="30"/>
<tag k="name" v="Helmholtzstraße"/>
<tag k="postal_code" v="01069"/>
<tag k="sidewalk" v="both"/>
<tag k="smoothness" v="good"/>
<tag k="surface" v="asphalt"/>
</way>
</osm>
@@ -0,0 +1,18 @@
add_test(NAME examples_tiles_zoom_too_large
COMMAND osmium_tiles 50 1 1)
set_tests_properties(examples_tiles_zoom_too_large PROPERTIES WILL_FAIL true)
add_test(NAME examples_tiles_location_invalid
COMMAND osmium_tiles 1 200 200)
set_tests_properties(examples_tiles_location_invalid PROPERTIES WILL_FAIL true)
add_test(NAME examples_tiles_okay
COMMAND osmium_tiles 8 55.3 11.7)
set_tests_properties(examples_tiles_okay PROPERTIES
PASS_REGULAR_EXPRESSION "^WGS84: lon=55.3 lat=11.7\nMercator: x=.*\nTile: zoom=8 x=167 y=119\n$"
)