diff --git a/.github/workflows/test_py2.yml b/.github/workflows/test_py2.yml new file mode 100644 index 0000000..effadd2 --- /dev/null +++ b/.github/workflows/test_py2.yml @@ -0,0 +1,22 @@ +name: test-py2 + +on: [push] + +jobs: + testpy2: + runs-on: ubuntu-18.04 + + steps: + - uses: actions/checkout@v2 + # Use the python version installed by Ubuntu 18.04 (version 2.7.15), + # so we can use precompiled gdal and protobuf + - name: Install xmllint and GDAL + run: sudo apt-get install -y libxml2-utils gdal-bin libgdal-dev python-gdal + - name: "Install python dependencies: cram and lxml" + run: | + python -m pip install --upgrade pip + pip install cram lxml + - name: Testing the code with cram + run: | + cram testfiles/basic_py2.t + diff --git a/.github/workflows/test_py3.yml b/.github/workflows/test_py3.yml new file mode 100644 index 0000000..72db512 --- /dev/null +++ b/.github/workflows/test_py3.yml @@ -0,0 +1,22 @@ +name: test-py3 + +on: [push] + +jobs: + testpy3: + runs-on: ubuntu-20.04 + + steps: + - uses: actions/checkout@v2 + # Use the python version installed by Ubuntu 20.04 (version 3.8.5), + # so we can use precompiled gdal and protobuf + - name: Install xmllint and GDAL + run: sudo apt-get install -y libxml2-utils gdal-bin libgdal-dev python3-gdal + - name: "Install python dependencies: cram and lxml" + run: | + python -m pip install --upgrade pip + pip install cram lxml + - name: Testing the code with cram + run: | + cram testfiles/basic.t + diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..f824637 --- /dev/null +++ b/.gitignore @@ -0,0 +1,11 @@ +*.pyc +*.osm +*.shp +*.shx +*.prj +*.dbf +*.SHP +*.SHX +*.PRJ +*.DBF +.DS_Store diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..54529aa --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "translations"] + path = translations + url = git://github.com/pnorman/ogr2osm-translations.git diff --git a/Contributing.md b/Contributing.md new file mode 100644 index 0000000..81261d5 --- /dev/null +++ b/Contributing.md @@ -0,0 +1,13 @@ +## Tests +Test your code and make sure it passes. cram is used for tests. + +Changes in speed-critical parts of the code may require profiling. + +## Licensing + +ogr2osm is under the MIT license. If you are committing to ogr2osm, +you are committing under this license. If you do not wish to do so, +do not submit pull requests. + +If you wish to be added to the copyright holders list, submit a pull +request. diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..71f1494 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +Copyright (c) 2012-2013 Paul Norman , Sebastiaan Couwenberg +, The University of Vermont + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + diff --git a/README.md b/README.md new file mode 100644 index 0000000..2845ae7 --- /dev/null +++ b/README.md @@ -0,0 +1,94 @@ +ogr2osm.py +========== + +[![test-py2](https://github.com/pnorman/ogr2osm/actions/workflows/test_py2.yml/badge.svg)](https://github.com/pnorman/ogr2osm/actions/workflows/test_py2.yml) [![test-py3](https://github.com/pnorman/ogr2osm/actions/workflows/test_py3.yml/badge.svg)](https://github.com/pnorman/ogr2osm/actions/workflows/test_py3.yml) + +A tool for converting ogr-readable files like shapefiles into .osm data + +!!! Notice !!! +-------------- + +This version is no longer maintained, do not file new issues or pull requests here. Development will continue [here](https://github.com/roelderickx/ogr2osm). + +Installation +------------ + +ogr2osm requires gdal with python bindings. Depending on the file formats +you want to read you may have to compile it yourself but there should be no +issues with shapefiles. On Ubuntu you can run `sudo apt-get install -y python-gdal python-lxml` to get +the software you need. + +It also makes use of lxml. Although it should fall back to builtin XML implementations seamlessly these are less likely to be tested and will most likely run much slower. + +To install ogr2osm and download the default translations the following command +can be used: + + git clone --recursive https://github.com/pnorman/ogr2osm + +To update + + cd ogr2osm + git pull + git submodule update + +About +----- + +This version of ogr2osm is based on +[Andrew Guertin's version for UVM](https://github.com/andrewguertin/ogr2osm) +which is in turn based on Ivan Ortega's version from the OSM SVN server. + +ogr2osm will read any data source that ogr can read and handle reprojection for +you. It takes a python file to translate external data source tags into OSM +tags, allowing you to use complicated logic. If no translation is specified it +will use an identity translation, carrying all tags from the source to the .osm +output. + +Import Cautions +--------------- +Anyone planning an import into OpenStreetMap should read and review the import +guidelines located [on the wiki](http://wiki.openstreetmap.org/wiki/Import/Guidelines). +When writing your translation file you should look at other examples and +carefully consider each external data source tag to see if it should be +converted to an OSM tag. + +Usage +----- + + Usage: ogr2osm.py SRCFILE + + Options: + -h, --help show this help message and exit + -t TRANSLATION, --translation=TRANSLATION + Select the attribute-tags translation method. See the + translations/ directory for valid values. + -o OUTPUT, --output=OUTPUT + Set destination .osm file name and location. + -e EPSG_CODE, --epsg=EPSG_CODE + EPSG code of source file. Do not include the 'EPSG:' + prefix. If specified, overrides projection from source + metadata if it exists. + -p PROJ4_STRING, --proj4=PROJ4_STRING + PROJ.4 string. If specified, overrides projection from + source metadata if it exists. + -v, --verbose + -d, --debug-tags Output the tags for every feature parsed. + -f, --force Force overwrite of output file. + --encoding=ENCODING Encoding of the source file. If specified, overrides + the default of utf-8 + --significant-digits=SIGNIFICANTDIGITS + Number of decimal places for coordinates + --rounding-digits=ROUNDINGDIGITS + Number of decimal places for rounding + --no-memory-copy Do not make an in-memory working copy + --no-upload-false Omit upload=false from the completed file to surpress + JOSM warnings when uploading. + --never-download Prevent JOSM from downloading more data to this file. + --never-upload Completely disables all upload commands for this file + in JOSM, rather than merely showing a warning before + uploading. + --locked Prevent any changes to this file in JOSM, such as + editing or downloading, and also prevents uploads. + Implies upload="never" and download="never". + --id=ID ID to start counting from for the output file. + Defaults to 0. diff --git a/SimpleXMLWriter.py b/SimpleXMLWriter.py deleted file mode 100644 index af3023f..0000000 --- a/SimpleXMLWriter.py +++ /dev/null @@ -1,279 +0,0 @@ -# -# SimpleXMLWriter -# $Id: SimpleXMLWriter.py 2312 2005-03-02 18:13:39Z fredrik $ -# -# a simple XML writer -# -# history: -# 2001-12-28 fl created -# 2002-11-25 fl fixed attribute encoding -# 2002-12-02 fl minor fixes for 1.5.2 -# 2004-06-17 fl added pythondoc markup -# 2004-07-23 fl added flush method (from Jay Graves) -# 2004-10-03 fl added declaration method -# -# Copyright (c) 2001-2004 by Fredrik Lundh -# -# fredrik@pythonware.com -# http://www.pythonware.com -# -# -------------------------------------------------------------------- -# The SimpleXMLWriter module is -# -# Copyright (c) 2001-2004 by Fredrik Lundh -# -# By obtaining, using, and/or copying this software and/or its -# associated documentation, you agree that you have read, understood, -# and will comply with the following terms and conditions: -# -# Permission to use, copy, modify, and distribute this software and -# its associated documentation for any purpose and without fee is -# hereby granted, provided that the above copyright notice appears in -# all copies, and that both that copyright notice and this permission -# notice appear in supporting documentation, and that the name of -# Secret Labs AB or the author not be used in advertising or publicity -# pertaining to distribution of the software without specific, written -# prior permission. -# -# SECRET LABS AB AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD -# TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANT- -# ABILITY AND FITNESS. IN NO EVENT SHALL SECRET LABS AB OR THE AUTHOR -# BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY -# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS -# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE -# OF THIS SOFTWARE. -# -------------------------------------------------------------------- - -## -# Tools to write XML files, without having to deal with encoding -# issues, well-formedness, etc. -#

-# The current version does not provide built-in support for -# namespaces. To create files using namespaces, you have to provide -# "xmlns" attributes and explicitly add prefixes to tags and -# attributes. -# -#

Patterns

-# -# The following example generates a small XHTML document. -#
-#
-# from elementtree.SimpleXMLWriter import XMLWriter
-# import sys
-#
-# w = XMLWriter(sys.stdout)
-#
-# html = w.start("html")
-#
-# w.start("head")
-# w.element("title", "my document")
-# w.element("meta", name="generator", value="my application 1.0")
-# w.end()
-#
-# w.start("body")
-# w.element("h1", "this is a heading")
-# w.element("p", "this is a paragraph")
-#
-# w.start("p")
-# w.data("this is ")
-# w.element("b", "bold")
-# w.data(" and ")
-# w.element("i", "italic")
-# w.data(".")
-# w.end("p")
-#
-# w.close(html)
-# 
-## - -import re, sys, string - -try: - unicode("") -except NameError: - def encode(s, encoding): - # 1.5.2: application must use the right encoding - return s - _escape = re.compile(r"[&<>\"\x80-\xff]+") # 1.5.2 -else: - def encode(s, encoding): - return s.encode(encoding) - _escape = re.compile(eval(r'u"[&<>\"\u0080-\uffff]+"')) - -def encode_entity(text, pattern=_escape): - # map reserved and non-ascii characters to numerical entities - def escape_entities(m): - out = [] - for char in m.group(): - out.append("&#%d;" % ord(char)) - return string.join(out, "") - return encode(pattern.sub(escape_entities, text), "ascii") - -del _escape - -# -# the following functions assume an ascii-compatible encoding -# (or "utf-16") - -def escape_cdata(s, encoding=None, replace=string.replace): - s = replace(s, "&", "&") - s = replace(s, "<", "<") - s = replace(s, ">", ">") - if encoding: - try: - return encode(s, encoding) - except UnicodeError: - return encode_entity(s) - return s - -def escape_attrib(s, encoding=None, replace=string.replace): - s = replace(s, "&", "&") - s = replace(s, "'", "'") - s = replace(s, "\"", """) - s = replace(s, "<", "<") - s = replace(s, ">", ">") - if encoding: - try: - return encode(s, encoding) - except UnicodeError: - return encode_entity(s) - return s - -## -# XML writer class. -# -# @param file A file or file-like object. This object must implement -# a write method that takes an 8-bit string. -# @param encoding Optional encoding. - -class XMLWriter: - - def __init__(self, file, encoding="us-ascii"): - if not hasattr(file, "write"): - file = open(file, "w") - self.__write = file.write - if hasattr(file, "flush"): - self.flush = file.flush - self.__open = 0 # true if start tag is open - self.__tags = [] - self.__data = [] - self.__encoding = encoding - - def __flush(self): - # flush internal buffers - if self.__open: - self.__write(">") - self.__open = 0 - if self.__data: - data = string.join(self.__data, "") - self.__write(escape_cdata(data, self.__encoding)) - self.__data = [] - - ## - # Writes an XML declaration. - - def declaration(self): - encoding = self.__encoding - if encoding == "us-ascii" or encoding == "utf-8": - self.__write("\n") - else: - self.__write("\n" % encoding) - - ## - # Opens a new element. Attributes can be given as keyword - # arguments, or as a string/string dictionary. You can pass in - # 8-bit strings or Unicode strings; the former are assumed to use - # the encoding passed to the constructor. The method returns an - # opaque identifier that can be passed to the close method, - # to close all open elements up to and including this one. - # - # @param tag Element tag. - # @param attrib Attribute dictionary. Alternatively, attributes - # can be given as keyword arguments. - # @return An element identifier. - - def start(self, tag, attrib={}, **extra): - self.__flush() - tag = escape_cdata(tag, self.__encoding) - self.__data = [] - self.__tags.append(tag) - self.__write("<%s" % tag) - if attrib or extra: - attrib = attrib.copy() - attrib.update(extra) - attrib = attrib.items() - attrib.sort() - for k, v in attrib: - k = escape_cdata(k, self.__encoding) - v = escape_attrib(v, self.__encoding) - self.__write(" %s=\"%s\"" % (k, v)) - self.__open = 1 - return len(self.__tags)-1 - - ## - # Adds a comment to the output stream. - # - # @param comment Comment text, as an 8-bit string or Unicode string. - - def comment(self, comment): - self.__flush() - self.__write("\n" % escape_cdata(comment, self.__encoding)) - - ## - # Adds character data to the output stream. - # - # @param text Character data, as an 8-bit string or Unicode string. - - def data(self, text): - self.__data.append(text) - - ## - # Closes the current element (opened by the most recent call to - # start). - # - # @param tag Element tag. If given, the tag must match the start - # tag. If omitted, the current element is closed. - - def end(self, tag=None): - if tag: - assert self.__tags, "unbalanced end(%s)" % tag - assert escape_cdata(tag, self.__encoding) == self.__tags[-1],\ - "expected end(%s), got %s" % (self.__tags[-1], tag) - else: - assert self.__tags, "unbalanced end()" - tag = self.__tags.pop() - if self.__data: - self.__flush() - elif self.__open: - self.__open = 0 - self.__write(" />") - return - self.__write("" % tag) - - ## - # Closes open elements, up to (and including) the element identified - # by the given identifier. - # - # @param id Element identifier, as returned by the start method. - - def close(self, id): - while len(self.__tags) > id: - self.end() - - ## - # Adds an entire element. This is the same as calling start, - # data, and end in sequence. The text argument - # can be omitted. - - def element(self, tag, text=None, attrib={}, **extra): - apply(self.start, (tag, attrib), extra) - if text: - self.data(text) - self.end() - - ## - # Flushes the output stream. - - def flush(self): - pass # replaced by the constructor diff --git a/geom.py b/geom.py new file mode 100644 index 0000000..18cfbde --- /dev/null +++ b/geom.py @@ -0,0 +1,67 @@ +# -*- coding: utf-8 -*- +# +# Copyright (c) 2012-2013 Paul Norman +# +# Released under the MIT license, as given in the file LICENSE, which must +# accompany any distribution of this code. + +# Classes +class Geometry(object): + elementIdCounter = 0 + elementIdCounterIncr = -1 + geometries = [] + def __init__(self): + self.id = getNewID() + self.parents = set() + Geometry.geometries.append(self) + def replacejwithi(self, i, j): + pass + def addparent(self, parent): + self.parents.add(parent) + def removeparent(self, parent, shoulddestroy=True): + self.parents.discard(parent) + if shoulddestroy and len(self.parents) == 0: + Geometry.geometries.remove(self) + +# Helper function to get a new ID +def getNewID(): + Geometry.elementIdCounter += Geometry.elementIdCounterIncr + return Geometry.elementIdCounter + +class Point(Geometry): + def __init__(self, x, y): + Geometry.__init__(self) + self.x = x + self.y = y + def replacejwithi(self, i, j): + pass + +class Way(Geometry): + def __init__(self): + Geometry.__init__(self) + self.points = [] + def replacejwithi(self, i, j): + self.points = [i if x == j else x for x in self.points] + j.removeparent(self) + i.addparent(self) + +class Relation(Geometry): + def __init__(self): + Geometry.__init__(self) + self.members = [] + def replacejwithi(self, i, j): + self.members = [(i, x[1]) if x[0] == j else x for x in self.members] + j.removeparent(self) + i.addparent(self) + +class Feature(object): + features = [] + def __init__(self): + self.geometry = None + self.tags = {} + Feature.features.append(self) + def replacejwithi(self, i, j): + if self.geometry == j: + self.geometry = i + j.removeparent(self) + i.addparent(self) diff --git a/ogr2osm.py b/ogr2osm.py index 22ba1a3..6a8c470 100755 --- a/ogr2osm.py +++ b/ogr2osm.py @@ -1,7 +1,7 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- -""" ogr2osm beta +''' ogr2osm beta This program takes any vector data understadable by OGR and outputs an OSM file with that data. @@ -23,11 +23,11 @@ For additional usage information, run ogr2osm.py --help +Copyright (c) 2012-2013 Paul Norman , Sebastiaan Couwenberg +, The University of Vermont - -Copyright (c) 2012 The University of Vermont - 1: - parser.error("you have specified too many arguments, " + - "only supply the source filename") - -# Input and output file -# if no output file given, use the basename of the source but with .osm -sourceFile = os.path.realpath(args[0]) -if options.outputFile is not None: - options.outputFile = os.path.realpath(options.outputFile) -else: - (base, ext) = os.path.splitext(os.path.basename(sourceFile)) - options.outputFile = os.path.join(os.getcwd(), base + ".osm") -if not options.forceOverwrite and os.path.exists(options.outputFile): - parser.error("ERROR: output file '%s' exists" % (options.outputFile)) -l.info("Preparing to convert file '%s' to '%s'." % (sourceFile, options.outputFile)) - -# Projection -if not options.sourcePROJ4 and not options.sourceEPSG: - l.info("Will try to detect projection from source metadata, or fall back to EPSG:4326") -elif options.sourcePROJ4: - l.info("Will use the PROJ.4 string: " + options.sourcePROJ4) -elif options.sourceEPSG: - l.info("Will use EPSG:" + str(options.sourceEPSG)) - -# Stuff needed for locating translation methods -if options.translationMethod: - # add dirs to path if necessary - (root, ext) = os.path.splitext(options.translationMethod) - if os.path.exists(options.translationMethod) and ext == '.py': - # user supplied translation file directly - sys.path.insert(0, os.path.dirname(root)) - else: - # first check translations in the subdir translations of cwd - sys.path.insert(0, os.path.join(os.getcwd(), "translations")) - # then check subdir of script dir - sys.path.insert(1, os.path.join(os.path.abspath(__file__), "translations")) - # (the cwd will also be checked implicityly) +# import logging and set logging level to DEBUG +import logging as l +l.basicConfig(level=l.DEBUG, format="%(message)s") - # strip .py if present, as import wants just the module name - if ext == '.py': - options.translationMethod = os.path.basename(root) +# Determine major Python version is 2 or 3 +IS_PYTHON2 = sys.version_info < (3, 0) - try: - translations = __import__(options.translationMethod) - except: - parser.error("Could not load translation method '%s'. Translation " - "script must be in your current directory, or in the " - "translations/ subdirectory of your current or ogr2osm.py " - "directory.") % (options.translationMethod) - l.info("Successfully loaded '%s' translation method ('%s')." - % (options.translationMethod, os.path.realpath(translations.__file__))) -else: - import types - translations = types.ModuleType("translationmodule") - l.info("Using default translations") +''' -try: - translations.filterLayer(None) - l.debug("Using user filterLayer") -except: - l.debug("Using default filterLayer") - translations.filterLayer = lambda layer: layer +See http://lxml.de/tutorial.html for the source of the includes -try: - translations.filterFeature(None, None, None) - l.debug("Using user filterFeature") -except: - l.debug("Using default filterFeature") - translations.filterFeature = lambda feature, fieldNames, reproject: feature +lxml should be the fastest method -try: - translations.filterTags(None) - l.debug("Using user filterTags") -except: - l.debug("Using default filterTags") - translations.filterTags = lambda tags: tags +''' try: - translations.filterFeaturePost(None, None, None) - l.debug("Using user filterFeaturePost") -except: - l.debug("Using default filterFeaturePost") - translations.filterFeaturePost = lambda feature, fieldNames, reproject: feature + from lxml import etree + l.debug("running with lxml.etree") +except ImportError: + try: + # Python 2.5 + import xml.etree.ElementTree as etree + l.debug("running with ElementTree on Python 2.5+") + except ImportError: + try: + # normal cElementTree install + import cElementTree as etree + l.debug("running with cElementTree") + except ImportError: + try: + # normal ElementTree install + import elementtree.ElementTree as etree + l.debug("running with ElementTree") + except ImportError: + l.error("Failed to import ElementTree from any known place") + raise + + +# Initialize +UNIQUE_NODE_INDEX = {} + + +def openData(source): + if re.match('^PG:', source): + return openDatabaseSource(source) + else: + return getFileData(source) -try: - translations.preOutputTransform(None, None) - l.debug("Using user preOutputTransform") -except: - l.debug("Using default preOutputTransform") - translations.preOutputTransform = lambda geometries, features: None - -# Done options parsing, now to program code - -# Some global variables to hold stuff... -geometries = [] -features = [] - -# Helper function to get a new ID -elementIdCounter = 0 -def getNewID(): - global elementIdCounter - elementIdCounter -= 1 - return elementIdCounter - -# Classes -class Geometry(object): - id = 0 - def __init__(self): - self.id = getNewID() - self.parents = set() - global geometries - geometries.append(self) - def replacejwithi(self, i, j): - pass - def addparent(self, parent): - self.parents.add(parent) - def removeparent(self, parent, shoulddestroy=True): - self.parents.discard(parent) - if shoulddestroy and len(self.parents) == 0: - global geometries - geometries.remove(self) - -class Point(Geometry): - def __init__(self, x, y): - Geometry.__init__(self) - self.x = x - self.y = y - def replacejwithi(self, i, j): - pass - -class Way(Geometry): - def __init__(self): - Geometry.__init__(self) - self.points = [] - def replacejwithi(self, i, j): - self.points = map(lambda x: i if x == j else x, self.points) - j.removeparent(self) - i.addparent(self) - -class Relation(Geometry): - def __init__(self): - Geometry.__init__(self) - self.members = [] - def replacejwithi(self, i, j): - self.members = map(lambda x: i if x == j else x, self.members) - j.removeparent(self) - i.addparent(self) - -class Feature(object): - geometry = None - tags = {} - def __init__(self): - global features - features.append(self) - def replacejwithi(self, i, j): - if self.geometry == j: - self.geometry = i - j.removeparent(self) - i.addparent(self) -def getFileData(filename): - if not os.path.isfile(filename): - parser.error("the file '%s' does not exist" % (filename)) - dataSource = ogr.Open(filename, 0) # 0 means read-only +def openDatabaseSource(source): + dataSource = ogr.Open(source, 0) # 0 means read-only if dataSource is None: - l.error('OGR failed to open ' + filename + ', format may be unsuported') + l.error('OGR failed to open connection to' + source) + sys.exit(1) + else: + return dataSource + + +def getFileData(filename): + ogr_accessmethods = [ "/vsicurl/", "/vsicurl_streaming/", "/vsisubfile/", + "/vsistdin/" ] + ogr_filemethods = [ "/vsisparse/", "/vsigzip/", "/vsitar/", "/vsizip/" ] + ogr_unsupported = [ "/vsimem/", "/vsistdout/", ] + has_unsup = [ m for m in ogr_unsupported if m[1:-1] in filename.split('/') ] + if has_unsup: + parser.error("Unsupported OGR access method(s) found: %s." + % str(has_unsup)[1:-1]) + if not any([ m[1:-1] in filename.split('/') for m in ogr_accessmethods ]): + # Not using any ogr_accessmethods + real_filename = filename + for fm in ogr_filemethods: + if filename.find(fm) == 0: + real_filename = filename[len(fm):] + break + if not os.path.exists(real_filename): + parser.error("the file '%s' does not exist" % (real_filename)) + if len(filename) == len(real_filename): + if filename.endswith('.gz'): + filename = '/vsigzip/' + filename + elif filename.endswith('.tar') or filename.endswith('.tgz') or \ + filename.endswith('.tar.gz'): + filename = '/vsitar/' + filename + elif filename.endswith('.zip'): + filename = '/vsizip/' + filename + + fileDataSource = ogr.Open(filename, 0) # 0 means read-only + if fileDataSource is None: + l.error('OGR failed to open ' + filename + ', format may be unsupported') sys.exit(1) - return dataSource + if OPTIONS.noMemoryCopy: + return fileDataSource + else: + memoryDataSource = ogr.GetDriverByName('Memory').CopyDataSource(fileDataSource,'memoryCopy') + return memoryDataSource + def parseData(dataSource): l.debug("Parsing data") - global translations - for i in range(dataSource.GetLayerCount()): - layer = dataSource.GetLayer(i) + global TRANSLATIONS + if OPTIONS.sqlQuery: + layer = dataSource.ExecuteSQL(OPTIONS.sqlQuery) layer.ResetReading() - parseLayer(translations.filterLayer(layer)) + parseLayer(TRANSLATIONS.filterLayer(layer)) + else: + for i in range(dataSource.GetLayerCount()): + layer = dataSource.GetLayer(i) + layer.ResetReading() + parseLayer(TRANSLATIONS.filterLayer(layer)) + def getTransform(layer): - global options + global OPTIONS # First check if the user supplied a projection, then check the layer, # then fall back to a default spatialRef = None - if options.sourcePROJ4: + if OPTIONS.sourcePROJ4: spatialRef = osr.SpatialReference() - spatialRef.ImportFromProj4(options.sourcePROJ4) - elif options.sourceEPSG: + spatialRef.ImportFromProj4(OPTIONS.sourcePROJ4) + elif OPTIONS.sourceEPSG: spatialRef = osr.SpatialReference() - spatialRef.ImportFromEPSG(options.sourceEPSG) + spatialRef.ImportFromEPSG(OPTIONS.sourceEPSG) else: spatialRef = layer.GetSpatialRef() if spatialRef != None: @@ -293,16 +187,21 @@ def getTransform(layer): # Some python magic: skip reprojection altogether by using a dummy # lamdba funcion. Otherwise, the lambda will be a call to the OGR # reprojection stuff. - reproject = lambda(geometry): None + reproject = lambda geometry: None else: destSpatialRef = osr.SpatialReference() + try: + destSpatialRef.SetAxisMappingStrategy(osr.OAMS_TRADITIONAL_GIS_ORDER) + except AttributeError: + pass # Destionation projection will *always* be EPSG:4326, WGS84 lat-lon destSpatialRef.ImportFromEPSG(4326) coordTrans = osr.CoordinateTransformation(spatialRef, destSpatialRef) - reproject = lambda(geometry): geometry.Transform(coordTrans) + reproject = lambda geometry: geometry.Transform(coordTrans) return reproject + def getLayerFields(layer): featureDefinition = layer.GetLayerDefn() fieldNames = [] @@ -311,21 +210,31 @@ def getLayerFields(layer): fieldNames.append(featureDefinition.GetFieldDefn(j).GetNameRef()) return fieldNames + def getFeatureTags(ogrfeature, fieldNames): + ''' + This function builds up a dictionary with the source data attributes and passes them to the filterTags function, returning the result. + ''' tags = {} for i in range(len(fieldNames)): - tags[fieldNames[i]] = ogrfeature.GetFieldAsString(i) - return translations.filterTags(tags) + # The field needs to be put into the appropriate encoding and leading or trailing spaces stripped + if IS_PYTHON2: + tags[fieldNames[i].decode(OPTIONS.encoding)] = ogrfeature.GetFieldAsString(i).decode(OPTIONS.encoding).strip() + else: + tags[fieldNames[i]] = ogrfeature.GetFieldAsString(i).strip() + return TRANSLATIONS.filterTags(tags) + def parseLayer(layer): if layer is None: return fieldNames = getLayerFields(layer) reproject = getTransform(layer) - + for j in range(layer.GetFeatureCount()): ogrfeature = layer.GetNextFeature() - parseFeature(translations.filterFeature(ogrfeature, fieldNames, reproject), fieldNames, reproject) + parseFeature(TRANSLATIONS.filterFeature(ogrfeature, fieldNames, reproject), fieldNames, reproject) + def parseFeature(ogrfeature, fieldNames, reproject): if ogrfeature is None: @@ -335,50 +244,67 @@ def parseFeature(ogrfeature, fieldNames, reproject): if ogrgeometry is None: return reproject(ogrgeometry) - geometry = parseGeometry(ogrgeometry) - if geometry is None: - return - - feature = Feature() - feature.tags = getFeatureTags(ogrfeature, fieldNames) - feature.geometry = geometry - geometry.addparent(feature) + geometries = parseGeometry([ogrgeometry]) + + for geometry in geometries: + if geometry is None: + return + + feature = Feature() + feature.tags = getFeatureTags(ogrfeature, fieldNames) + feature.geometry = geometry + geometry.addparent(feature) + + TRANSLATIONS.filterFeaturePost(feature, ogrfeature, ogrgeometry) + + +def parseGeometry(ogrgeometries): + returngeometries = [] + for ogrgeometry in ogrgeometries: + geometryType = ogrgeometry.GetGeometryType() + + if (geometryType == ogr.wkbPoint or + geometryType == ogr.wkbPoint25D): + returngeometries.append(parsePoint(ogrgeometry)) + elif (geometryType == ogr.wkbLineString or + geometryType == ogr.wkbLinearRing or + geometryType == ogr.wkbLineString25D): +# geometryType == ogr.wkbLinearRing25D does not exist + returngeometries.append(parseLineString(ogrgeometry)) + elif (geometryType == ogr.wkbPolygon or + geometryType == ogr.wkbPolygon25D): + returngeometries.append(parsePolygon(ogrgeometry)) + elif (geometryType == ogr.wkbMultiPoint or + geometryType == ogr.wkbMultiLineString or + geometryType == ogr.wkbMultiPolygon or + geometryType == ogr.wkbGeometryCollection or + geometryType == ogr.wkbMultiPoint25D or + geometryType == ogr.wkbMultiLineString25D or + geometryType == ogr.wkbMultiPolygon25D or + geometryType == ogr.wkbGeometryCollection25D): + returngeometries.extend(parseCollection(ogrgeometry)) + else: + l.warning("unhandled geometry, type: " + str(geometryType)) + returngeometries.append(None) - translations.filterFeaturePost(feature, ogrfeature, ogrgeometry) - + return returngeometries -def parseGeometry(ogrgeometry): - geometryType = ogrgeometry.GetGeometryType() - if (geometryType == ogr.wkbPoint or - geometryType == ogr.wkbPoint25D): - return parsePoint(ogrgeometry) - elif (geometryType == ogr.wkbLineString or - geometryType == ogr.wkbLinearRing or - geometryType == ogr.wkbLineString25D): -# geometryType == ogr.wkbLinearRing25D does not exist - return parseLineString(ogrgeometry) - elif (geometryType == ogr.wkbPolygon or - geometryType == ogr.wkbPolygon25D): - return parsePolygon(ogrgeometry) - elif (geometryType == ogr.wkbMultiPoint or - geometryType == ogr.wkbMultiLineString or - geometryType == ogr.wkbMultiPolygon or - geometryType == ogr.wkbGeometryCollection or - geometryType == ogr.wkbMultiPoint25D or - geometryType == ogr.wkbMultiLineString25D or - geometryType == ogr.wkbMultiPolygon25D or - geometryType == ogr.wkbGeometryCollection25D): - return parseCollection(ogrgeometry) +def addPoint(x, y): + global UNIQUE_NODE_INDEX + rx = int(round(x * 10**OPTIONS.roundingDigits)) + ry = int(round(y * 10**OPTIONS.roundingDigits)) + if (rx, ry) in UNIQUE_NODE_INDEX: + return Geometry.geometries[UNIQUE_NODE_INDEX[(rx, ry)]] else: - l.warning("unhandled geometry, type: " + str(geometryType)) - return None + UNIQUE_NODE_INDEX[(rx, ry)] = len(Geometry.geometries) + point = Point(int(round(x*10**OPTIONS.significantDigits)), int(round(y*10**OPTIONS.significantDigits))) + return point + def parsePoint(ogrgeometry): - x = ogrgeometry.GetX() - y = ogrgeometry.GetY() - geometry = Point(x, y) - return geometry + return addPoint(ogrgeometry.GetX(), ogrgeometry.GetY()) + def parseLineString(ogrgeometry): geometry = Way() @@ -386,18 +312,23 @@ def parseLineString(ogrgeometry): # and instead have to create the point ourself for i in range(ogrgeometry.GetPointCount()): (x, y, unused) = ogrgeometry.GetPoint(i) - mypoint = Point(x, y) + mypoint = addPoint(x, y) geometry.points.append(mypoint) mypoint.addparent(geometry) return geometry + def parsePolygon(ogrgeometry): # Special case polygons with only one ring. This does not (or at least # should not) change behavior when simplify relations is turned on. if ogrgeometry.GetGeometryCount() == 0: l.warning("Polygon with no rings?") elif ogrgeometry.GetGeometryCount() == 1: - return parseLineString(ogrgeometry.GetGeometryRef(0)) + result = parseLineString(ogrgeometry.GetGeometryRef(0)) + if len(result.points) > OPTIONS.maxNodesPerWay: + global LONG_WAYS_FROM_POLYGONS + LONG_WAYS_FROM_POLYGONS.add(result) + return result else: geometry = Relation() try: @@ -413,94 +344,429 @@ def parsePolygon(ogrgeometry): geometry.members.append((interior, "inner")) return geometry + def parseCollection(ogrgeometry): # OGR MultiPolygon maps easily to osm multipolygon, so special case it # TODO: Does anything else need special casing? geometryType = ogrgeometry.GetGeometryType() if (geometryType == ogr.wkbMultiPolygon or geometryType == ogr.wkbMultiPolygon25D): - geometry = Relation() - for polygon in range(ogrgeometry.GetGeometryCount()): - exterior = parseLineString(ogrgeometry.GetGeometryRef(polygon).GetGeometryRef(0)) - exterior.addparent(geometry) - geometry.members.append((exterior, "outer")) - for i in range(1, ogrgeometry.GetGeometryRef(polygon).GetGeometryCount()): - interior = parseLineString(ogrgeometry.GetGeometryRef(polygon).GetGeometryRef(i)) - interior.addparent(geometry) - geometry.members.append((interior, "inner")) + if ogrgeometry.GetGeometryCount() > 1: + geometry = Relation() + for polygon in range(ogrgeometry.GetGeometryCount()): + exterior = parseLineString(ogrgeometry.GetGeometryRef(polygon).GetGeometryRef(0)) + exterior.addparent(geometry) + geometry.members.append((exterior, "outer")) + for i in range(1, ogrgeometry.GetGeometryRef(polygon).GetGeometryCount()): + interior = parseLineString(ogrgeometry.GetGeometryRef(polygon).GetGeometryRef(i)) + interior.addparent(geometry) + geometry.members.append((interior, "inner")) + return [geometry] + else: + return [parsePolygon(ogrgeometry.GetGeometryRef(0))] + elif (geometryType == ogr.wkbMultiLineString or + geometryType == ogr.wkbMultiLineString25D): + geometries = [] + for linestring in range(ogrgeometry.GetGeometryCount()): + geometries.append(parseLineString(ogrgeometry.GetGeometryRef(linestring))) + return geometries else: geometry = Relation() for i in range(ogrgeometry.GetGeometryCount()): member = parseGeometry(ogrgeometry.GetGeometryRef(i)) member.addparent(geometry) geometry.members.append((member, "member")) - return geometry + return [geometry] + + +def mergeWayPoints(): + l.debug("Merging duplicate points in ways") + ways = [geom for geom in Geometry.geometries if type(geom) == Way] + + # Remove duplicate points from ways, + # a duplicate has the same id as its predecessor + for way in ways: + previous = OPTIONS.id + merged_points = [] + + for node in way.points: + if previous == OPTIONS.id or previous != node.id: + merged_points.append(node) + previous = node.id + + if len(merged_points) > 0: + way.points = merged_points + + +def splitLongWays(max_points_in_way, waysToCreateRelationFor): + l.debug("Splitting long ways") + ways = [geom for geom in Geometry.geometries if type(geom) == Way] + + featuresmap = {feature.geometry : feature for feature in Feature.features} + + + for way in ways: + is_way_in_relation = len([p for p in way.parents if type(p) == Relation]) > 0 + if len(way.points) > max_points_in_way: + way_parts = splitWay(way, max_points_in_way, featuresmap, is_way_in_relation) + if not is_way_in_relation: + if way in waysToCreateRelationFor: + mergeIntoNewRelation(way_parts) + else: + for rel in way.parents: + splitWayInRelation(rel, way_parts) + + +def splitWay(way, max_points_in_way, features_map, is_way_in_relation): + new_points = [way.points[i:i + max_points_in_way] for i in range(0, len(way.points), max_points_in_way - 1)] + new_ways = [way, ] + [Way() for i in range(len(new_points) - 1)] + + if not is_way_in_relation: + way_tags = features_map[way].tags + + for new_way in new_ways: + if new_way != way: + feat = Feature() + feat.geometry = new_way + feat.tags = way_tags + + for new_way, points in zip(new_ways, new_points): + new_way.points = points + if new_way.id != way.id: + for point in points: + point.removeparent(way, shoulddestroy=False) + point.addparent(new_way) + + return new_ways + + +def mergeIntoNewRelation(way_parts): + new_relation = Relation() + feat = Feature() + feat.geometry = new_relation + new_relation.members = [(way, "outer") for way in way_parts] + for way in way_parts: + way.addparent(new_relation) + + +def splitWayInRelation(rel, way_parts): + way_roles = [m[1] for m in rel.members if m[0] == way_parts[0]] + way_role = "" if len(way_roles) == 0 else way_roles[0] + for way in way_parts[1:]: + rel.members.append((way, way_role)) + -def mergePoints(): - l.debug("Merging points") - global geometries - points = [geometry for geometry in geometries if type(geometry) == Point] - - # Make list of Points at each location - l.debug("Making list") - pointcoords = {} - for i in points: - try: - pointcoords[(i.x, i.y)].append(i) - except KeyError: - pointcoords[(i.x, i.y)] = [i] - - # Use list to get rid of extras - l.debug("Checking list") - for (location, pointsatloc) in pointcoords.items(): - if len(pointsatloc) > 1: - for point in pointsatloc[1:]: - for parent in set(point.parents): - parent.replacejwithi(pointsatloc[0], point) - def output(): l.debug("Outputting XML") # First, set up a few data structures for optimization purposes - global geometries, features - nodes = [geometry for geometry in geometries if type(geometry) == Point] - ways = [geometry for geometry in geometries if type(geometry) == Way] - relations = [geometry for geometry in geometries if type(geometry) == Relation] - featuresmap = {feature.geometry : feature for feature in features} - - w = XMLWriter(open(options.outputFile, 'w')) - w.start("osm", version='0.6', generator='uvmogr2osm') - - for node in nodes: - w.start("node", visible="true", id=str(node.id), lat=str(node.y), lon=str(node.x)) - if node in featuresmap: - for (key, value) in featuresmap[node].tags.items(): - w.element("tag", k=key, v=value) - w.end("node") + nodes = [geom for geom in Geometry.geometries if type(geom) == Point] + ways = [geom for geom in Geometry.geometries if type(geom) == Way] + relations = [geom for geom in Geometry.geometries if type(geom) == Relation] + featuresmap = {feature.geometry : feature for feature in Feature.features} + + # Open up the output file with the system default buffering + with open(OPTIONS.outputFile, 'w', buffering=-1) as f: + + dec_string = '\n') + + +def main(): + global TRANSLATIONS + global OPTIONS + global UNIQUE_NODE_INDEX + global LONG_WAYS_FROM_POLYGONS + + # Setup program usage + usage = """%prog SRCFILE + + SRCFILE can be a file path or a org PostgreSQL connection string such as: + "PG:dbname=pdx_bldgs user=emma host=localhost" (including the quotes)""" + parser = optparse.OptionParser(usage=usage) + parser.add_option("-t", "--translation", dest="translationMethod", + metavar="TRANSLATION", + help="Select the attribute-tags translation method. See " + + "the translations/ directory for valid values.") + parser.add_option("-o", "--output", dest="outputFile", metavar="OUTPUT", + help="Set destination .osm file name and location.") + parser.add_option("-e", "--epsg", dest="sourceEPSG", metavar="EPSG_CODE", + help="EPSG code of source file. Do not include the " + + "'EPSG:' prefix. If specified, overrides projection " + + "from source metadata if it exists.") + parser.add_option("-p", "--proj4", dest="sourcePROJ4", metavar="PROJ4_STRING", + help="PROJ.4 string. If specified, overrides projection " + + "from source metadata if it exists.") + parser.add_option("-v", "--verbose", dest="verbose", action="store_true") + parser.add_option("-d", "--debug-tags", dest="debugTags", action="store_true", + help="Output the tags for every feature parsed.") + parser.add_option("-f", "--force", dest="forceOverwrite", action="store_true", + help="Force overwrite of output file.") + + parser.add_option("--encoding", dest="encoding", + help="Encoding of the source file. If specified, overrides " + + "the default of utf-8", default="utf-8") + + parser.add_option("--significant-digits", dest="significantDigits", type=int, + help="Number of decimal places for coordinates", default=9) + + parser.add_option("--rounding-digits", dest="roundingDigits", type=int, + help="Number of decimal places for rounding", default=7) + + parser.add_option("--no-memory-copy", dest="noMemoryCopy", action="store_true", + help="Do not make an in-memory working copy") + + parser.add_option("--no-upload-false", dest="noUploadFalse", action="store_true", + help="Omit upload=false from the completed file to surpress JOSM warnings when uploading.") + + parser.add_option("--never-download", dest="neverDownload", action="store_true", + help="Prevent JOSM from downloading more data to this file.") + + parser.add_option("--never-upload", dest="neverUpload", action="store_true", + help="Completely disables all upload commands for this file in JOSM, " + + "rather than merely showing a warning before uploading.") + + parser.add_option("--locked", dest="locked", action="store_true", + help="Prevent any changes to this file in JOSM, " + + "such as editing or downloading, and also prevents uploads. " + + "Implies upload=\"never\" and download=\"never\".") + + parser.add_option("--id", dest="id", type=int, default=0, + help="ID to start counting from for the output file. Defaults to 0.") + + parser.add_option("--idfile", dest="idfile", type=str, default=None, + help="Read ID to start counting from from a file.") + + parser.add_option("--split-ways", dest="maxNodesPerWay", type=int, default=1800, + help="Split ways with more than the specified number of nodes. Defaults to 1800. " + + "Any value below 2 - do not split.") + + parser.add_option("--saveid", dest="saveid", type=str, default=None, + help="Save last ID after execution to a file.") + + # Positive IDs can cause big problems if used inappropriately so hide the help for this + parser.add_option("--positive-id", dest="positiveID", action="store_true", + help=optparse.SUPPRESS_HELP) + + # Add version attributes. Again, this can cause big problems so surpress the help + parser.add_option("--add-version", dest="addVersion", action="store_true", + help=optparse.SUPPRESS_HELP) + + # Add timestamp attributes. Again, this can cause big problems so surpress the help + parser.add_option("--add-timestamp", dest="addTimestamp", action="store_true", + help=optparse.SUPPRESS_HELP) + + parser.add_option("--sql", dest="sqlQuery", type=str, default=None, + help="SQL query to execute on a PostgreSQL source") + + parser.set_defaults(sourceEPSG=None, sourcePROJ4=None, verbose=False, + debugTags=False, + translationMethod=None, outputFile=None, + forceOverwrite=False, noUploadFalse=False, + neverDownload=False, neverUpload=False, + locked=False) + + # Parse and process arguments + (OPTIONS, args) = parser.parse_args() - for way in ways: - w.start("way", visible="true", id=str(way.id)) - for node in way.points: - w.element("nd", ref=str(node.id)) - if way in featuresmap: - for (key, value) in featuresmap[way].tags.items(): - w.element("tag", k=key, v=value) - w.end("way") - - for relation in relations: - w.start("relation", visible="true", id=str(relation.id)) - for (member, role) in relation.members: - w.element("member", type="way", ref=str(member.id), role=role) - if relation in featuresmap: - for (key, value) in featuresmap[relation].tags.items(): - w.element("tag", k=key, v=value) - w.end("relation") - - w.end("osm") - - -# Main flow -data = getFileData(sourceFile) -parseData(data) -mergePoints() -translations.preOutputTransform(geometries, features) -output() + try: + if OPTIONS.sourceEPSG: + OPTIONS.sourceEPSG = int(OPTIONS.sourceEPSG) + except: + parser.error("EPSG code must be numeric (e.g. '4326', not 'epsg:4326')") + + if len(args) < 1: + parser.print_help() + parser.error("you must specify a source filename") + elif len(args) > 1: + parser.error("you have specified too many arguments, " + + "only supply the source filename") + + if OPTIONS.addTimestamp: + from datetime import datetime + + # Input and output file + # if no output file given, use the basename of the source but with .osm + source = args[0] + sourceIsDatabase = bool(re.match('^PG:', source)) + + if OPTIONS.outputFile is not None: + OPTIONS.outputFile = os.path.realpath(OPTIONS.outputFile) + elif sourceIsDatabase: + parser.error("ERROR: An output file must be explicitly specified when using a database source") + else: + (base, ext) = os.path.splitext(os.path.basename(source)) + OPTIONS.outputFile = os.path.join(os.getcwd(), base + ".osm") + + if OPTIONS.sqlQuery and not sourceIsDatabase: + parser.error("ERROR: You must use a database source when specifying a query with --sql") + + if not OPTIONS.forceOverwrite and os.path.exists(OPTIONS.outputFile): + parser.error("ERROR: output file '%s' exists" % (OPTIONS.outputFile)) + l.info("Preparing to convert '%s' to '%s'." % (source, OPTIONS.outputFile)) + + # Projection + if not OPTIONS.sourcePROJ4 and not OPTIONS.sourceEPSG: + l.info("Will try to detect projection from source metadata, or fall back to EPSG:4326") + elif OPTIONS.sourcePROJ4: + l.info("Will use the PROJ.4 string: " + OPTIONS.sourcePROJ4) + elif OPTIONS.sourceEPSG: + l.info("Will use EPSG:" + str(OPTIONS.sourceEPSG)) + + # Stuff needed for locating translation methods + if OPTIONS.translationMethod: + # add dirs to path if necessary + (root, ext) = os.path.splitext(OPTIONS.translationMethod) + if os.path.exists(OPTIONS.translationMethod) and ext == '.py': + # user supplied translation file directly + sys.path.insert(0, os.path.dirname(root)) + else: + # first check translations in the subdir translations of cwd + sys.path.insert(0, os.path.join(os.getcwd(), "translations")) + # then check subdir of script dir + sys.path.insert(1, os.path.join(os.path.dirname(__file__), "translations")) + # (the cwd will also be checked implicityly) + + # strip .py if present, as import wants just the module name + if ext == '.py': + OPTIONS.translationMethod = os.path.basename(root) + + try: + TRANSLATIONS = __import__(OPTIONS.translationMethod, fromlist = ['']) + except ImportError as e: + parser.error("Could not load translation method '%s'. Translation " + "script must be in your current directory, or in the " + "translations/ subdirectory of your current or ogr2osm.py " + "directory. The following directories have been considered: %s" + % (OPTIONS.translationMethod, str(sys.path))) + except SyntaxError as e: + parser.error("Syntax error in '%s'. Translation script is malformed:\n%s" + % (OPTIONS.translationMethod, e)) + + l.info("Successfully loaded '%s' translation method ('%s')." + % (OPTIONS.translationMethod, os.path.realpath(TRANSLATIONS.__file__))) + else: + import types + TRANSLATIONS = types.ModuleType("translationmodule") + l.info("Using default translations") + + default_translations = [ + ('filterLayer', lambda layer: layer), + ('filterFeature', lambda feature, fieldNames, reproject: feature), + ('filterTags', lambda tags: tags), + ('filterFeaturePost', lambda feature, fieldNames, reproject: feature), + ('preOutputTransform', lambda geometries, features: None), + ] + + for (k, v) in default_translations: + if hasattr(TRANSLATIONS, k) and getattr(TRANSLATIONS, k): + l.debug("Using user " + k) + else: + l.debug("Using default " + k) + setattr(TRANSLATIONS, k, v) + + Geometry.elementIdCounter = OPTIONS.id + if OPTIONS.idfile: + with open(OPTIONS.idfile, 'r') as ff: + Geometry.elementIdCounter = int(ff.readline(20)) + l.info("Starting counter value '%d' read from file '%s'." \ + % (Geometry.elementIdCounter, OPTIONS.idfile)) + + if OPTIONS.positiveID: + Geometry.elementIdCounterIncr = 1 # default is -1 + + # Main flow + data = openData(source) + LONG_WAYS_FROM_POLYGONS = set() + parseData(data) + mergeWayPoints() + if OPTIONS.maxNodesPerWay >= 2: + splitLongWays(OPTIONS.maxNodesPerWay, LONG_WAYS_FROM_POLYGONS) + TRANSLATIONS.preOutputTransform(Geometry.geometries, Feature.features) + output() + if OPTIONS.saveid: + with open(OPTIONS.saveid, 'w') as ff: + ff.write(str(Geometry.elementIdCounter)) + l.info("Wrote elementIdCounter '%d' to file '%s'" + % (Geometry.elementIdCounter, OPTIONS.saveid)) + + +if __name__ == '__main__': + main() diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..7b15e9b --- /dev/null +++ b/setup.py @@ -0,0 +1,23 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +from setuptools import setup + +setup( + name='ogr2osm', + version='0.1', + author='pnorman', + author_email='penorman@mac.com', + description="pnorman's version of UVM's Rewrite of ogr2osm", + license='MIT', + url='https://github.com/pnorman/ogr2osm/', + py_modules=[ + 'ogr2osm', + 'geom', + ], + entry_points={ + 'console_scripts': [ + 'ogr2osm=ogr2osm:main', + ] + } +) diff --git a/testfiles/basic.t b/testfiles/basic.t new file mode 100644 index 0000000..095b52a --- /dev/null +++ b/testfiles/basic.t @@ -0,0 +1,426 @@ + $ [ "$0" != "/bin/bash" ] || shopt -s expand_aliases + $ [ -n "$PYTHON" ] || PYTHON="`which python`" + $ alias ogr2osm="$PYTHON $TESTDIR/../ogr2osm.py" + +usage: + + $ ogr2osm -h + running with lxml.etree + Usage: ogr2osm.py SRCFILE + + SRCFILE can be a file path or a org PostgreSQL connection string such as: + "PG:dbname=pdx_bldgs user=emma host=localhost" (including the quotes) + + Options: + -h, --help show this help message and exit + -t TRANSLATION, --translation=TRANSLATION + Select the attribute-tags translation method. See the + translations/ directory for valid values. + -o OUTPUT, --output=OUTPUT + Set destination .osm file name and location. + -e EPSG_CODE, --epsg=EPSG_CODE + EPSG code of source file. Do not include the 'EPSG:' + prefix. If specified, overrides projection from source + metadata if it exists. + -p PROJ4_STRING, --proj4=PROJ4_STRING + PROJ.4 string. If specified, overrides projection from + source metadata if it exists. + -v, --verbose + -d, --debug-tags Output the tags for every feature parsed. + -f, --force Force overwrite of output file. + --encoding=ENCODING Encoding of the source file. If specified, overrides + the default of utf-8 + --significant-digits=SIGNIFICANTDIGITS + Number of decimal places for coordinates + --rounding-digits=ROUNDINGDIGITS + Number of decimal places for rounding + --no-memory-copy Do not make an in-memory working copy + --no-upload-false Omit upload=false from the completed file to surpress + JOSM warnings when uploading. + --never-download Prevent JOSM from downloading more data to this file. + --never-upload Completely disables all upload commands for this file + in JOSM, rather than merely showing a warning before + uploading. + --locked Prevent any changes to this file in JOSM, such as + editing or downloading, and also prevents uploads. + Implies upload="never" and download="never". + --id=ID ID to start counting from for the output file. + Defaults to 0. + --idfile=IDFILE Read ID to start counting from from a file. + --split-ways=MAXNODESPERWAY + Split ways with more than the specified number of + nodes. Defaults to 1800. Any value below 2 - do not + split. + --saveid=SAVEID Save last ID after execution to a file. + --sql=SQLQUERY SQL query to execute on a PostgreSQL source + +test1: + $ rm -f test1.osm + $ ogr2osm $TESTDIR/shapefiles/test1.shp + running with lxml.etree + Preparing to convert .* (re) + Will try to detect projection from source metadata, or fall back to EPSG:4326 + Using default translations + Using default filterLayer + Using default filterFeature + Using default filterTags + Using default filterFeaturePost + Using default preOutputTransform + Parsing data + Detected projection metadata: + PROJCS["NAD83 / UTM zone 10N", + GEOGCS["NAD83", + DATUM["North_American_Datum_1983", + SPHEROID["GRS 1980",6378137,298.257222101, + AUTHORITY["EPSG","7019"]], + AUTHORITY["EPSG","6269"]], + PRIMEM["Greenwich",0, + AUTHORITY["EPSG","8901"]], + UNIT["degree",0.0174532925199433, + AUTHORITY["EPSG","9122"]], + AUTHORITY["EPSG","4269"]], + PROJECTION["Transverse_Mercator"], + PARAMETER["latitude_of_origin",0], + PARAMETER["central_meridian",-123], + PARAMETER["scale_factor",0.9996], + PARAMETER["false_easting",500000], + PARAMETER["false_northing",0], + UNIT["metre",1, + AUTHORITY["EPSG","9001"]], + AXIS["Easting",EAST], + AXIS["Northing",NORTH], + AUTHORITY["EPSG","26910"]] + Merging duplicate points in ways + Splitting long ways + Outputting XML + $ xmllint --format test1.osm | diff -uNr - $TESTDIR/test1.xml + +duplicatefile: + $ ogr2osm $TESTDIR/shapefiles/test1.shp + running with lxml.etree + Usage: ogr2osm.py SRCFILE + + SRCFILE can be a file path or a org PostgreSQL connection string such as: + "PG:dbname=pdx_bldgs user=emma host=localhost" (including the quotes) + + ogr2osm.py: error: ERROR: output file .*test1.osm' exists (re) + [2] + + +force: + $ ogr2osm -f $TESTDIR/shapefiles/test1.shp + running with lxml.etree + Preparing to convert .* (re) + Will try to detect projection from source metadata, or fall back to EPSG:4326 + Using default translations + Using default filterLayer + Using default filterFeature + Using default filterTags + Using default filterFeaturePost + Using default preOutputTransform + Parsing data + Detected projection metadata: + PROJCS["NAD83 / UTM zone 10N", + GEOGCS["NAD83", + DATUM["North_American_Datum_1983", + SPHEROID["GRS 1980",6378137,298.257222101, + AUTHORITY["EPSG","7019"]], + AUTHORITY["EPSG","6269"]], + PRIMEM["Greenwich",0, + AUTHORITY["EPSG","8901"]], + UNIT["degree",0.0174532925199433, + AUTHORITY["EPSG","9122"]], + AUTHORITY["EPSG","4269"]], + PROJECTION["Transverse_Mercator"], + PARAMETER["latitude_of_origin",0], + PARAMETER["central_meridian",-123], + PARAMETER["scale_factor",0.9996], + PARAMETER["false_easting",500000], + PARAMETER["false_northing",0], + UNIT["metre",1, + AUTHORITY["EPSG","9001"]], + AXIS["Easting",EAST], + AXIS["Northing",NORTH], + AUTHORITY["EPSG","26910"]] + Merging duplicate points in ways + Splitting long ways + Outputting XML + $ xmllint --format test1.osm | diff -uNr - $TESTDIR/test1.xml + +nomemorycopy: + $ ogr2osm -f --no-memory-copy $TESTDIR/shapefiles/test1.shp + running with lxml.etree + Preparing to convert .* (re) + Will try to detect projection from source metadata, or fall back to EPSG:4326 + Using default translations + Using default filterLayer + Using default filterFeature + Using default filterTags + Using default filterFeaturePost + Using default preOutputTransform + Parsing data + Detected projection metadata: + PROJCS["NAD83 / UTM zone 10N", + GEOGCS["NAD83", + DATUM["North_American_Datum_1983", + SPHEROID["GRS 1980",6378137,298.257222101, + AUTHORITY["EPSG","7019"]], + AUTHORITY["EPSG","6269"]], + PRIMEM["Greenwich",0, + AUTHORITY["EPSG","8901"]], + UNIT["degree",0.0174532925199433, + AUTHORITY["EPSG","9122"]], + AUTHORITY["EPSG","4269"]], + PROJECTION["Transverse_Mercator"], + PARAMETER["latitude_of_origin",0], + PARAMETER["central_meridian",-123], + PARAMETER["scale_factor",0.9996], + PARAMETER["false_easting",500000], + PARAMETER["false_northing",0], + UNIT["metre",1, + AUTHORITY["EPSG","9001"]], + AXIS["Easting",EAST], + AXIS["Northing",NORTH], + AUTHORITY["EPSG","26910"]] + Merging duplicate points in ways + Splitting long ways + Outputting XML + $ xmllint --format test1.osm | diff -uNr - $TESTDIR/test1.xml + +positiveid: + $ ogr2osm -f --positive-id $TESTDIR/shapefiles/test1.shp + running with lxml.etree + Preparing to convert .* (re) + Will try to detect projection from source metadata, or fall back to EPSG:4326 + Using default translations + Using default filterLayer + Using default filterFeature + Using default filterTags + Using default filterFeaturePost + Using default preOutputTransform + Parsing data + Detected projection metadata: + PROJCS["NAD83 / UTM zone 10N", + GEOGCS["NAD83", + DATUM["North_American_Datum_1983", + SPHEROID["GRS 1980",6378137,298.257222101, + AUTHORITY["EPSG","7019"]], + AUTHORITY["EPSG","6269"]], + PRIMEM["Greenwich",0, + AUTHORITY["EPSG","8901"]], + UNIT["degree",0.0174532925199433, + AUTHORITY["EPSG","9122"]], + AUTHORITY["EPSG","4269"]], + PROJECTION["Transverse_Mercator"], + PARAMETER["latitude_of_origin",0], + PARAMETER["central_meridian",-123], + PARAMETER["scale_factor",0.9996], + PARAMETER["false_easting",500000], + PARAMETER["false_northing",0], + UNIT["metre",1, + AUTHORITY["EPSG","9001"]], + AXIS["Easting",EAST], + AXIS["Northing",NORTH], + AUTHORITY["EPSG","26910"]] + Merging duplicate points in ways + Splitting long ways + Outputting XML + $ xmllint --format test1.osm | diff -uNr - $TESTDIR/positiveid.xml + +version: + $ ogr2osm -f --add-version $TESTDIR/shapefiles/test1.shp + running with lxml.etree + Preparing to convert .* (re) + Will try to detect projection from source metadata, or fall back to EPSG:4326 + Using default translations + Using default filterLayer + Using default filterFeature + Using default filterTags + Using default filterFeaturePost + Using default preOutputTransform + Parsing data + Detected projection metadata: + PROJCS["NAD83 / UTM zone 10N", + GEOGCS["NAD83", + DATUM["North_American_Datum_1983", + SPHEROID["GRS 1980",6378137,298.257222101, + AUTHORITY["EPSG","7019"]], + AUTHORITY["EPSG","6269"]], + PRIMEM["Greenwich",0, + AUTHORITY["EPSG","8901"]], + UNIT["degree",0.0174532925199433, + AUTHORITY["EPSG","9122"]], + AUTHORITY["EPSG","4269"]], + PROJECTION["Transverse_Mercator"], + PARAMETER["latitude_of_origin",0], + PARAMETER["central_meridian",-123], + PARAMETER["scale_factor",0.9996], + PARAMETER["false_easting",500000], + PARAMETER["false_northing",0], + UNIT["metre",1, + AUTHORITY["EPSG","9001"]], + AXIS["Easting",EAST], + AXIS["Northing",NORTH], + AUTHORITY["EPSG","26910"]] + Merging duplicate points in ways + Splitting long ways + Outputting XML + $ xmllint --format test1.osm | diff -uNr - $TESTDIR/version.xml + +timestamp: + $ ogr2osm -f --add-timestamp $TESTDIR/shapefiles/test1.shp + running with lxml.etree + Preparing to convert .* (re) + Will try to detect projection from source metadata, or fall back to EPSG:4326 + Using default translations + Using default filterLayer + Using default filterFeature + Using default filterTags + Using default filterFeaturePost + Using default preOutputTransform + Parsing data + Detected projection metadata: + PROJCS["NAD83 / UTM zone 10N", + GEOGCS["NAD83", + DATUM["North_American_Datum_1983", + SPHEROID["GRS 1980",6378137,298.257222101, + AUTHORITY["EPSG","7019"]], + AUTHORITY["EPSG","6269"]], + PRIMEM["Greenwich",0, + AUTHORITY["EPSG","8901"]], + UNIT["degree",0.0174532925199433, + AUTHORITY["EPSG","9122"]], + AUTHORITY["EPSG","4269"]], + PROJECTION["Transverse_Mercator"], + PARAMETER["latitude_of_origin",0], + PARAMETER["central_meridian",-123], + PARAMETER["scale_factor",0.9996], + PARAMETER["false_easting",500000], + PARAMETER["false_northing",0], + UNIT["metre",1, + AUTHORITY["EPSG","9001"]], + AXIS["Easting",EAST], + AXIS["Northing",NORTH], + AUTHORITY["EPSG","26910"]] + Merging duplicate points in ways + Splitting long ways + Outputting XML + +utf8: + $ ogr2osm -f $TESTDIR/shapefiles/sp_usinas.shp + running with lxml.etree + Preparing to convert .* (re) + Will try to detect projection from source metadata, or fall back to EPSG:4326 + Using default translations + Using default filterLayer + Using default filterFeature + Using default filterTags + Using default filterFeaturePost + Using default preOutputTransform + Parsing data + Detected projection metadata: + GEOGCS["SAD69", + DATUM["South_American_Datum_1969", + SPHEROID["GRS 1967 Modified",6378160,298.25, + AUTHORITY["EPSG","7050"]], + AUTHORITY["EPSG","6618"]], + PRIMEM["Greenwich",0, + AUTHORITY["EPSG","8901"]], + UNIT["degree",0.0174532925199433, + AUTHORITY["EPSG","9122"]], + AXIS["Latitude",NORTH], + AXIS["Longitude",EAST], + AUTHORITY["EPSG","4618"]] + Merging duplicate points in ways + Splitting long ways + Outputting XML + $ xmllint --format sp_usinas.osm | diff -uNr - $TESTDIR/utf8.xml + +duplicatewaynodes: + $ ogr2osm -f $TESTDIR/shapefiles/duplicate-way-nodes.gml + running with lxml.etree + Preparing to convert .* (re) + Will try to detect projection from source metadata, or fall back to EPSG:4326 + Using default translations + Using default filterLayer + Using default filterFeature + Using default filterTags + Using default filterFeaturePost + Using default preOutputTransform + Parsing data + No projection metadata, falling back to EPSG:4326 + Detected projection metadata: + PROJCS["Amersfoort / RD New", + GEOGCS["Amersfoort", + DATUM["Amersfoort", + SPHEROID["Bessel 1841",6377397.155,299.1528128, + AUTHORITY["EPSG","7004"]], + AUTHORITY["EPSG","6289"]], + PRIMEM["Greenwich",0, + AUTHORITY["EPSG","8901"]], + UNIT["degree",0.0174532925199433, + AUTHORITY["EPSG","9122"]], + AUTHORITY["EPSG","4289"]], + PROJECTION["Oblique_Stereographic"], + PARAMETER["latitude_of_origin",52.1561605555556], + PARAMETER["central_meridian",5.38763888888889], + PARAMETER["scale_factor",0.9999079], + PARAMETER["false_easting",155000], + PARAMETER["false_northing",463000], + UNIT["metre",1, + AUTHORITY["EPSG","9001"]], + AXIS["Easting",EAST], + AXIS["Northing",NORTH], + AUTHORITY["EPSG","28992"]] + unhandled geometry, type: 10 + Detected projection metadata: + PROJCS["Amersfoort / RD New", + GEOGCS["Amersfoort", + DATUM["Amersfoort", + SPHEROID["Bessel 1841",6377397.155,299.1528128, + AUTHORITY["EPSG","7004"]], + AUTHORITY["EPSG","6289"]], + PRIMEM["Greenwich",0, + AUTHORITY["EPSG","8901"]], + UNIT["degree",0.0174532925199433, + AUTHORITY["EPSG","9122"]], + AUTHORITY["EPSG","4289"]], + PROJECTION["Oblique_Stereographic"], + PARAMETER["latitude_of_origin",52.1561605555556], + PARAMETER["central_meridian",5.38763888888889], + PARAMETER["scale_factor",0.9999079], + PARAMETER["false_easting",155000], + PARAMETER["false_northing",463000], + UNIT["metre",1, + AUTHORITY["EPSG","9001"]], + AXIS["Easting",EAST], + AXIS["Northing",NORTH], + AUTHORITY["EPSG","28992"]] + Merging duplicate points in ways + Splitting long ways + Outputting XML + $ xmllint --format duplicate-way-nodes.osm | diff -uNr - $TESTDIR/duplicate-way-nodes.xml + +require_output_file_when_using_db_source: + + $ ogr2osm "PG:dbname=test" + running with lxml.etree + Usage: ogr2osm.py SRCFILE + + SRCFILE can be a file path or a org PostgreSQL connection string such as: + "PG:dbname=pdx_bldgs user=emma host=localhost" (including the quotes) + + ogr2osm.py: error: ERROR: An output file must be explicitly specified when using a database source + [2] + +require_db_source_for_sql_query: + + $ ogr2osm $TESTDIR/shapefiles/test1.shp --sql="SELECT * FROM wombats" + running with lxml.etree + Usage: ogr2osm.py SRCFILE + + SRCFILE can be a file path or a org PostgreSQL connection string such as: + "PG:dbname=pdx_bldgs user=emma host=localhost" (including the quotes) + + ogr2osm.py: error: ERROR: You must use a database source when specifying a query with --sql + [2] diff --git a/testfiles/basic_py2.t b/testfiles/basic_py2.t new file mode 100644 index 0000000..d089570 --- /dev/null +++ b/testfiles/basic_py2.t @@ -0,0 +1,401 @@ + $ [ "$0" != "/bin/bash" ] || shopt -s expand_aliases + $ [ -n "$PYTHON" ] || PYTHON="`which python`" + $ alias ogr2osm="$PYTHON $TESTDIR/../ogr2osm.py" + +usage: + + $ ogr2osm -h + running with lxml.etree + Usage: ogr2osm.py SRCFILE + + SRCFILE can be a file path or a org PostgreSQL connection string such as: + "PG:dbname=pdx_bldgs user=emma host=localhost" (including the quotes) + + Options: + -h, --help show this help message and exit + -t TRANSLATION, --translation=TRANSLATION + Select the attribute-tags translation method. See the + translations/ directory for valid values. + -o OUTPUT, --output=OUTPUT + Set destination .osm file name and location. + -e EPSG_CODE, --epsg=EPSG_CODE + EPSG code of source file. Do not include the 'EPSG:' + prefix. If specified, overrides projection from source + metadata if it exists. + -p PROJ4_STRING, --proj4=PROJ4_STRING + PROJ.4 string. If specified, overrides projection from + source metadata if it exists. + -v, --verbose + -d, --debug-tags Output the tags for every feature parsed. + -f, --force Force overwrite of output file. + --encoding=ENCODING Encoding of the source file. If specified, overrides + the default of utf-8 + --significant-digits=SIGNIFICANTDIGITS + Number of decimal places for coordinates + --rounding-digits=ROUNDINGDIGITS + Number of decimal places for rounding + --no-memory-copy Do not make an in-memory working copy + --no-upload-false Omit upload=false from the completed file to surpress + JOSM warnings when uploading. + --never-download Prevent JOSM from downloading more data to this file. + --never-upload Completely disables all upload commands for this file + in JOSM, rather than merely showing a warning before + uploading. + --locked Prevent any changes to this file in JOSM, such as + editing or downloading, and also prevents uploads. + Implies upload="never" and download="never". + --id=ID ID to start counting from for the output file. + Defaults to 0. + --idfile=IDFILE Read ID to start counting from from a file. + --split-ways=MAXNODESPERWAY + Split ways with more than the specified number of + nodes. Defaults to 1800. Any value below 2 - do not + split. + --saveid=SAVEID Save last ID after execution to a file. + --sql=SQLQUERY SQL query to execute on a PostgreSQL source + +test1: + $ rm -f test1.osm + $ ogr2osm $TESTDIR/shapefiles/test1.shp + running with lxml.etree + Preparing to convert .* (re) + Will try to detect projection from source metadata, or fall back to EPSG:4326 + Using default translations + Using default filterLayer + Using default filterFeature + Using default filterTags + Using default filterFeaturePost + Using default preOutputTransform + Parsing data + Detected projection metadata: + PROJCS["NAD_1983_UTM_Zone_10N", + GEOGCS["GCS_NAD83 [CSRS] 4.0.0.BC.1.GVRD_2005-04-05", + DATUM["North_American_Datum_1983", + SPHEROID["GRS_1980",6378137.0,298.257222101]], + PRIMEM["Greenwich",0.0], + UNIT["Degree",0.017453292519943295], + AUTHORITY["EPSG","4269"]], + PROJECTION["Transverse_Mercator"], + PARAMETER["False_Easting",500000.0], + PARAMETER["False_Northing",0.0], + PARAMETER["Central_Meridian",-123.0], + PARAMETER["Scale_Factor",0.9996], + PARAMETER["Latitude_Of_Origin",0.0], + UNIT["Meter",1.0], + AUTHORITY["EPSG","26910"]] + Merging duplicate points in ways + Splitting long ways + Outputting XML + $ xmllint --format test1.osm | diff -uNr - $TESTDIR/test1_py2.xml + +duplicatefile: + $ ogr2osm $TESTDIR/shapefiles/test1.shp + running with lxml.etree + Usage: ogr2osm.py SRCFILE + + SRCFILE can be a file path or a org PostgreSQL connection string such as: + "PG:dbname=pdx_bldgs user=emma host=localhost" (including the quotes) + + ogr2osm.py: error: ERROR: output file .*test1.osm' exists (re) + [2] + + +force: + $ ogr2osm -f $TESTDIR/shapefiles/test1.shp + running with lxml.etree + Preparing to convert .* (re) + Will try to detect projection from source metadata, or fall back to EPSG:4326 + Using default translations + Using default filterLayer + Using default filterFeature + Using default filterTags + Using default filterFeaturePost + Using default preOutputTransform + Parsing data + Detected projection metadata: + PROJCS["NAD_1983_UTM_Zone_10N", + GEOGCS["GCS_NAD83 [CSRS] 4.0.0.BC.1.GVRD_2005-04-05", + DATUM["North_American_Datum_1983", + SPHEROID["GRS_1980",6378137.0,298.257222101]], + PRIMEM["Greenwich",0.0], + UNIT["Degree",0.017453292519943295], + AUTHORITY["EPSG","4269"]], + PROJECTION["Transverse_Mercator"], + PARAMETER["False_Easting",500000.0], + PARAMETER["False_Northing",0.0], + PARAMETER["Central_Meridian",-123.0], + PARAMETER["Scale_Factor",0.9996], + PARAMETER["Latitude_Of_Origin",0.0], + UNIT["Meter",1.0], + AUTHORITY["EPSG","26910"]] + Merging duplicate points in ways + Splitting long ways + Outputting XML + $ xmllint --format test1.osm | diff -uNr - $TESTDIR/test1_py2.xml + +nomemorycopy: + $ ogr2osm -f --no-memory-copy $TESTDIR/shapefiles/test1.shp + running with lxml.etree + Preparing to convert .* (re) + Will try to detect projection from source metadata, or fall back to EPSG:4326 + Using default translations + Using default filterLayer + Using default filterFeature + Using default filterTags + Using default filterFeaturePost + Using default preOutputTransform + Parsing data + Detected projection metadata: + PROJCS["NAD_1983_UTM_Zone_10N", + GEOGCS["GCS_NAD83 [CSRS] 4.0.0.BC.1.GVRD_2005-04-05", + DATUM["North_American_Datum_1983", + SPHEROID["GRS_1980",6378137.0,298.257222101]], + PRIMEM["Greenwich",0.0], + UNIT["Degree",0.017453292519943295], + AUTHORITY["EPSG","4269"]], + PROJECTION["Transverse_Mercator"], + PARAMETER["False_Easting",500000.0], + PARAMETER["False_Northing",0.0], + PARAMETER["Central_Meridian",-123.0], + PARAMETER["Scale_Factor",0.9996], + PARAMETER["Latitude_Of_Origin",0.0], + UNIT["Meter",1.0], + AUTHORITY["EPSG","26910"]] + Merging duplicate points in ways + Splitting long ways + Outputting XML + $ xmllint --format test1.osm | diff -uNr - $TESTDIR/test1_py2.xml + +positiveid: + $ ogr2osm -f --positive-id $TESTDIR/shapefiles/test1.shp + running with lxml.etree + Preparing to convert .* (re) + Will try to detect projection from source metadata, or fall back to EPSG:4326 + Using default translations + Using default filterLayer + Using default filterFeature + Using default filterTags + Using default filterFeaturePost + Using default preOutputTransform + Parsing data + Detected projection metadata: + PROJCS["NAD_1983_UTM_Zone_10N", + GEOGCS["GCS_NAD83 [CSRS] 4.0.0.BC.1.GVRD_2005-04-05", + DATUM["North_American_Datum_1983", + SPHEROID["GRS_1980",6378137.0,298.257222101]], + PRIMEM["Greenwich",0.0], + UNIT["Degree",0.017453292519943295], + AUTHORITY["EPSG","4269"]], + PROJECTION["Transverse_Mercator"], + PARAMETER["False_Easting",500000.0], + PARAMETER["False_Northing",0.0], + PARAMETER["Central_Meridian",-123.0], + PARAMETER["Scale_Factor",0.9996], + PARAMETER["Latitude_Of_Origin",0.0], + UNIT["Meter",1.0], + AUTHORITY["EPSG","26910"]] + Merging duplicate points in ways + Splitting long ways + Outputting XML + $ xmllint --format test1.osm | diff -uNr - $TESTDIR/positiveid_py2.xml + +version: + $ ogr2osm -f --add-version $TESTDIR/shapefiles/test1.shp + running with lxml.etree + Preparing to convert .* (re) + Will try to detect projection from source metadata, or fall back to EPSG:4326 + Using default translations + Using default filterLayer + Using default filterFeature + Using default filterTags + Using default filterFeaturePost + Using default preOutputTransform + Parsing data + Detected projection metadata: + PROJCS["NAD_1983_UTM_Zone_10N", + GEOGCS["GCS_NAD83 [CSRS] 4.0.0.BC.1.GVRD_2005-04-05", + DATUM["North_American_Datum_1983", + SPHEROID["GRS_1980",6378137.0,298.257222101]], + PRIMEM["Greenwich",0.0], + UNIT["Degree",0.017453292519943295], + AUTHORITY["EPSG","4269"]], + PROJECTION["Transverse_Mercator"], + PARAMETER["False_Easting",500000.0], + PARAMETER["False_Northing",0.0], + PARAMETER["Central_Meridian",-123.0], + PARAMETER["Scale_Factor",0.9996], + PARAMETER["Latitude_Of_Origin",0.0], + UNIT["Meter",1.0], + AUTHORITY["EPSG","26910"]] + Merging duplicate points in ways + Splitting long ways + Outputting XML + $ xmllint --format test1.osm | diff -uNr - $TESTDIR/version_py2.xml + +timestamp: + $ ogr2osm -f --add-timestamp $TESTDIR/shapefiles/test1.shp + running with lxml.etree + Preparing to convert .* (re) + Will try to detect projection from source metadata, or fall back to EPSG:4326 + Using default translations + Using default filterLayer + Using default filterFeature + Using default filterTags + Using default filterFeaturePost + Using default preOutputTransform + Parsing data + Detected projection metadata: + PROJCS["NAD_1983_UTM_Zone_10N", + GEOGCS["GCS_NAD83 [CSRS] 4.0.0.BC.1.GVRD_2005-04-05", + DATUM["North_American_Datum_1983", + SPHEROID["GRS_1980",6378137.0,298.257222101]], + PRIMEM["Greenwich",0.0], + UNIT["Degree",0.017453292519943295], + AUTHORITY["EPSG","4269"]], + PROJECTION["Transverse_Mercator"], + PARAMETER["False_Easting",500000.0], + PARAMETER["False_Northing",0.0], + PARAMETER["Central_Meridian",-123.0], + PARAMETER["Scale_Factor",0.9996], + PARAMETER["Latitude_Of_Origin",0.0], + UNIT["Meter",1.0], + AUTHORITY["EPSG","26910"]] + Merging duplicate points in ways + Splitting long ways + Outputting XML + +utf8: + $ ogr2osm -f $TESTDIR/shapefiles/sp_usinas.shp + running with lxml.etree + Preparing to convert .* (re) + Will try to detect projection from source metadata, or fall back to EPSG:4326 + Using default translations + Using default filterLayer + Using default filterFeature + Using default filterTags + Using default filterFeaturePost + Using default preOutputTransform + Parsing data + Detected projection metadata: + GEOGCS["GCS_South_American_1969", + DATUM["South_American_Datum_1969", + SPHEROID["GRS_1967_Modified",6378160.0,298.25]], + PRIMEM["Greenwich",0.0], + UNIT["Degree",0.0174532925199433]] + Merging duplicate points in ways + Splitting long ways + Outputting XML + $ xmllint --format sp_usinas.osm | diff -uNr - $TESTDIR/utf8_py2.xml + +japanese: + $ ogr2osm --encoding shift_jis -f $TESTDIR/shapefiles/japanese.shp + running with lxml.etree + Preparing to convert .* (re) + Will try to detect projection from source metadata, or fall back to EPSG:4326 + Using default translations + Using default filterLayer + Using default filterFeature + Using default filterTags + Using default filterFeaturePost + Using default preOutputTransform + Parsing data + No projection metadata, falling back to EPSG:4326 + Merging duplicate points in ways + Splitting long ways + Outputting XML + $ xmllint --format japanese.osm | diff -uNr - $TESTDIR/japanese_py2.xml + +duplicatewaynodes: + $ ogr2osm -f $TESTDIR/shapefiles/duplicate-way-nodes.gml + running with lxml.etree + Preparing to convert .* (re) + Will try to detect projection from source metadata, or fall back to EPSG:4326 + Using default translations + Using default filterLayer + Using default filterFeature + Using default filterTags + Using default filterFeaturePost + Using default preOutputTransform + Parsing data + No projection metadata, falling back to EPSG:4326 + Detected projection metadata: + PROJCS["Amersfoort / RD New", + GEOGCS["Amersfoort", + DATUM["Amersfoort", + SPHEROID["Bessel 1841",6377397.155,299.1528128, + AUTHORITY["EPSG","7004"]], + TOWGS84[565.2369,50.0087,465.658,-0.406857,0.350733,-1.87035,4.0812], + AUTHORITY["EPSG","6289"]], + PRIMEM["Greenwich",0, + AUTHORITY["EPSG","8901"]], + UNIT["degree",0.0174532925199433, + AUTHORITY["EPSG","9122"]], + AXIS["Latitude",NORTH], + AXIS["Longitude",EAST], + AUTHORITY["EPSG","4289"]], + PROJECTION["Oblique_Stereographic"], + PARAMETER["latitude_of_origin",52.15616055555555], + PARAMETER["central_meridian",5.38763888888889], + PARAMETER["scale_factor",0.9999079], + PARAMETER["false_easting",155000], + PARAMETER["false_northing",463000], + UNIT["metre",1, + AUTHORITY["EPSG","9001"]], + AXIS["X",EAST], + AXIS["Y",NORTH], + AUTHORITY["EPSG","28992"]] + unhandled geometry, type: 10 + Detected projection metadata: + PROJCS["Amersfoort / RD New", + GEOGCS["Amersfoort", + DATUM["Amersfoort", + SPHEROID["Bessel 1841",6377397.155,299.1528128, + AUTHORITY["EPSG","7004"]], + TOWGS84[565.2369,50.0087,465.658,-0.406857,0.350733,-1.87035,4.0812], + AUTHORITY["EPSG","6289"]], + PRIMEM["Greenwich",0, + AUTHORITY["EPSG","8901"]], + UNIT["degree",0.0174532925199433, + AUTHORITY["EPSG","9122"]], + AXIS["Latitude",NORTH], + AXIS["Longitude",EAST], + AUTHORITY["EPSG","4289"]], + PROJECTION["Oblique_Stereographic"], + PARAMETER["latitude_of_origin",52.15616055555555], + PARAMETER["central_meridian",5.38763888888889], + PARAMETER["scale_factor",0.9999079], + PARAMETER["false_easting",155000], + PARAMETER["false_northing",463000], + UNIT["metre",1, + AUTHORITY["EPSG","9001"]], + AXIS["X",EAST], + AXIS["Y",NORTH], + AUTHORITY["EPSG","28992"]] + Merging duplicate points in ways + Splitting long ways + Outputting XML + $ xmllint --format duplicate-way-nodes.osm | diff -uNr - $TESTDIR/duplicate-way-nodes_py2.xml + +require_output_file_when_using_db_source: + + $ ogr2osm "PG:dbname=test" + running with lxml.etree + Usage: ogr2osm.py SRCFILE + + SRCFILE can be a file path or a org PostgreSQL connection string such as: + "PG:dbname=pdx_bldgs user=emma host=localhost" (including the quotes) + + ogr2osm.py: error: ERROR: An output file must be explicitly specified when using a database source + [2] + +require_db_source_for_sql_query: + + $ ogr2osm $TESTDIR/shapefiles/test1.shp --sql="SELECT * FROM wombats" + running with lxml.etree + Usage: ogr2osm.py SRCFILE + + SRCFILE can be a file path or a org PostgreSQL connection string such as: + "PG:dbname=pdx_bldgs user=emma host=localhost" (including the quotes) + + ogr2osm.py: error: ERROR: You must use a database source when specifying a query with --sql + [2] diff --git a/testfiles/duplicate-way-nodes.xml b/testfiles/duplicate-way-nodes.xml new file mode 100644 index 0000000..b38a23b --- /dev/null +++ b/testfiles/duplicate-way-nodes.xml @@ -0,0 +1,862 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/testfiles/duplicate-way-nodes_py2.xml b/testfiles/duplicate-way-nodes_py2.xml new file mode 100644 index 0000000..ca1910f --- /dev/null +++ b/testfiles/duplicate-way-nodes_py2.xml @@ -0,0 +1,862 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/testfiles/japanese_py2.xml b/testfiles/japanese_py2.xml new file mode 100644 index 0000000..725d4ca --- /dev/null +++ b/testfiles/japanese_py2.xml @@ -0,0 +1,9941 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/testfiles/positiveid.xml b/testfiles/positiveid.xml new file mode 100644 index 0000000..5bc2ba8 --- /dev/null +++ b/testfiles/positiveid.xml @@ -0,0 +1,6417 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/testfiles/positiveid_py2.xml b/testfiles/positiveid_py2.xml new file mode 100644 index 0000000..5d5818b --- /dev/null +++ b/testfiles/positiveid_py2.xml @@ -0,0 +1,6417 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/testfiles/shapefiles/duplicate-way-nodes.gml b/testfiles/shapefiles/duplicate-way-nodes.gml new file mode 100644 index 0000000..f29fd0b --- /dev/null +++ b/testfiles/shapefiles/duplicate-way-nodes.gml @@ -0,0 +1,302 @@ + + + + + + Schinkelpolder + 2013-02-18 + Gemeente Aalsmeer + Viewpoint BV + IMRO2008 + 28992 + 2500 + GISkit PlanKaart IMRO2008 + 1.1.0 + + + + + NL.IMRO.14 + enkelbestemming + Water + water + 10 + + + r_NL.IMRO.0358.BPSchinkelpolder-ON01_2.10.html + regels + + + + + WA + + + + + 115064.141 478730.338 + + + + + + + + + + + + + + + + + 115007.52 478724.248 115005.717 478723.153 115003.547 478721.78 115001.33 478720.326 114999.08 478718.81 114996.814 478717.252 114994.547 478715.67 114992.295 478714.082 114990.071 478712.508 114987.891 478710.965 114985.768 478709.47 114983.701 478708.029 114981.688 478706.643 114979.724 478705.316 114977.805 478704.048 114975.927 478702.842 114975.498 478702.576 114983.789 478681.398 + + + 114983.789 478681.398 114983.787 478680.3 114983.038 478679.497 + + + 114983.038 478679.497 114971.878 478674.172 + + + 114971.878 478674.172 114971.35 478674.03 114970.806 478674.087 + + + 114970.806 478674.087 114963.534 478676.24 + + + 114963.534 478676.24 114962.946 478676.573 114962.563 478677.131 + + + 114962.563 478677.131 114956.633 478692.279 114955.605 478691.705 114953.284 478690.378 114950.83 478688.95 114948.258 478687.434 114945.584 478685.841 114941.672 478683.496 114925.153 478673.552 114922.152 478671.743 114919.166 478669.941 114916.209 478668.15 114913.29 478666.379 114910.42 478664.631 114907.603 478662.911 114904.841 478661.224 114902.139 478659.575 114899.502 478657.971 114897.608 478656.824 114906.299 478638.327 + + + 114906.299 478638.327 114906.369 478637.231 114905.674 478636.381 + + + 114905.674 478636.381 114900.861 478633.686 114894.99 478630.399 + + + 114894.99 478630.399 114893.842 478630.267 114892.94 478630.991 + + + 114892.94 478630.991 114883.379 478648.557 114882.891 478648.291 114880.675 478647.132 114878.455 478646.024 114876.215 478644.966 114873.944 478643.957 114871.647 478643 114869.342 478642.089 114867.044 478641.208 114864.76 478640.345 114862.501 478639.485 114860.275 478638.616 114858.505 478637.893 114859.957 478634.338 + + + 114859.957 478634.338 114860.014 478633.372 114859.469 478632.572 + + + 114859.469 478632.572 114843.363 478620.475 + + + 114843.363 478620.475 114842.9 478619.902 114842.766 478619.178 + + + 114842.766 478619.178 114843.673 478605.29 + + + 114843.673 478605.29 114843.493 478604.475 114842.906 478603.882 + + + 114842.906 478603.882 114839.086 478601.754 + + + 114839.086 478601.754 114838.624 478601.589 114838.134 478601.581 + + + 114838.134 478601.581 114815.808 478604.916 + + + 114815.808 478604.916 114815.423 478604.923 114815.048 478604.832 + + + 114815.048 478604.832 114801.977 478599.809 + + + 114801.977 478599.809 114799.07 478596.846 114799.402 478592.709 + + + 114799.402 478592.709 114814.555 478565.5 + + + 114814.555 478565.5 114817.554 478563.124 114821.355 478563.564 + + + 114821.355 478563.564 114846.466 478577.539 114912.472 478615.042 114926.727 478623.141 115014.71 478672.935 115034.949 478684.27 115031.153 478691.085 115042.314 478697.304 115063.943 478709.353 115067.699 478702.612 115106.797 478724.509 115145.02 478746.746 115211.213 478783.658 115212.458 478784.361 115252.49 478806.938 115263.366 478813.072 115273.903 478819.015 115276.928 478820.721 115318.251 478844.027 + + + 115318.251 478844.027 115319.198 478845.827 115319.249 478847.86 + + + 115319.249 478847.86 115319.081 478848.353 115318.981 478848.577 115318.714 478849.016 + + + 115318.714 478849.016 115318.052 478849.763 115317.196 478850.276 + + + 115317.196 478850.276 115314.768 478850.574 115312.696 478851.876 + + + 115312.696 478851.876 115312.47 478852.868 115313.058 478853.697 + + + 115313.058 478853.697 115316.978 478855.984 + + + 115316.978 478855.984 115317.917 478856.822 115318.137 478858.062 + + + 115318.137 478858.062 115316.158 478861.19 + + + 115316.158 478861.19 115315.039 478861.57 115313.933 478861.153 + + + 115313.933 478861.153 115311.134 478859.523 + + + 115311.134 478859.523 115308.985 478859.327 115307.745 478861.094 + + + 115307.745 478861.094 115308.119 478864.702 115310.154 478867.705 + + + 115310.154 478867.705 115311.224 478869.996 115310.834 478872.495 + + + 115310.834 478872.495 115308.202 478877.066 115305.453 478881.568 + + + 115305.453 478881.568 115302.823 478883.574 115299.563 478884.137 + + + 115299.563 478884.137 115298.237 478884.026 115297.037 478883.455 + + + 115297.037 478883.455 115294.514 478881.773 115293.229 478880.859 115291.853 478879.841 115290.398 478878.746 115288.873 478877.601 115287.284 478876.43 115285.638 478875.259 115283.952 478874.12 115282.244 478873.028 115280.524 478871.988 115278.796 478871.003 115277.065 478870.077 115275.338 478869.212 115273.618 478868.412 115271.913 478867.681 115270.242 478867.026 115268.621 478866.441 115267.059 478865.914 115265.56 478865.43 115264.128 478864.978 115262.767 478864.544 115261.663 478864.178 115262.683 478862.426 115272.915 478847.896 + + + 115272.915 478847.896 115273.16 478846.74 115272.493 478845.766 + + + 115272.493 478845.766 115266.955 478842.253 + + + 115266.955 478842.253 115265.889 478842.042 115264.961 478842.606 + + + 115264.961 478842.606 115257.995 478851.687 + + + 115257.995 478851.687 115257.193 478852.223 115256.231 478852.16 + + + 115256.231 478852.16 115249.491 478849.37 + + + 115249.491 478849.37 115248.435 478849.336 115247.618 478850.007 + + + 115247.618 478850.007 115246.065 478852.703 115245.194 478854.376 115243.726 478853.323 115242.202 478852.281 115240.598 478851.253 115238.925 478850.26 115237.198 478849.309 115235.421 478848.395 115233.592 478847.513 115231.712 478846.655 115229.779 478845.816 115227.793 478844.989 115225.752 478844.169 115223.662 478843.352 115221.53 478842.53 115219.363 478841.696 115217.168 478840.842 115214.949 478839.959 115212.713 478839.04 115210.467 478838.078 115208.214 478837.065 115205.953 478835.992 115203.675 478834.854 115202.435 478834.206 115203.318 478832.611 115211.329 478826.814 + + + 115211.329 478826.814 115211.86 478826.107 115211.902 478825.224 + + + 115211.902 478825.224 115210.414 478819.453 + + + 115210.414 478819.453 115210.126 478818.883 115209.627 478818.484 + + + 115209.627 478818.484 115195.077 478811.272 115191.24 478809.371 + + + 115191.24 478809.371 115190.186 478809.265 115189.326 478809.883 + + + 115189.326 478809.883 115181.533 478821.577 115179.727 478820.398 115177.176 478818.74 115174.592 478817.079 115171.972 478815.424 115169.316 478813.788 115166.633 478812.183 115163.936 478810.616 115161.235 478809.086 115158.539 478807.592 115155.857 478806.133 115153.196 478804.709 115150.566 478803.319 115147.974 478801.962 115145.427 478800.636 115142.924 478799.338 115140.462 478798.065 115138.042 478796.815 115135.662 478795.583 115133.32 478794.368 115131.016 478793.165 115128.749 478791.973 115126.52 478790.789 115124.325 478789.607 115122.16 478788.417 115120.02 478787.213 115117.899 478785.986 115115.793 478784.727 115113.695 478783.429 115111.597 478782.08 115109.481 478780.668 115107.329 478779.192 115105.902 478778.198 115113.335 478763.515 + + + 115113.335 478763.515 115113.468 478762.542 115112.971 478761.696 + + + 115112.971 478761.696 115093.906 478745.432 + + + 115093.906 478745.432 115093.533 478745.199 115093.108 478745.084 + + + 115093.108 478745.084 115076.992 478743.186 + + + 115076.992 478743.186 115076.14 478743.337 115075.513 478743.933 + + + 115075.513 478743.933 115068.682 478755.921 115065.782 478754.42 115062.432 478752.694 115059.066 478750.969 115055.71 478749.254 115052.392 478747.562 115049.137 478745.904 115045.972 478744.292 115042.923 478742.738 115040.009 478741.249 115037.224 478739.823 115034.556 478738.456 115031.994 478737.142 115029.527 478735.877 115027.143 478734.655 115024.831 478733.473 115022.58 478732.326 115020.385 478731.21 115018.241 478730.115 115016.136 478729.028 115014.057 478727.932 115011.99 478726.812 115009.921 478725.654 115007.836 478724.44 115007.52 478724.248 + + + + + + + + + + + + + + + + NL.IMRO.0358.BPSchinkelpolder-ON01 + bestemmingsplan + gemeentelijke overheid + Gemeente Aalsmeer + 0358 + Schinkelpolder + Schinkelpolder + + + ontwerp + 2013-02-11 + + + + + rb_NL.IMRO.0358.BPSchinkelpolder-ON01_index.html + bijlage bij regels + + + + + r_NL.IMRO.0358.BPSchinkelpolder-ON01_index.html + regels + + + + + t_NL.IMRO.0358.BPSchinkelpolder-ON01_index.pdf + toelichting + + + o_NL.IMRO.0823.BPBGfase12010-VG02.dxf + IMRO2008 + PRBP2008 + + + + + + + 115582.685 479885.268 115582.714 479878.301 115581.476 479877.892 115492.865 479831.756 115399.638 479781.248 115350.098 479752.498 115282.584 479715.242 115256.179 479700.444 115236.621 479689.88 115231.863 479687.708 115228.07 479685.694 115224.92 479683.524 115221.902 479681.735 115220.621 479681.059 115219.629 479680.533 115216.668 479678.96 115212.66 479676.749 115207.496 479674.483 115205.915 479673.529 115204.25 479671.972 115202.715 479670.44 115201.424 479669.294 115199.875 479668.454 115175.007 479652.008 115124.867 479616.629 115100.582 479599.333 115074.598 479580.677 115051.19 479564.485 115024.615 479545.524 114996.387 479525.853 114972.858 479509.146 114971.237 479505.807 114961.821 479498.833 114956.901 479497.081 114913.602 479466.695 114903.684 479458.667 114901.602 479456.705 114898.342 479454.768 114895.856 479453.143 114871.839 479436.467 114860.173 479426.918 114844.955 479412.866 114828.986 479397.831 114821.82 479390.35 114807.194 479375.53 114787.234 479353.618 114741.496 479303.109 114727.847 479288.227 114720.404 479279.265 114709.661 479265.692 114678.256 479233.174 114671.946 479226.439 114667.74 479221.646 114664.187 479217.47 114660.821 479213.394 114657.569 479209.248 114654.061 479204.583 114650.727 479199.627 114647.591 479194.689 114644.979 479189.662 114642.589 479184.779 114640.304 479179.068 114637.861 479171.165 114633.913 479156.706 114621.181 479095.401 114609.076 479033.954 114601.225 479000 114597.257 478982.836 114582.723 478920.769 114579.86 478909.252 114578.647 478902.772 114577.692 478898.624 114576.912 478894.262 114576.443 478890.546 114576.281 478886.136 114576.702 478881.702 114577.12 478877.942 114577.466 478876.624 114578.128 478874.095 114579.639 478869.385 114581.3 478865.395 114583.758 478860.721 114603.875 478822.458 114603.994 478822.101 114604.636 478820.572 114604.973 478820.71 114607.509 478815.991 114607.073 478815.79 114607.784 478814.246 114608.189 478814.433 114620.155 478792.688 114643.944 478748.656 114667.176 478706.561 114691.336 478662.036 114731.705 478589.32 114741.225 478572.653 114742.931 478569.421 114743.678 478567.207 114744.111 478564.044 114743.756 478561.852 114742.901 478559.518 114742.508 478558.685 114741.48 478556.504 114741.059 478556.704 114740.638 478556.146 114738.736 478553.359 114736.22 478550.48 114732.998 478547.11 114730.876 478544.733 114728.481 478541.691 114725.545 478539.057 114725.26 478538.801 114722.051 478536.701 114694.53 478521.601 114641.712 478493.953 114602.152 478473.313 114595.17 478469.67 114594.728 478470.45 114586.292 478465.785 114582.863 478463.976 114580.554 478462.729 114573.898 478459.191 114569.428 478456.276 114565.899 478453.52 114562.94 478450.399 114560.908 478446.975 114559.571 478443.039 114559.207 478439.2 114559.961 478433.901 114561.774 478429.335 114564.063 478425.408 114566.849 478421.188 114569.876 478417.609 114573.293 478414.568 114576.201 478411.987 114578.983 478408.99 114580.919 478406.243 114587.859 478393.493 114591.366 478382.848 114594.873 478372.202 114598.651 478359.903 114604.422 478349.316 114620.5 478320.795 114633.786 478297.402 114646.029 478276.23 114652.373 478264.099 114655.758 478257.126 114658.103 478252.097 114660.053 478247.553 114663.398 478239.815 114665.821 478234.391 114667.271 478229.48 114668.078 478227.002 114669.141 478224.502 114669.769 478223.321 114670.396 478222.139 114671.691 478220.05 114673.009 478218.181 114674.373 478216.477 114674.996 478215.886 114676.757 478214.376 114679.358 478212.94 114683.084 478211.185 114692.821 478207.383 114696.167 478205.934 114698.234 478204.976 114700.271 478203.909 114701.934 478202.694 114702.698 478202.01 114703.461 478201.326 114705.747 478198.693 114711.191 478191.442 114712.204 478189.52 114713.217 478187.597 114713.638 478186.532 114713.821 478185.852 114713.782 478185.233 114713.519 478184.747 114712.937 478184.098 114736.322 478142.367 114739.706 478136.33 114747.162 478123.024 114784.267 478053.625 114809.772 478007.352 114818.943 477991.424 114829.09 477973.217 114846.149 477942.505 114864.564 477908.891 114880.734 477878.82 114916.488 477813.693 114928.842 477791.651 114942.488 477767.505 114956.93 477741.519 114958.782 477737.457 114959.852 477733.478 114961.907 477729.028 114966.549 477718.311 114979.103 477693.092 114980.403 477690.083 114984.309 477681.047 114993.375 477661.714 114998.938 477664.737 114999.902 477664.695 115000 477664.691 115008.438 477664.328 115015.711 477664.946 115016.614 477663.269 115023.789 477667.211 115030.851 477653.959 115034.199 477647.534 115047.011 477623.374 115047.857 477621.78 115078.831 477648.303 115091.594 477655.002 115092.204 477655.093 115097.486 477657.867 115101.453 477659.997 115104.96 477661.88 115107.914 477663.146 115110.841 477664.574 115113.69 477666.106 115116.835 477667.398 115117.812 477667.799 115120.046 477668.718 115123.053 477670.314 115124.293 477670.973 115124.723 477671.201 115126.854 477672.332 115130.974 477674.785 115136.139 477678.047 115137.486 477675.672 115140.759 477677.718 115142.343 477678.576 115156.257 477686.241 115154.918 477688.338 115156.152 477689.027 115157.455 477689.754 115157.479 477689.768 115164.931 477694.268 115171.46 477698.086 115171.483 477698.099 115185.891 477706.192 115199.34 477713.747 115204.811 477716.82 115218.246 477724.105 115227.39 477729.063 115249.61 477741.112 115251.457 477742.125 115252.571 477743.017 115253.58 477743.826 115264.426 477748.652 115272.021 477751.145 115293.661 477758.248 115307.875 477763.236 115309.552 477763.83 115320.816 477767.821 115334.42 477772.641 115354.415 477779.727 115378.05 477788.101 115384.348 477792.166 115409.34 477808.517 115412.321 477810.863 115421.124 477815.06 115425.525 477818.701 115432.553 477822.553 115432.722 477822.646 115434.698 477823.729 115435.528 477824.169 115440.038 477826.564 115462.859 477840.209 115463.522 477840.617 115476.137 477848.835 115485.519 477854.947 115496.673 477862.214 115502.144 477865.283 115511.948 477870.783 115521.945 477876.614 115527.522 477881.112 115530.711 477882.515 115532.548 477883.323 115532.614 477883.367 115547.452 477893.291 115554.71 477897.269 115580.028 477912.75 115581.588 477914.744 115613.077 477933.252 115614.587 477934.14 115656.752 477955.242 115674.56 477965.539 115691.206 477975.164 115697.537 477978.825 115698.135 477979.249 115699.067 477979.71 115697.81 477981.94 115714.85 477991.302 115729.492 477999.347 115730.499 478000 115738.925 478005.466 115742.739 478007.562 115744.466 478008.511 115750.007 478011.294 115754.679 478013.692 115760.504 478017.092 115765.92 478020.252 115772.315 478023.983 115773.126 478024.457 115776.302 478027.71 115777.76 478028.486 115801.944 478041.359 115817.981 478050.004 115820.955 478051.608 115821.788 478052.027 115834.29 478058.278 115836.412 478059.378 115836.68 478059.517 115846.264 478065.094 115848.563 478066.323 115861.539 478073.26 115861.973 478072.515 115878.989 478081.606 115881.182 478082.778 115882.389 478083.464 115889.904 478087.732 115889.974 478087.766 115901.418 478093.295 115910.783 478097.82 115926.324 478105.329 115946.345 478115.002 115958.415 478121.253 115961.207 478122.699 115962.289 478120.883 115970.47 478125.141 115974.521 478130.689 115977.461 478135.209 116000 478169.862 116002.723 478174.048 116012.257 478187.732 116013.024 478189.813 116012.345 478192.517 116009.981 478197.258 116067.379 478227.65 116158.892 478281.042 116165.656 478280.231 116167.648 478280.668 116173.365 478281.341 116175.675 478281.779 116187.692 478282.809 116193.495 478283.327 116196.086 478283.572 116199.127 478283.632 116207.731 478283.539 116213.508 478283.476 116218.502 478284.096 116221.854 478287.53 116227.155 478292.962 116229.885 478298.37 116231.112 478300.06 116236.341 478307.141 116237.646 478309.066 116239.123 478312.645 116243.736 478318.69 116240.295 478325.124 116246.339 478328.327 116249.057 478329.602 116254.841 478332.258 116258.317 478334.738 116330.188 478373.362 116341.042 478379.195 116427.692 478370.21 116462.183 478386.304 116459.674 478393.525 116456.401 478418.134 116456.164 478421.449 116454.791 478427.238 116453.606 478430.037 116451.677 478433.737 116449.064 478438.223 116445.449 478443.998 116449.286 478446.237 116437.995 478456.623 116434.446 478458.724 116427.81 478458.303 116422.126 478467.808 116410.588 478482.281 116400.35 478493.982 116396.328 478500 116372.616 478535.482 116369.516 478533.905 116307.661 478635.954 116191.004 478841.288 116120.769 478965.256 116101.107 479000 116034.864 479117.054 116000 479178.296 115985.814 479203.215 115888.719 479374.309 115817.548 479499.863 115817.47 479500 115785.41 479556.461 115733.36 479647.444 115730.198 479655.185 115724.671 479671.969 115719.847 479694.998 115715.634 479715.79 115711.794 479735.777 115706.133 479777.864 115704.768 479781.677 115696.974 479799.78 115687.196 479820.035 115675.533 479840.84 115663.525 479859.908 115661.562 479862.636 115625.241 479913.18 115624.866 479912.775 115619.018 479907.633 115615.972 479905.182 115613.376 479903.094 115610.569 479900.43 115607.143 479898.933 115602.084 479895.476 115595.491 479891.628 115582.685 479885.268 + + + + + + + + + diff --git a/testfiles/shapefiles/japanese.dbf b/testfiles/shapefiles/japanese.dbf new file mode 100644 index 0000000..c9e1bb2 Binary files /dev/null and b/testfiles/shapefiles/japanese.dbf differ diff --git a/testfiles/shapefiles/japanese.shp b/testfiles/shapefiles/japanese.shp new file mode 100644 index 0000000..ee22c3e Binary files /dev/null and b/testfiles/shapefiles/japanese.shp differ diff --git a/testfiles/shapefiles/japanese.shx b/testfiles/shapefiles/japanese.shx new file mode 100644 index 0000000..fcc8c23 Binary files /dev/null and b/testfiles/shapefiles/japanese.shx differ diff --git a/testfiles/shapefiles/sp_usinas.dbf b/testfiles/shapefiles/sp_usinas.dbf new file mode 100644 index 0000000..999fb48 Binary files /dev/null and b/testfiles/shapefiles/sp_usinas.dbf differ diff --git a/testfiles/shapefiles/sp_usinas.prj b/testfiles/shapefiles/sp_usinas.prj new file mode 100644 index 0000000..f36876f --- /dev/null +++ b/testfiles/shapefiles/sp_usinas.prj @@ -0,0 +1 @@ +GEOGCS["GCS_South_American_1969",DATUM["D_South_American_1969",SPHEROID["GRS_1967_Truncated",6378160.0,298.25]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]] \ No newline at end of file diff --git a/testfiles/shapefiles/sp_usinas.shp b/testfiles/shapefiles/sp_usinas.shp new file mode 100644 index 0000000..b5c4653 Binary files /dev/null and b/testfiles/shapefiles/sp_usinas.shp differ diff --git a/testfiles/shapefiles/sp_usinas.shx b/testfiles/shapefiles/sp_usinas.shx new file mode 100644 index 0000000..112a1d9 Binary files /dev/null and b/testfiles/shapefiles/sp_usinas.shx differ diff --git a/testfiles/shapefiles/test1.dbf b/testfiles/shapefiles/test1.dbf new file mode 100644 index 0000000..3dd9ada Binary files /dev/null and b/testfiles/shapefiles/test1.dbf differ diff --git a/testfiles/shapefiles/test1.prj b/testfiles/shapefiles/test1.prj new file mode 100644 index 0000000..f57ed3a --- /dev/null +++ b/testfiles/shapefiles/test1.prj @@ -0,0 +1 @@ +PROJCS["NAD_1983_UTM_Zone_10N",GEOGCS["GCS_NAD83 [CSRS] 4.0.0.BC.1.GVRD_2005-04-05",DATUM["D_North_American_1983",SPHEROID["GRS_1980",6378137.0,298.257222101]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.017453292519943295]],PROJECTION["Transverse_Mercator"],PARAMETER["False_Easting",500000.0],PARAMETER["False_Northing",0.0],PARAMETER["Central_Meridian",-123.0],PARAMETER["Scale_Factor",0.9996],PARAMETER["Latitude_Of_Origin",0.0],UNIT["Meter",1.0]] \ No newline at end of file diff --git a/testfiles/shapefiles/test1.shp b/testfiles/shapefiles/test1.shp new file mode 100644 index 0000000..ae44040 Binary files /dev/null and b/testfiles/shapefiles/test1.shp differ diff --git a/testfiles/shapefiles/test1.shx b/testfiles/shapefiles/test1.shx new file mode 100644 index 0000000..126a701 Binary files /dev/null and b/testfiles/shapefiles/test1.shx differ diff --git a/testfiles/test1.xml b/testfiles/test1.xml new file mode 100644 index 0000000..57acaca --- /dev/null +++ b/testfiles/test1.xml @@ -0,0 +1,6417 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/testfiles/test1_py2.xml b/testfiles/test1_py2.xml new file mode 100644 index 0000000..c2b6b40 --- /dev/null +++ b/testfiles/test1_py2.xml @@ -0,0 +1,6417 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/testfiles/utf8.xml b/testfiles/utf8.xml new file mode 100644 index 0000000..290a315 --- /dev/null +++ b/testfiles/utf8.xml @@ -0,0 +1,1873 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/testfiles/utf8_py2.xml b/testfiles/utf8_py2.xml new file mode 100644 index 0000000..fd82537 --- /dev/null +++ b/testfiles/utf8_py2.xml @@ -0,0 +1,1873 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/testfiles/version.xml b/testfiles/version.xml new file mode 100644 index 0000000..3647534 --- /dev/null +++ b/testfiles/version.xml @@ -0,0 +1,6417 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/testfiles/version_py2.xml b/testfiles/version_py2.xml new file mode 100644 index 0000000..41a72ec --- /dev/null +++ b/testfiles/version_py2.xml @@ -0,0 +1,6417 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/translations b/translations new file mode 160000 index 0000000..a8d2d6c --- /dev/null +++ b/translations @@ -0,0 +1 @@ +Subproject commit a8d2d6c74eae1a4f5dfea8b27b702e7d73a64468 diff --git a/translations/uvmtrans.py b/translations/uvmtrans.py deleted file mode 100644 index 180ce36..0000000 --- a/translations/uvmtrans.py +++ /dev/null @@ -1,115 +0,0 @@ -from osgeo import ogr -import re -import urllib -import json - -uvmfeatures = [] - -def filterLayer(layer): - if layer is None: - return None - print layer.GetName() - return layer - -def filterFeature(ogrfeature, fieldNames, reproject): - if ogrfeature is None: - return - layer = ogrfeature.GetFieldAsString("Layer") - if (layer == "VA-BLDG-UVM" or - layer == "VA-BLDG-NON UVM"): - return ogrfeature - elif (layer == "VA-BLDG-ATTRIBUTES" and len(ogrfeature.GetFieldAsString("Text")) == 4): - # Ignore CFC Soccer Stands - has no building outline - if ogrfeature.GetFieldAsString("Text") == "0979": - return - return ogrfeature - else: - return - -def filterFeaturePost(feature, ogrfeature, ogrgeometry): - if feature is None and ogrfeature is None and ogrgeometry is None: - return - global uvmfeatures - uvmfeatures.append((feature, ogrfeature, ogrgeometry)) - -def filterTags(tags): - if tags is None: - return - newtags = {} - for (key, value) in tags.items(): - if (key == "Layer" or - (key == "Text" and value != "")): - newtags[key] = value - if (key == "Layer" and value != "VA-UVM-BLDG-CODE"): - newtags["building"] = "yes" - return newtags - - -def preOutputTransform(geometries, features): - if geometries is None and features is None: - return - global uvmfeatures - buildingcodes = [(feature, ogrfeature, ogrgeometry) for (feature, ogrfeature, ogrgeometry) in uvmfeatures if ogrfeature.GetFieldAsString("Layer") == "VA-BLDG-ATTRIBUTES"] - buildings = [x for x in uvmfeatures if x not in buildingcodes] - # Match each code to the closest building, setting the building's feature's - # name - for (codef, codeogrf, codeogrg) in buildingcodes: - dist = float("inf") - chosenfeature = (None, None, None) - for (bldgf, bldgogrf, bldgogrg) in buildings: - newdist = codeogrg.Distance(bldgogrg) - if newdist < dist: - dist = newdist - chosenfeature = (bldgf, bldgogrf, bldgogrg) - (bldgf, bldgogrf, bldgogrg) = chosenfeature - buildingid = codeogrf.GetFieldAsString("Text") - if bldgf.tags.has_key("uvm:buildingid") and bldgf.tags["uvm:buildingid"] != buildingid: - print "WARNING: buildingid overlap detected! " + bldgf.tags["uvm:buildingid"] + " " + buildingid - bldgf.tags["uvm:buildingid"] = buildingid - page = urllib.urlopen("http://www-dev.uvm.edu/~aguertin/webteam/map/famis/getbldgname.php?BLDG="+buildingid) - name = page.read() - page.close - bldgf.tags["name"] = name - - # Remove the building code nodes - for feature in [f for f in features if f.tags["Layer"] == "VA-BLDG-ATTRIBUTES"]: - print "Removing a text node: " + feature.tags["Text"] - features.remove(feature) - feature.geometry.removeparent(feature) - - # Remove buildings that were not given a buildingid - for feature in [f for f in features if "uvm:buildingid" not in f.tags]: - features.remove(feature) - try: - geometries.remove(feature.geometry) - try: - for point in set(feature.geometry.points): - try: - point.removeparent(feature.geometry) - except: - print "What went wrong here???" - except: - print "Failed -- geometry.points does not exist -- not a way" - except: - print "Failed -- two building features with same geometry??" - - uvmjson(geometries, features) - -def uvmjson(geometries, features): - print "IN UVMJSON" - buildings = [building for building in features if "uvm:buildingid" in building.tags] - outbuildings = [] - for building in buildings: - outbuilding = {} - outbuilding["id"] = building.tags["uvm:buildingid"] - outbuilding["geometry"] = [] - if str(type(building.geometry)) != "": - print "WARNING: building not way, being ignored!" - print str(type(building.geometry)) - else: - for point in building.geometry.points: - outbuilding["geometry"].append({"x": point.x, "y": point.y}) - outbuildings.append(outbuilding) - f = open('/tmp/uvmbuildings.json', 'w') - f.write(json.dumps(outbuildings, indent=4)) - f.close()