Browse Source

add test data

tags/1.4.4
Etienne Trimaille 3 years ago
parent
commit
b9d3ecf5d6
4 changed files with 123577 additions and 0 deletions
  1. 0
    0
      core/parser/test/__init__.py
  2. 89
    0
      test/data/no_metadata.osm
  3. 123468
    0
      test/data/town-metadata.osm
  4. 20
    0
      test/utilities.py

+ 0
- 0
core/parser/test/__init__.py View File


+ 89
- 0
test/data/no_metadata.osm View File

@@ -0,0 +1,89 @@
<?xml version="1.0" encoding="UTF-8"?>
<osm version="0.6" generator="Overpass API">
<note>The data included in this document is from www.openstreetmap.org. The data is made available under ODbL.</note>
<meta osm_base="2015-10-19T14:46:02Z"/>

<node id="3777334159" lat="45.7849384" lon="4.9998369">
<tag k="emergency" v="fire_hydrant"/>
<tag k="fire_hydrant:position" v="sidewalk"/>
<tag k="fire_hydrant:type" v="pillar"/>
<tag k="ref" v="13725"/>
</node>
<node id="3777435958" lat="45.7808696" lon="5.0000452">
<tag k="emergency" v="fire_hydrant"/>
<tag k="fire_hydrant:count" v="3"/>
<tag k="fire_hydrant:position" v="sidewalk"/>
<tag k="fire_hydrant:type" v="pillar"/>
<tag k="ref" v="5535"/>
</node>
<node id="3777439858" lat="45.7829257" lon="4.9990890">
<tag k="emergency" v="fire_hydrant"/>
<tag k="fire_hydrant:count" v="3"/>
<tag k="fire_hydrant:position" v="sidewalk"/>
<tag k="fire_hydrant:type" v="pillar"/>
<tag k="ref" v="5536"/>
</node>
<node id="3777914634" lat="45.7847061" lon="5.0005261">
<tag k="emergency" v="fire_hydrant"/>
<tag k="fire_hydrant:position" v="sidewalk"/>
<tag k="fire_hydrant:type" v="pillar"/>
<tag k="ref" v="14419"/>
</node>
<node id="3778381966" lat="45.7854432" lon="5.0013583">
<tag k="emergency" v="fire_hydrant"/>
<tag k="fire_hydrant:position" v="sidewalk"/>
<tag k="fire_hydrant:type" v="pillar"/>
<tag k="ref" v="13723"/>
</node>
<node id="3778418558" lat="45.7851798" lon="5.0022340">
<tag k="emergency" v="fire_hydrant"/>
<tag k="fire_hydrant:position" v="green"/>
<tag k="fire_hydrant:type" v="pillar"/>
<tag k="ref" v="14120"/>
</node>
<node id="3778427784" lat="45.7850451" lon="5.0045106">
<tag k="emergency" v="fire_hydrant"/>
<tag k="fire_hydrant:position" v="sidewalk"/>
<tag k="fire_hydrant:type" v="pillar"/>
</node>
<node id="3778428068" lat="45.7813562" lon="5.0023197">
<tag k="emergency" v="fire_hydrant"/>
<tag k="fire_hydrant:count" v="3"/>
<tag k="fire_hydrant:position" v="sidewalk"/>
<tag k="fire_hydrant:type" v="pillar"/>
<tag k="ref" v="5607"/>
</node>
<node id="3778428171" lat="45.7821032" lon="5.0054256">
<tag k="emergency" v="fire_hydrant"/>
<tag k="fire_hydrant:position" v="sidewalk"/>
<tag k="fire_hydrant:type" v="pillar"/>
<tag k="ref" v="5534"/>
</node>
<node id="3778436918" lat="45.7817920" lon="5.0001067">
<tag k="emergency" v="fire_hydrant"/>
<tag k="fire_hydrant:count" v="3"/>
<tag k="fire_hydrant:position" v="sidewalk"/>
<tag k="fire_hydrant:type" v="pillar"/>
<tag k="ref" v="7441"/>
</node>
<node id="3778443957" lat="45.7832462" lon="5.0048516">
<tag k="emergency" v="fire_hydrant"/>
<tag k="fire_hydrant:position" v="green"/>
<tag k="fire_hydrant:type" v="pillar"/>
<tag k="ref" v="11318"/>
</node>
<node id="3778450257" lat="45.7818184" lon="5.0052596">
<tag k="emergency" v="fire_hydrant"/>
<tag k="fire_hydrant:position" v="sidewalk"/>
<tag k="fire_hydrant:type" v="pillar"/>
<tag k="ref" v="8291"/>
</node>
<node id="3778455961" lat="45.7824337" lon="4.9999679">
<tag k="emergency" v="fire_hydrant"/>
<tag k="fire_hydrant:count" v="3"/>
<tag k="fire_hydrant:position" v="sidewalk"/>
<tag k="fire_hydrant:type" v="pillar"/>
<tag k="ref" v="4982"/>
</node>

</osm>

+ 123468
- 0
test/data/town-metadata.osm
File diff suppressed because it is too large
View File


+ 20
- 0
test/utilities.py View File

@@ -3,6 +3,7 @@

import sys
import logging
from os.path import dirname, abspath, join

LOGGER = logging.getLogger('QGIS')
QGIS_APP = None # Static variable used to hold hand to running QGIS app
@@ -11,6 +12,25 @@ IFACE = None
PARENT = None


def test_data_path(*args):
"""Return the absolute path to the QuickOSM test data or directory path.

:param args: List of path e.g. ['control', 'files',
'test-error-message.txt'] or ['control', 'scenarios'] to get the path
to scenarios dir.
:type args: list

:return: Absolute path to the test data or dir path.
:rtype: str
"""
path = dirname(__file__)
path = abspath(join(path, 'data'))
for item in args:
path = abspath(join(path, item))

return path


def get_qgis_app():
""" Start one QGIS application to test against.


Loading…
Cancel
Save