update libosmium to v2.6.0
This commit is contained in:
@@ -1 +0,0 @@
|
||||
multipolygon.qgs~
|
||||
@@ -1,118 +0,0 @@
|
||||
#-----------------------------------------------------------------------------
|
||||
#
|
||||
# CMake Config
|
||||
#
|
||||
# Libosmium data tests
|
||||
#
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
message(STATUS "Configuring data tests")
|
||||
|
||||
if(NOT GDAL_FOUND OR NOT EXPAT_FOUND)
|
||||
message(STATUS "Sorry, building data tests needs GDAL and Expat")
|
||||
message(STATUS "Configuring data tests - failed")
|
||||
return()
|
||||
endif()
|
||||
|
||||
message(STATUS "Looking for osm-testdata")
|
||||
find_path(OSM_TESTDATA grid/data/all.osm HINT ../../../osm-testdata)
|
||||
if(OSM_TESTDATA STREQUAL "OSM_TESTDATA-NOTFOUND")
|
||||
message(STATUS "Looking for osm-testdata - not found (data tests disabled)")
|
||||
message(STATUS "Configuring data tests - failed")
|
||||
return()
|
||||
endif()
|
||||
message(STATUS "Looking for osm-testdata - found")
|
||||
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
include_directories("include")
|
||||
include_directories("../include")
|
||||
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
#
|
||||
# testcases
|
||||
#
|
||||
#-----------------------------------------------------------------------------
|
||||
file(GLOB TESTCASE_CPPS testcases/*.cpp)
|
||||
add_executable(testdata-testcases testdata-testcases.cpp ${TESTCASE_CPPS})
|
||||
target_link_libraries(testdata-testcases
|
||||
${OSMIUM_XML_LIBRARIES}
|
||||
)
|
||||
add_test(NAME testdata-testcases
|
||||
COMMAND testdata-testcases
|
||||
)
|
||||
set_tests_properties(testdata-testcases PROPERTIES
|
||||
ENVIRONMENT "TESTCASES_DIR=${OSM_TESTDATA}/grid/data"
|
||||
LABELS "data;fast")
|
||||
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
#
|
||||
# xml
|
||||
#
|
||||
#-----------------------------------------------------------------------------
|
||||
add_executable(testdata-xml testdata-xml.cpp)
|
||||
target_link_libraries(testdata-xml
|
||||
${OSMIUM_XML_LIBRARIES}
|
||||
)
|
||||
add_test(NAME testdata-xml
|
||||
COMMAND testdata-xml
|
||||
)
|
||||
set_tests_properties(testdata-xml PROPERTIES
|
||||
ENVIRONMENT "TESTDIR=${OSM_TESTDATA}/xml/data"
|
||||
LABELS "data;fast")
|
||||
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
#
|
||||
# overview
|
||||
#
|
||||
#-----------------------------------------------------------------------------
|
||||
add_executable(testdata-overview testdata-overview.cpp)
|
||||
target_link_libraries(testdata-overview
|
||||
${OSMIUM_XML_LIBRARIES}
|
||||
${GDAL_LIBRARIES}
|
||||
)
|
||||
add_test(NAME testdata-overview
|
||||
COMMAND testdata-overview ${OSM_TESTDATA}/grid/data/all.osm
|
||||
)
|
||||
set_tests_properties(testdata-overview PROPERTIES
|
||||
LABELS "data;slow")
|
||||
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
#
|
||||
# multipolygon
|
||||
#
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
find_program(RUBY ruby)
|
||||
find_package(Gem COMPONENTS json)
|
||||
find_program(SPATIALITE spatialite)
|
||||
|
||||
if(RUBY AND GEM_json_FOUND AND SPATIALITE)
|
||||
add_executable(testdata-multipolygon testdata-multipolygon.cpp)
|
||||
target_link_libraries(testdata-multipolygon
|
||||
${OSMIUM_XML_LIBRARIES}
|
||||
${GDAL_LIBRARIES}
|
||||
)
|
||||
|
||||
add_test(NAME testdata-multipolygon
|
||||
COMMAND ${CMAKE_COMMAND}
|
||||
-D OSM_TESTDATA=${OSM_TESTDATA}
|
||||
-D RUBY=${RUBY}
|
||||
-P ${CMAKE_CURRENT_SOURCE_DIR}/run-testdata-multipolygon.cmake)
|
||||
|
||||
set_tests_properties(testdata-multipolygon PROPERTIES LABELS "data;slow")
|
||||
else()
|
||||
message(WARNING "Disabled testdata-multipolygon test because 'ruby' and/or 'json' ruby gem and/or 'spatialite' was not found")
|
||||
endif()
|
||||
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
message(STATUS "Configuring data tests - done")
|
||||
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
-10
@@ -1,10 +0,0 @@
|
||||
# OSM Testdata
|
||||
|
||||
This directory contains software that can be used with the osm-testdata
|
||||
repository at https://github.com/osmcode/osm-testdata . To use it, clone
|
||||
the `osm-testdata` repository in the same directory where you cloned the
|
||||
`libosmium` repository.
|
||||
|
||||
Tests will be built if the CMake option `BUILD_DATA_TESTS` is set and run as
|
||||
part of the `ctest` run.
|
||||
|
||||
@@ -1,92 +0,0 @@
|
||||
#ifndef CHECK_BASICS_HANDLER_HPP
|
||||
#define CHECK_BASICS_HANDLER_HPP
|
||||
|
||||
#include <iostream>
|
||||
#include <unordered_set>
|
||||
|
||||
#include <osmium/handler.hpp>
|
||||
#include <osmium/osm.hpp>
|
||||
|
||||
/**
|
||||
* Check some basics of the input data:
|
||||
*
|
||||
* 1. Correct number of nodes, ways, and relations
|
||||
* 2. Correct ID space used by nodes, ways, and relations
|
||||
* 3. No ID used more than once
|
||||
*/
|
||||
class CheckBasicsHandler : public osmium::handler::Handler {
|
||||
|
||||
// Lower bound for the id range allowed in this test.
|
||||
int m_id_range;
|
||||
|
||||
// In the beginning these contains the number of nodes, ways, and relations
|
||||
// supposedly in the data.osm file. They will be decremented on each object
|
||||
// and have to be 0 at the end.
|
||||
int m_num_nodes;
|
||||
int m_num_ways;
|
||||
int m_num_relations;
|
||||
|
||||
// All IDs encountered in the data.osm file will be stored in this set and
|
||||
// checked for duplicates.
|
||||
std::unordered_set<osmium::object_id_type> m_ids;
|
||||
|
||||
// Check id is in range [min, max] and that it isn't more than once in input.
|
||||
void id_check(osmium::object_id_type id, osmium::object_id_type min, osmium::object_id_type max) {
|
||||
if (id < m_id_range + min || id > m_id_range + max) {
|
||||
std::cerr << " id " << id << " out of range for this test case\n";
|
||||
exit(1);
|
||||
}
|
||||
|
||||
auto r = m_ids.insert(id);
|
||||
if (!r.second) {
|
||||
std::cerr << " id " << id << " contained twice in data.osm\n";
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
public:
|
||||
|
||||
static const int ids_per_testcase = 1000;
|
||||
|
||||
CheckBasicsHandler(int testcase, int nodes, int ways, int relations) :
|
||||
osmium::handler::Handler(),
|
||||
m_id_range(testcase * ids_per_testcase),
|
||||
m_num_nodes(nodes),
|
||||
m_num_ways(ways),
|
||||
m_num_relations(relations) {
|
||||
}
|
||||
|
||||
~CheckBasicsHandler() {
|
||||
if (m_num_nodes != 0) {
|
||||
std::cerr << " wrong number of nodes in data.osm\n";
|
||||
exit(1);
|
||||
}
|
||||
if (m_num_ways != 0) {
|
||||
std::cerr << " wrong number of ways in data.osm\n";
|
||||
exit(1);
|
||||
}
|
||||
if (m_num_relations != 0) {
|
||||
std::cerr << " wrong number of relations in data.osm\n";
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
void node(const osmium::Node& node) {
|
||||
id_check(node.id(), 0, 799);
|
||||
--m_num_nodes;
|
||||
}
|
||||
|
||||
void way(const osmium::Way& way) {
|
||||
id_check(way.id(), 800, 899);
|
||||
--m_num_ways;
|
||||
}
|
||||
|
||||
void relations(const osmium::Relation& relation) {
|
||||
id_check(relation.id(), 900, 999);
|
||||
--m_num_relations;
|
||||
}
|
||||
|
||||
}; // CheckBasicsHandler
|
||||
|
||||
|
||||
#endif // CHECK_BASICS_HANDLER_HPP
|
||||
@@ -1,86 +0,0 @@
|
||||
#ifndef CHECK_WKT_HANDLER_HPP
|
||||
#define CHECK_WKT_HANDLER_HPP
|
||||
|
||||
#include <cassert>
|
||||
#include <fstream>
|
||||
#include <map>
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
|
||||
#include <osmium/handler.hpp>
|
||||
#include <osmium/osm.hpp>
|
||||
#include <osmium/osm/types.hpp>
|
||||
|
||||
class CheckWKTHandler : public osmium::handler::Handler {
|
||||
|
||||
std::map<osmium::object_id_type, std::string> m_geometries;
|
||||
osmium::geom::WKTFactory<> m_factory;
|
||||
|
||||
void read_wkt_file(const std::string& filename) {
|
||||
std::ifstream in(filename, std::ifstream::in);
|
||||
if (in) {
|
||||
osmium::object_id_type id;
|
||||
std::string line;
|
||||
while (std::getline(in, line)) {
|
||||
size_t pos = line.find_first_of(' ');
|
||||
|
||||
if (pos == std::string::npos) {
|
||||
std::cerr << filename << " not formatted correctly\n";
|
||||
exit(1);
|
||||
}
|
||||
|
||||
std::string id_str = line.substr(0, pos);
|
||||
std::istringstream iss(id_str);
|
||||
iss >> id;
|
||||
|
||||
if (m_geometries.find(id) != m_geometries.end()) {
|
||||
std::cerr << filename + " contains id " << id << "twice\n";
|
||||
exit(1);
|
||||
}
|
||||
|
||||
m_geometries[id] = line.substr(pos+1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public:
|
||||
|
||||
CheckWKTHandler(const std::string& dirname, int test_id) :
|
||||
osmium::handler::Handler() {
|
||||
|
||||
std::string filename = dirname + "/" + std::to_string(test_id / 100) + "/" + std::to_string(test_id) + "/";
|
||||
read_wkt_file(filename + "nodes.wkt");
|
||||
read_wkt_file(filename + "ways.wkt");
|
||||
}
|
||||
|
||||
~CheckWKTHandler() {
|
||||
if (!m_geometries.empty()) {
|
||||
for (const auto& geom : m_geometries) {
|
||||
std::cerr << "geometry id " << geom.first << " not in data.osm.\n";
|
||||
}
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
void node(const osmium::Node& node) {
|
||||
const std::string wkt = m_geometries[node.id()];
|
||||
assert(wkt != "" && "Missing geometry for node in nodes.wkt");
|
||||
|
||||
std::string this_wkt = m_factory.create_point(node.location());
|
||||
assert(wkt == this_wkt && "wkt geometries don't match");
|
||||
m_geometries.erase(node.id());
|
||||
}
|
||||
|
||||
void way(const osmium::Way& way) {
|
||||
const std::string wkt = m_geometries[way.id()];
|
||||
assert(wkt != "" && "Missing geometry for way in ways.wkt");
|
||||
|
||||
std::string this_wkt = m_factory.create_linestring(way);
|
||||
assert(wkt == this_wkt && "wkt geometries don't match");
|
||||
m_geometries.erase(way.id());
|
||||
}
|
||||
|
||||
}; // CheckWKTHandler
|
||||
|
||||
|
||||
#endif // CHECK_WKT_HANDLER_HPP
|
||||
@@ -1,22 +0,0 @@
|
||||
#ifndef COMMON_HPP
|
||||
#define COMMON_HPP
|
||||
|
||||
#include <osmium/index/map/dummy.hpp>
|
||||
#include <osmium/index/map/sparse_mem_array.hpp>
|
||||
|
||||
#include <osmium/geom/wkt.hpp>
|
||||
#include <osmium/handler.hpp>
|
||||
#include <osmium/handler/node_locations_for_ways.hpp>
|
||||
#include <osmium/io/xml_input.hpp>
|
||||
#include <osmium/visitor.hpp>
|
||||
|
||||
typedef osmium::index::map::Dummy<osmium::unsigned_object_id_type, osmium::Location> index_neg_type;
|
||||
typedef osmium::index::map::SparseMemArray<osmium::unsigned_object_id_type, osmium::Location> index_pos_type;
|
||||
typedef osmium::handler::NodeLocationsForWays<index_pos_type, index_neg_type> location_handler_type;
|
||||
|
||||
#include "check_basics_handler.hpp"
|
||||
#include "check_wkt_handler.hpp"
|
||||
|
||||
#include "testdata-testcases.hpp"
|
||||
|
||||
#endif // COMMON_HPP
|
||||
@@ -1,10 +0,0 @@
|
||||
#ifndef TESTDATA_TESTCASES_HPP
|
||||
#define TESTDATA_TESTCASES_HPP
|
||||
|
||||
#include <catch.hpp>
|
||||
|
||||
#include <string>
|
||||
|
||||
extern std::string dirname;
|
||||
|
||||
#endif // TESTDATA_TESTCASES_HPP
|
||||
@@ -1,880 +0,0 @@
|
||||
<!DOCTYPE qgis PUBLIC 'http://mrcc.com/qgis.dtd' 'SYSTEM'>
|
||||
<qgis projectname="" version="2.2.0-Valmiera">
|
||||
<title></title>
|
||||
<relations/>
|
||||
<mapcanvas>
|
||||
<units>degrees</units>
|
||||
<extent>
|
||||
<xmin>0.77500024999999972</xmin>
|
||||
<ymin>-0.84791712574962541</ymin>
|
||||
<xmax>10.22498975000000065</xmax>
|
||||
<ymax>3.94791712574962572</ymax>
|
||||
</extent>
|
||||
<projections>0</projections>
|
||||
<destinationsrs>
|
||||
<spatialrefsys>
|
||||
<proj4>+proj=longlat +datum=WGS84 +no_defs</proj4>
|
||||
<srsid>3452</srsid>
|
||||
<srid>4326</srid>
|
||||
<authid>EPSG:4326</authid>
|
||||
<description>WGS 84</description>
|
||||
<projectionacronym>longlat</projectionacronym>
|
||||
<ellipsoidacronym>WGS84</ellipsoidacronym>
|
||||
<geographicflag>true</geographicflag>
|
||||
</spatialrefsys>
|
||||
</destinationsrs>
|
||||
<layer_coordinate_transform_info/>
|
||||
</mapcanvas>
|
||||
<legend updateDrawingOrder="true">
|
||||
<legendlayer drawingOrder="-1" open="true" checked="Qt::Checked" name="Error Points" showFeatureCount="0">
|
||||
<filegroup open="true" hidden="false">
|
||||
<legendlayerfile isInOverview="0" layerid="perrors20140228163658956" visible="1"/>
|
||||
</filegroup>
|
||||
</legendlayer>
|
||||
<legendlayer drawingOrder="-1" open="true" checked="Qt::Checked" name="Error Lines" showFeatureCount="0">
|
||||
<filegroup open="true" hidden="false">
|
||||
<legendlayerfile isInOverview="0" layerid="lerrors20140228172357933" visible="1"/>
|
||||
</filegroup>
|
||||
</legendlayer>
|
||||
<legendlayer drawingOrder="-1" open="true" checked="Qt::Checked" name="multipolygons" showFeatureCount="0">
|
||||
<filegroup open="true" hidden="false">
|
||||
<legendlayerfile isInOverview="0" layerid="multipolygons20140221151811742" visible="1"/>
|
||||
</filegroup>
|
||||
</legendlayer>
|
||||
<legendgroup embedded="1" drawingOrder="-1" open="true" checked="Qt::Checked" name="Overview" project="../../../osm-testdata/grid/tests.qgs"/>
|
||||
<legendgroup embedded="1" drawingOrder="-1" open="true" checked="Qt::Checked" name="Test Framework" project="../../../osm-testdata/grid/tests.qgs"/>
|
||||
</legend>
|
||||
<projectlayers layercount="9">
|
||||
<maplayer minimumScale="-4.65661e-10" maximumScale="1e+08" simplifyDrawingHints="1" minLabelScale="0" maxLabelScale="1e+08" simplifyDrawingTol="1" geometry="Line" simplifyMaxScale="1" type="vector" hasScaleBasedVisibilityFlag="0" simplifyLocal="1" scaleBasedLabelVisibilityFlag="0">
|
||||
<id>lerrors20140228172357933</id>
|
||||
<datasource>dbname='./multipolygon.db' table="lerrors" (GEOMETRY) sql=</datasource>
|
||||
<title></title>
|
||||
<abstract></abstract>
|
||||
<keywordList>
|
||||
<value></value>
|
||||
</keywordList>
|
||||
<layername>Error Lines</layername>
|
||||
<srs>
|
||||
<spatialrefsys>
|
||||
<proj4>+proj=longlat +datum=WGS84 +no_defs</proj4>
|
||||
<srsid>3452</srsid>
|
||||
<srid>4326</srid>
|
||||
<authid>EPSG:4326</authid>
|
||||
<description>WGS 84</description>
|
||||
<projectionacronym>longlat</projectionacronym>
|
||||
<ellipsoidacronym>WGS84</ellipsoidacronym>
|
||||
<geographicflag>true</geographicflag>
|
||||
</spatialrefsys>
|
||||
</srs>
|
||||
<provider encoding="System">spatialite</provider>
|
||||
<previewExpression>COALESCE( "OGC_FID", '<NULL>' )</previewExpression>
|
||||
<vectorjoins/>
|
||||
<renderer-v2 attr="problem_type" symbollevels="0" type="categorizedSymbol">
|
||||
<categories>
|
||||
<category symbol="0" value="intersection" label="intersection"/>
|
||||
<category symbol="1" value="role_should_be_outer" label="role_should_be_outer"/>
|
||||
<category symbol="2" value="role_should_be_inner" label="role_should_be_inner"/>
|
||||
<category symbol="3" value="" label=""/>
|
||||
</categories>
|
||||
<symbols>
|
||||
<symbol alpha="1" type="line" name="0">
|
||||
<layer pass="0" class="SimpleLine" locked="0">
|
||||
<prop k="capstyle" v="square"/>
|
||||
<prop k="color" v="255,0,0,255"/>
|
||||
<prop k="customdash" v="5;2"/>
|
||||
<prop k="customdash_unit" v="MM"/>
|
||||
<prop k="draw_inside_polygon" v="0"/>
|
||||
<prop k="joinstyle" v="bevel"/>
|
||||
<prop k="offset" v="0"/>
|
||||
<prop k="offset_unit" v="MM"/>
|
||||
<prop k="penstyle" v="solid"/>
|
||||
<prop k="use_custom_dash" v="0"/>
|
||||
<prop k="width" v="0.5"/>
|
||||
<prop k="width_unit" v="MM"/>
|
||||
</layer>
|
||||
</symbol>
|
||||
<symbol alpha="1" type="line" name="1">
|
||||
<layer pass="0" class="SimpleLine" locked="0">
|
||||
<prop k="capstyle" v="square"/>
|
||||
<prop k="color" v="255,122,33,255"/>
|
||||
<prop k="customdash" v="5;2"/>
|
||||
<prop k="customdash_unit" v="MM"/>
|
||||
<prop k="draw_inside_polygon" v="0"/>
|
||||
<prop k="joinstyle" v="bevel"/>
|
||||
<prop k="offset" v="0"/>
|
||||
<prop k="offset_unit" v="MM"/>
|
||||
<prop k="penstyle" v="solid"/>
|
||||
<prop k="use_custom_dash" v="0"/>
|
||||
<prop k="width" v="0.5"/>
|
||||
<prop k="width_unit" v="MM"/>
|
||||
</layer>
|
||||
</symbol>
|
||||
<symbol alpha="1" type="line" name="2">
|
||||
<layer pass="0" class="SimpleLine" locked="0">
|
||||
<prop k="capstyle" v="square"/>
|
||||
<prop k="color" v="255,122,33,255"/>
|
||||
<prop k="customdash" v="5;2"/>
|
||||
<prop k="customdash_unit" v="MM"/>
|
||||
<prop k="draw_inside_polygon" v="0"/>
|
||||
<prop k="joinstyle" v="bevel"/>
|
||||
<prop k="offset" v="0"/>
|
||||
<prop k="offset_unit" v="MM"/>
|
||||
<prop k="penstyle" v="dash"/>
|
||||
<prop k="use_custom_dash" v="0"/>
|
||||
<prop k="width" v="0.5"/>
|
||||
<prop k="width_unit" v="MM"/>
|
||||
</layer>
|
||||
</symbol>
|
||||
<symbol alpha="1" type="line" name="3">
|
||||
<layer pass="0" class="SimpleLine" locked="0">
|
||||
<prop k="capstyle" v="square"/>
|
||||
<prop k="color" v="255,0,0,255"/>
|
||||
<prop k="customdash" v="5;2"/>
|
||||
<prop k="customdash_unit" v="MM"/>
|
||||
<prop k="draw_inside_polygon" v="0"/>
|
||||
<prop k="joinstyle" v="bevel"/>
|
||||
<prop k="offset" v="0"/>
|
||||
<prop k="offset_unit" v="MM"/>
|
||||
<prop k="penstyle" v="solid"/>
|
||||
<prop k="use_custom_dash" v="0"/>
|
||||
<prop k="width" v="0.5"/>
|
||||
<prop k="width_unit" v="MM"/>
|
||||
</layer>
|
||||
</symbol>
|
||||
</symbols>
|
||||
<source-symbol>
|
||||
<symbol alpha="1" type="line" name="0">
|
||||
<layer pass="0" class="SimpleLine" locked="0">
|
||||
<prop k="capstyle" v="square"/>
|
||||
<prop k="color" v="77,243,51,255"/>
|
||||
<prop k="customdash" v="5;2"/>
|
||||
<prop k="customdash_unit" v="MM"/>
|
||||
<prop k="draw_inside_polygon" v="0"/>
|
||||
<prop k="joinstyle" v="bevel"/>
|
||||
<prop k="offset" v="0"/>
|
||||
<prop k="offset_unit" v="MM"/>
|
||||
<prop k="penstyle" v="solid"/>
|
||||
<prop k="use_custom_dash" v="0"/>
|
||||
<prop k="width" v="0.26"/>
|
||||
<prop k="width_unit" v="MM"/>
|
||||
</layer>
|
||||
</symbol>
|
||||
</source-symbol>
|
||||
<rotation/>
|
||||
<sizescale scalemethod="area"/>
|
||||
</renderer-v2>
|
||||
<customproperties>
|
||||
<property key="labeling" value="pal"/>
|
||||
<property key="labeling/addDirectionSymbol" value="false"/>
|
||||
<property key="labeling/angleOffset" value="0"/>
|
||||
<property key="labeling/blendMode" value="0"/>
|
||||
<property key="labeling/bufferBlendMode" value="0"/>
|
||||
<property key="labeling/bufferColorA" value="255"/>
|
||||
<property key="labeling/bufferColorB" value="255"/>
|
||||
<property key="labeling/bufferColorG" value="255"/>
|
||||
<property key="labeling/bufferColorR" value="255"/>
|
||||
<property key="labeling/bufferDraw" value="false"/>
|
||||
<property key="labeling/bufferJoinStyle" value="64"/>
|
||||
<property key="labeling/bufferNoFill" value="false"/>
|
||||
<property key="labeling/bufferSize" value="1"/>
|
||||
<property key="labeling/bufferSizeInMapUnits" value="false"/>
|
||||
<property key="labeling/bufferTransp" value="0"/>
|
||||
<property key="labeling/centroidWhole" value="false"/>
|
||||
<property key="labeling/decimals" value="3"/>
|
||||
<property key="labeling/displayAll" value="false"/>
|
||||
<property key="labeling/dist" value="0"/>
|
||||
<property key="labeling/distInMapUnits" value="false"/>
|
||||
<property key="labeling/enabled" value="false"/>
|
||||
<property key="labeling/fieldName" value=""/>
|
||||
<property key="labeling/fontBold" value="false"/>
|
||||
<property key="labeling/fontCapitals" value="0"/>
|
||||
<property key="labeling/fontFamily" value="Sans"/>
|
||||
<property key="labeling/fontItalic" value="false"/>
|
||||
<property key="labeling/fontLetterSpacing" value="0"/>
|
||||
<property key="labeling/fontLimitPixelSize" value="false"/>
|
||||
<property key="labeling/fontMaxPixelSize" value="10000"/>
|
||||
<property key="labeling/fontMinPixelSize" value="3"/>
|
||||
<property key="labeling/fontSize" value="10"/>
|
||||
<property key="labeling/fontSizeInMapUnits" value="false"/>
|
||||
<property key="labeling/fontStrikeout" value="false"/>
|
||||
<property key="labeling/fontUnderline" value="false"/>
|
||||
<property key="labeling/fontWeight" value="50"/>
|
||||
<property key="labeling/fontWordSpacing" value="0"/>
|
||||
<property key="labeling/formatNumbers" value="false"/>
|
||||
<property key="labeling/isExpression" value="false"/>
|
||||
<property key="labeling/labelOffsetInMapUnits" value="true"/>
|
||||
<property key="labeling/labelPerPart" value="false"/>
|
||||
<property key="labeling/leftDirectionSymbol" value="<"/>
|
||||
<property key="labeling/limitNumLabels" value="false"/>
|
||||
<property key="labeling/maxCurvedCharAngleIn" value="20"/>
|
||||
<property key="labeling/maxCurvedCharAngleOut" value="-20"/>
|
||||
<property key="labeling/maxNumLabels" value="2000"/>
|
||||
<property key="labeling/mergeLines" value="false"/>
|
||||
<property key="labeling/minFeatureSize" value="0"/>
|
||||
<property key="labeling/multilineAlign" value="0"/>
|
||||
<property key="labeling/multilineHeight" value="1"/>
|
||||
<property key="labeling/namedStyle" value=""/>
|
||||
<property key="labeling/obstacle" value="true"/>
|
||||
<property key="labeling/placeDirectionSymbol" value="0"/>
|
||||
<property key="labeling/placement" value="2"/>
|
||||
<property key="labeling/placementFlags" value="10"/>
|
||||
<property key="labeling/plussign" value="false"/>
|
||||
<property key="labeling/preserveRotation" value="true"/>
|
||||
<property key="labeling/previewBkgrdColor" value="#ffffff"/>
|
||||
<property key="labeling/priority" value="5"/>
|
||||
<property key="labeling/quadOffset" value="4"/>
|
||||
<property key="labeling/reverseDirectionSymbol" value="false"/>
|
||||
<property key="labeling/rightDirectionSymbol" value=">"/>
|
||||
<property key="labeling/scaleMax" value="10000000"/>
|
||||
<property key="labeling/scaleMin" value="1"/>
|
||||
<property key="labeling/scaleVisibility" value="false"/>
|
||||
<property key="labeling/shadowBlendMode" value="6"/>
|
||||
<property key="labeling/shadowColorB" value="0"/>
|
||||
<property key="labeling/shadowColorG" value="0"/>
|
||||
<property key="labeling/shadowColorR" value="0"/>
|
||||
<property key="labeling/shadowDraw" value="false"/>
|
||||
<property key="labeling/shadowOffsetAngle" value="135"/>
|
||||
<property key="labeling/shadowOffsetDist" value="1"/>
|
||||
<property key="labeling/shadowOffsetGlobal" value="true"/>
|
||||
<property key="labeling/shadowOffsetUnits" value="1"/>
|
||||
<property key="labeling/shadowRadius" value="1.5"/>
|
||||
<property key="labeling/shadowRadiusAlphaOnly" value="false"/>
|
||||
<property key="labeling/shadowRadiusUnits" value="1"/>
|
||||
<property key="labeling/shadowScale" value="100"/>
|
||||
<property key="labeling/shadowTransparency" value="30"/>
|
||||
<property key="labeling/shadowUnder" value="0"/>
|
||||
<property key="labeling/shapeBlendMode" value="0"/>
|
||||
<property key="labeling/shapeBorderColorA" value="255"/>
|
||||
<property key="labeling/shapeBorderColorB" value="128"/>
|
||||
<property key="labeling/shapeBorderColorG" value="128"/>
|
||||
<property key="labeling/shapeBorderColorR" value="128"/>
|
||||
<property key="labeling/shapeBorderWidth" value="0"/>
|
||||
<property key="labeling/shapeBorderWidthUnits" value="1"/>
|
||||
<property key="labeling/shapeDraw" value="false"/>
|
||||
<property key="labeling/shapeFillColorA" value="255"/>
|
||||
<property key="labeling/shapeFillColorB" value="255"/>
|
||||
<property key="labeling/shapeFillColorG" value="255"/>
|
||||
<property key="labeling/shapeFillColorR" value="255"/>
|
||||
<property key="labeling/shapeJoinStyle" value="64"/>
|
||||
<property key="labeling/shapeOffsetUnits" value="1"/>
|
||||
<property key="labeling/shapeOffsetX" value="0"/>
|
||||
<property key="labeling/shapeOffsetY" value="0"/>
|
||||
<property key="labeling/shapeRadiiUnits" value="1"/>
|
||||
<property key="labeling/shapeRadiiX" value="0"/>
|
||||
<property key="labeling/shapeRadiiY" value="0"/>
|
||||
<property key="labeling/shapeRotation" value="0"/>
|
||||
<property key="labeling/shapeRotationType" value="0"/>
|
||||
<property key="labeling/shapeSVGFile" value=""/>
|
||||
<property key="labeling/shapeSizeType" value="0"/>
|
||||
<property key="labeling/shapeSizeUnits" value="1"/>
|
||||
<property key="labeling/shapeSizeX" value="0"/>
|
||||
<property key="labeling/shapeSizeY" value="0"/>
|
||||
<property key="labeling/shapeTransparency" value="0"/>
|
||||
<property key="labeling/shapeType" value="0"/>
|
||||
<property key="labeling/textColorA" value="255"/>
|
||||
<property key="labeling/textColorB" value="0"/>
|
||||
<property key="labeling/textColorG" value="0"/>
|
||||
<property key="labeling/textColorR" value="0"/>
|
||||
<property key="labeling/textTransp" value="0"/>
|
||||
<property key="labeling/upsidedownLabels" value="0"/>
|
||||
<property key="labeling/wrapChar" value=""/>
|
||||
<property key="labeling/xOffset" value="0"/>
|
||||
<property key="labeling/yOffset" value="0"/>
|
||||
</customproperties>
|
||||
<blendMode>0</blendMode>
|
||||
<featureBlendMode>0</featureBlendMode>
|
||||
<layerTransparency>0</layerTransparency>
|
||||
<displayfield>OGC_FID</displayfield>
|
||||
<label>0</label>
|
||||
<labelattributes>
|
||||
<label fieldname="" text="Label"/>
|
||||
<family fieldname="" name="Sans"/>
|
||||
<size fieldname="" units="pt" value="12"/>
|
||||
<bold fieldname="" on="0"/>
|
||||
<italic fieldname="" on="0"/>
|
||||
<underline fieldname="" on="0"/>
|
||||
<strikeout fieldname="" on="0"/>
|
||||
<color fieldname="" red="0" blue="0" green="0"/>
|
||||
<x fieldname=""/>
|
||||
<y fieldname=""/>
|
||||
<offset x="0" y="0" units="pt" yfieldname="" xfieldname=""/>
|
||||
<angle fieldname="" value="0" auto="0"/>
|
||||
<alignment fieldname="" value="center"/>
|
||||
<buffercolor fieldname="" red="255" blue="255" green="255"/>
|
||||
<buffersize fieldname="" units="pt" value="1"/>
|
||||
<bufferenabled fieldname="" on=""/>
|
||||
<multilineenabled fieldname="" on=""/>
|
||||
<selectedonly on=""/>
|
||||
</labelattributes>
|
||||
<edittypes>
|
||||
<edittype labelontop="0" editable="1" type="0" name="OGC_FID"/>
|
||||
<edittype labelontop="0" editable="1" type="0" name="id"/>
|
||||
<edittype labelontop="0" editable="1" type="0" name="object_id"/>
|
||||
<edittype labelontop="0" editable="1" type="0" name="problem_type"/>
|
||||
<edittype labelontop="0" editable="1" type="0" name="type"/>
|
||||
<edittype labelontop="0" editable="1" type="0" name="way_id"/>
|
||||
</edittypes>
|
||||
<editform>.</editform>
|
||||
<editforminit></editforminit>
|
||||
<featformsuppress>0</featformsuppress>
|
||||
<annotationform>.</annotationform>
|
||||
<editorlayout>generatedlayout</editorlayout>
|
||||
<excludeAttributesWMS/>
|
||||
<excludeAttributesWFS/>
|
||||
<attributeactions/>
|
||||
</maplayer>
|
||||
<maplayer minimumScale="-4.65661e-10" maximumScale="1e+08" simplifyDrawingHints="1" minLabelScale="0" maxLabelScale="1e+08" simplifyDrawingTol="1" geometry="Polygon" simplifyMaxScale="1" type="vector" hasScaleBasedVisibilityFlag="0" simplifyLocal="1" scaleBasedLabelVisibilityFlag="0">
|
||||
<id>multipolygons20140221151811742</id>
|
||||
<datasource>dbname='./multipolygon.db' table="multipolygons" (GEOMETRY) sql=</datasource>
|
||||
<title></title>
|
||||
<abstract></abstract>
|
||||
<keywordList>
|
||||
<value></value>
|
||||
</keywordList>
|
||||
<layername>multipolygons</layername>
|
||||
<srs>
|
||||
<spatialrefsys>
|
||||
<proj4>+proj=longlat +datum=WGS84 +no_defs</proj4>
|
||||
<srsid>3452</srsid>
|
||||
<srid>4326</srid>
|
||||
<authid>EPSG:4326</authid>
|
||||
<description>WGS 84</description>
|
||||
<projectionacronym>longlat</projectionacronym>
|
||||
<ellipsoidacronym>WGS84</ellipsoidacronym>
|
||||
<geographicflag>true</geographicflag>
|
||||
</spatialrefsys>
|
||||
</srs>
|
||||
<provider encoding="System">spatialite</provider>
|
||||
<previewExpression></previewExpression>
|
||||
<vectorjoins/>
|
||||
<renderer-v2 symbollevels="0" type="singleSymbol">
|
||||
<symbols>
|
||||
<symbol alpha="0.494118" type="fill" name="0">
|
||||
<layer pass="0" class="SimpleFill" locked="0">
|
||||
<prop k="border_width_unit" v="MM"/>
|
||||
<prop k="color" v="0,170,255,255"/>
|
||||
<prop k="color_border" v="0,0,0,255"/>
|
||||
<prop k="offset" v="0,0"/>
|
||||
<prop k="offset_unit" v="MM"/>
|
||||
<prop k="style" v="solid"/>
|
||||
<prop k="style_border" v="solid"/>
|
||||
<prop k="width_border" v="0.26"/>
|
||||
</layer>
|
||||
</symbol>
|
||||
</symbols>
|
||||
<rotation/>
|
||||
<sizescale scalemethod="area"/>
|
||||
</renderer-v2>
|
||||
<customproperties>
|
||||
<property key="labeling" value="pal"/>
|
||||
<property key="labeling/addDirectionSymbol" value="false"/>
|
||||
<property key="labeling/angleOffset" value="0"/>
|
||||
<property key="labeling/blendMode" value="0"/>
|
||||
<property key="labeling/bufferBlendMode" value="0"/>
|
||||
<property key="labeling/bufferColorA" value="255"/>
|
||||
<property key="labeling/bufferColorB" value="255"/>
|
||||
<property key="labeling/bufferColorG" value="255"/>
|
||||
<property key="labeling/bufferColorR" value="255"/>
|
||||
<property key="labeling/bufferDraw" value="false"/>
|
||||
<property key="labeling/bufferJoinStyle" value="64"/>
|
||||
<property key="labeling/bufferNoFill" value="false"/>
|
||||
<property key="labeling/bufferSize" value="1"/>
|
||||
<property key="labeling/bufferSizeInMapUnits" value="false"/>
|
||||
<property key="labeling/bufferTransp" value="0"/>
|
||||
<property key="labeling/centroidWhole" value="false"/>
|
||||
<property key="labeling/decimals" value="3"/>
|
||||
<property key="labeling/displayAll" value="false"/>
|
||||
<property key="labeling/dist" value="0"/>
|
||||
<property key="labeling/distInMapUnits" value="false"/>
|
||||
<property key="labeling/enabled" value="false"/>
|
||||
<property key="labeling/fieldName" value=""/>
|
||||
<property key="labeling/fontBold" value="false"/>
|
||||
<property key="labeling/fontCapitals" value="0"/>
|
||||
<property key="labeling/fontFamily" value="Sans"/>
|
||||
<property key="labeling/fontItalic" value="false"/>
|
||||
<property key="labeling/fontLetterSpacing" value="0"/>
|
||||
<property key="labeling/fontLimitPixelSize" value="false"/>
|
||||
<property key="labeling/fontMaxPixelSize" value="10000"/>
|
||||
<property key="labeling/fontMinPixelSize" value="3"/>
|
||||
<property key="labeling/fontSize" value="10"/>
|
||||
<property key="labeling/fontSizeInMapUnits" value="false"/>
|
||||
<property key="labeling/fontStrikeout" value="false"/>
|
||||
<property key="labeling/fontUnderline" value="false"/>
|
||||
<property key="labeling/fontWeight" value="50"/>
|
||||
<property key="labeling/fontWordSpacing" value="0"/>
|
||||
<property key="labeling/formatNumbers" value="false"/>
|
||||
<property key="labeling/isExpression" value="false"/>
|
||||
<property key="labeling/labelOffsetInMapUnits" value="true"/>
|
||||
<property key="labeling/labelPerPart" value="false"/>
|
||||
<property key="labeling/leftDirectionSymbol" value="<"/>
|
||||
<property key="labeling/limitNumLabels" value="false"/>
|
||||
<property key="labeling/maxCurvedCharAngleIn" value="20"/>
|
||||
<property key="labeling/maxCurvedCharAngleOut" value="-20"/>
|
||||
<property key="labeling/maxNumLabels" value="2000"/>
|
||||
<property key="labeling/mergeLines" value="false"/>
|
||||
<property key="labeling/minFeatureSize" value="0"/>
|
||||
<property key="labeling/multilineAlign" value="0"/>
|
||||
<property key="labeling/multilineHeight" value="1"/>
|
||||
<property key="labeling/namedStyle" value=""/>
|
||||
<property key="labeling/obstacle" value="true"/>
|
||||
<property key="labeling/placeDirectionSymbol" value="0"/>
|
||||
<property key="labeling/placement" value="0"/>
|
||||
<property key="labeling/placementFlags" value="0"/>
|
||||
<property key="labeling/plussign" value="false"/>
|
||||
<property key="labeling/preserveRotation" value="true"/>
|
||||
<property key="labeling/previewBkgrdColor" value="#ffffff"/>
|
||||
<property key="labeling/priority" value="5"/>
|
||||
<property key="labeling/quadOffset" value="4"/>
|
||||
<property key="labeling/reverseDirectionSymbol" value="false"/>
|
||||
<property key="labeling/rightDirectionSymbol" value=">"/>
|
||||
<property key="labeling/scaleMax" value="10000000"/>
|
||||
<property key="labeling/scaleMin" value="1"/>
|
||||
<property key="labeling/scaleVisibility" value="false"/>
|
||||
<property key="labeling/shadowBlendMode" value="6"/>
|
||||
<property key="labeling/shadowColorB" value="0"/>
|
||||
<property key="labeling/shadowColorG" value="0"/>
|
||||
<property key="labeling/shadowColorR" value="0"/>
|
||||
<property key="labeling/shadowDraw" value="false"/>
|
||||
<property key="labeling/shadowOffsetAngle" value="135"/>
|
||||
<property key="labeling/shadowOffsetDist" value="1"/>
|
||||
<property key="labeling/shadowOffsetGlobal" value="true"/>
|
||||
<property key="labeling/shadowOffsetUnits" value="1"/>
|
||||
<property key="labeling/shadowRadius" value="1.5"/>
|
||||
<property key="labeling/shadowRadiusAlphaOnly" value="false"/>
|
||||
<property key="labeling/shadowRadiusUnits" value="1"/>
|
||||
<property key="labeling/shadowScale" value="100"/>
|
||||
<property key="labeling/shadowTransparency" value="30"/>
|
||||
<property key="labeling/shadowUnder" value="0"/>
|
||||
<property key="labeling/shapeBlendMode" value="0"/>
|
||||
<property key="labeling/shapeBorderColorA" value="255"/>
|
||||
<property key="labeling/shapeBorderColorB" value="128"/>
|
||||
<property key="labeling/shapeBorderColorG" value="128"/>
|
||||
<property key="labeling/shapeBorderColorR" value="128"/>
|
||||
<property key="labeling/shapeBorderWidth" value="0"/>
|
||||
<property key="labeling/shapeBorderWidthUnits" value="1"/>
|
||||
<property key="labeling/shapeDraw" value="false"/>
|
||||
<property key="labeling/shapeFillColorA" value="255"/>
|
||||
<property key="labeling/shapeFillColorB" value="255"/>
|
||||
<property key="labeling/shapeFillColorG" value="255"/>
|
||||
<property key="labeling/shapeFillColorR" value="255"/>
|
||||
<property key="labeling/shapeJoinStyle" value="64"/>
|
||||
<property key="labeling/shapeOffsetUnits" value="1"/>
|
||||
<property key="labeling/shapeOffsetX" value="0"/>
|
||||
<property key="labeling/shapeOffsetY" value="0"/>
|
||||
<property key="labeling/shapeRadiiUnits" value="1"/>
|
||||
<property key="labeling/shapeRadiiX" value="0"/>
|
||||
<property key="labeling/shapeRadiiY" value="0"/>
|
||||
<property key="labeling/shapeRotation" value="0"/>
|
||||
<property key="labeling/shapeRotationType" value="0"/>
|
||||
<property key="labeling/shapeSVGFile" value=""/>
|
||||
<property key="labeling/shapeSizeType" value="0"/>
|
||||
<property key="labeling/shapeSizeUnits" value="1"/>
|
||||
<property key="labeling/shapeSizeX" value="0"/>
|
||||
<property key="labeling/shapeSizeY" value="0"/>
|
||||
<property key="labeling/shapeTransparency" value="0"/>
|
||||
<property key="labeling/shapeType" value="0"/>
|
||||
<property key="labeling/textColorA" value="255"/>
|
||||
<property key="labeling/textColorB" value="0"/>
|
||||
<property key="labeling/textColorG" value="0"/>
|
||||
<property key="labeling/textColorR" value="0"/>
|
||||
<property key="labeling/textTransp" value="0"/>
|
||||
<property key="labeling/upsidedownLabels" value="0"/>
|
||||
<property key="labeling/wrapChar" value=""/>
|
||||
<property key="labeling/xOffset" value="0"/>
|
||||
<property key="labeling/yOffset" value="0"/>
|
||||
</customproperties>
|
||||
<blendMode>0</blendMode>
|
||||
<featureBlendMode>0</featureBlendMode>
|
||||
<layerTransparency>0</layerTransparency>
|
||||
<displayfield>OGC_FID</displayfield>
|
||||
<label>0</label>
|
||||
<labelattributes>
|
||||
<label fieldname="" text="Label"/>
|
||||
<family fieldname="" name="Sans"/>
|
||||
<size fieldname="" units="pt" value="12"/>
|
||||
<bold fieldname="" on="0"/>
|
||||
<italic fieldname="" on="0"/>
|
||||
<underline fieldname="" on="0"/>
|
||||
<strikeout fieldname="" on="0"/>
|
||||
<color fieldname="" red="0" blue="0" green="0"/>
|
||||
<x fieldname=""/>
|
||||
<y fieldname=""/>
|
||||
<offset x="0" y="0" units="pt" yfieldname="" xfieldname=""/>
|
||||
<angle fieldname="" value="0" auto="0"/>
|
||||
<alignment fieldname="" value="center"/>
|
||||
<buffercolor fieldname="" red="255" blue="255" green="255"/>
|
||||
<buffersize fieldname="" units="pt" value="1"/>
|
||||
<bufferenabled fieldname="" on=""/>
|
||||
<multilineenabled fieldname="" on=""/>
|
||||
<selectedonly on=""/>
|
||||
</labelattributes>
|
||||
<edittypes>
|
||||
<edittype labelontop="0" editable="1" type="0" name="OGC_FID"/>
|
||||
<edittype labelontop="0" editable="1" type="0" name="id"/>
|
||||
<edittype labelontop="0" editable="1" type="0" name="type"/>
|
||||
</edittypes>
|
||||
<editform>.</editform>
|
||||
<editforminit></editforminit>
|
||||
<featformsuppress>0</featformsuppress>
|
||||
<annotationform>.</annotationform>
|
||||
<editorlayout>generatedlayout</editorlayout>
|
||||
<excludeAttributesWMS/>
|
||||
<excludeAttributesWFS/>
|
||||
<attributeactions/>
|
||||
</maplayer>
|
||||
<maplayer minimumScale="0" maximumScale="1e+08" simplifyDrawingHints="0" minLabelScale="0" maxLabelScale="1e+08" simplifyDrawingTol="1" geometry="Point" simplifyMaxScale="1" type="vector" hasScaleBasedVisibilityFlag="0" simplifyLocal="1" scaleBasedLabelVisibilityFlag="0">
|
||||
<id>perrors20140228163658956</id>
|
||||
<datasource>dbname='./multipolygon.db' table="perrors" (GEOMETRY) sql=</datasource>
|
||||
<title></title>
|
||||
<abstract></abstract>
|
||||
<keywordList>
|
||||
<value></value>
|
||||
</keywordList>
|
||||
<layername>Error Points</layername>
|
||||
<srs>
|
||||
<spatialrefsys>
|
||||
<proj4>+proj=longlat +datum=WGS84 +no_defs</proj4>
|
||||
<srsid>3452</srsid>
|
||||
<srid>4326</srid>
|
||||
<authid>EPSG:4326</authid>
|
||||
<description>WGS 84</description>
|
||||
<projectionacronym>longlat</projectionacronym>
|
||||
<ellipsoidacronym>WGS84</ellipsoidacronym>
|
||||
<geographicflag>true</geographicflag>
|
||||
</spatialrefsys>
|
||||
</srs>
|
||||
<provider encoding="System">spatialite</provider>
|
||||
<previewExpression>COALESCE( "OGC_FID", '<NULL>' )</previewExpression>
|
||||
<vectorjoins/>
|
||||
<renderer-v2 attr="problem_type" symbollevels="0" type="categorizedSymbol">
|
||||
<categories>
|
||||
<category symbol="0" value="intersection" label="intersection"/>
|
||||
<category symbol="1" value="ring_not_closed" label="ring_not_closed"/>
|
||||
<category symbol="2" value="duplicate_node" label="duplicate_node"/>
|
||||
</categories>
|
||||
<symbols>
|
||||
<symbol alpha="1" type="marker" name="0">
|
||||
<layer pass="0" class="SimpleMarker" locked="0">
|
||||
<prop k="angle" v="0"/>
|
||||
<prop k="color" v="255,0,0,255"/>
|
||||
<prop k="color_border" v="255,255,255,255"/>
|
||||
<prop k="horizontal_anchor_point" v="1"/>
|
||||
<prop k="name" v="diamond"/>
|
||||
<prop k="offset" v="0,0"/>
|
||||
<prop k="offset_unit" v="MM"/>
|
||||
<prop k="outline_style" v="solid"/>
|
||||
<prop k="outline_width" v="0.4"/>
|
||||
<prop k="outline_width_unit" v="MM"/>
|
||||
<prop k="scale_method" v="area"/>
|
||||
<prop k="size" v="2.8"/>
|
||||
<prop k="size_unit" v="MM"/>
|
||||
<prop k="vertical_anchor_point" v="1"/>
|
||||
</layer>
|
||||
</symbol>
|
||||
<symbol alpha="1" type="marker" name="1">
|
||||
<layer pass="0" class="SimpleMarker" locked="0">
|
||||
<prop k="angle" v="0"/>
|
||||
<prop k="color" v="255,0,0,255"/>
|
||||
<prop k="color_border" v="255,255,255,255"/>
|
||||
<prop k="horizontal_anchor_point" v="1"/>
|
||||
<prop k="name" v="triangle"/>
|
||||
<prop k="offset" v="0,0"/>
|
||||
<prop k="offset_unit" v="MM"/>
|
||||
<prop k="outline_style" v="solid"/>
|
||||
<prop k="outline_width" v="0.4"/>
|
||||
<prop k="outline_width_unit" v="MM"/>
|
||||
<prop k="scale_method" v="area"/>
|
||||
<prop k="size" v="2.8"/>
|
||||
<prop k="size_unit" v="MM"/>
|
||||
<prop k="vertical_anchor_point" v="1"/>
|
||||
</layer>
|
||||
</symbol>
|
||||
<symbol alpha="1" type="marker" name="2">
|
||||
<layer pass="0" class="SimpleMarker" locked="0">
|
||||
<prop k="angle" v="0"/>
|
||||
<prop k="color" v="255,255,255,255"/>
|
||||
<prop k="color_border" v="255,0,0,255"/>
|
||||
<prop k="horizontal_anchor_point" v="1"/>
|
||||
<prop k="name" v="circle"/>
|
||||
<prop k="offset" v="0,0"/>
|
||||
<prop k="offset_unit" v="MM"/>
|
||||
<prop k="outline_style" v="solid"/>
|
||||
<prop k="outline_width" v="0.4"/>
|
||||
<prop k="outline_width_unit" v="MM"/>
|
||||
<prop k="scale_method" v="area"/>
|
||||
<prop k="size" v="2.4"/>
|
||||
<prop k="size_unit" v="MM"/>
|
||||
<prop k="vertical_anchor_point" v="1"/>
|
||||
</layer>
|
||||
<layer pass="0" class="SimpleMarker" locked="0">
|
||||
<prop k="angle" v="0"/>
|
||||
<prop k="color" v="255,0,0,255"/>
|
||||
<prop k="color_border" v="255,0,0,255"/>
|
||||
<prop k="horizontal_anchor_point" v="1"/>
|
||||
<prop k="name" v="circle"/>
|
||||
<prop k="offset" v="0,0"/>
|
||||
<prop k="offset_unit" v="MM"/>
|
||||
<prop k="outline_style" v="solid"/>
|
||||
<prop k="outline_width" v="0.8"/>
|
||||
<prop k="outline_width_unit" v="MM"/>
|
||||
<prop k="scale_method" v="area"/>
|
||||
<prop k="size" v="0.5"/>
|
||||
<prop k="size_unit" v="MM"/>
|
||||
<prop k="vertical_anchor_point" v="1"/>
|
||||
</layer>
|
||||
</symbol>
|
||||
</symbols>
|
||||
<source-symbol>
|
||||
<symbol alpha="1" type="marker" name="0">
|
||||
<layer pass="0" class="SimpleMarker" locked="0">
|
||||
<prop k="angle" v="0"/>
|
||||
<prop k="color" v="139,168,110,255"/>
|
||||
<prop k="color_border" v="0,0,0,255"/>
|
||||
<prop k="horizontal_anchor_point" v="1"/>
|
||||
<prop k="name" v="circle"/>
|
||||
<prop k="offset" v="0,0"/>
|
||||
<prop k="offset_unit" v="MM"/>
|
||||
<prop k="outline_style" v="solid"/>
|
||||
<prop k="outline_width" v="0"/>
|
||||
<prop k="outline_width_unit" v="MM"/>
|
||||
<prop k="scale_method" v="area"/>
|
||||
<prop k="size" v="2"/>
|
||||
<prop k="size_unit" v="MM"/>
|
||||
<prop k="vertical_anchor_point" v="1"/>
|
||||
</layer>
|
||||
</symbol>
|
||||
</source-symbol>
|
||||
<rotation/>
|
||||
<sizescale scalemethod="area"/>
|
||||
</renderer-v2>
|
||||
<customproperties>
|
||||
<property key="labeling" value="pal"/>
|
||||
<property key="labeling/addDirectionSymbol" value="false"/>
|
||||
<property key="labeling/angleOffset" value="0"/>
|
||||
<property key="labeling/blendMode" value="0"/>
|
||||
<property key="labeling/bufferBlendMode" value="0"/>
|
||||
<property key="labeling/bufferColorA" value="255"/>
|
||||
<property key="labeling/bufferColorB" value="255"/>
|
||||
<property key="labeling/bufferColorG" value="255"/>
|
||||
<property key="labeling/bufferColorR" value="255"/>
|
||||
<property key="labeling/bufferDraw" value="false"/>
|
||||
<property key="labeling/bufferJoinStyle" value="64"/>
|
||||
<property key="labeling/bufferNoFill" value="false"/>
|
||||
<property key="labeling/bufferSize" value="1"/>
|
||||
<property key="labeling/bufferSizeInMapUnits" value="false"/>
|
||||
<property key="labeling/bufferTransp" value="0"/>
|
||||
<property key="labeling/centroidWhole" value="false"/>
|
||||
<property key="labeling/decimals" value="3"/>
|
||||
<property key="labeling/displayAll" value="false"/>
|
||||
<property key="labeling/dist" value="0"/>
|
||||
<property key="labeling/distInMapUnits" value="false"/>
|
||||
<property key="labeling/enabled" value="false"/>
|
||||
<property key="labeling/fieldName" value=""/>
|
||||
<property key="labeling/fontBold" value="false"/>
|
||||
<property key="labeling/fontCapitals" value="0"/>
|
||||
<property key="labeling/fontFamily" value="Sans"/>
|
||||
<property key="labeling/fontItalic" value="false"/>
|
||||
<property key="labeling/fontLetterSpacing" value="0"/>
|
||||
<property key="labeling/fontLimitPixelSize" value="false"/>
|
||||
<property key="labeling/fontMaxPixelSize" value="10000"/>
|
||||
<property key="labeling/fontMinPixelSize" value="3"/>
|
||||
<property key="labeling/fontSize" value="10"/>
|
||||
<property key="labeling/fontSizeInMapUnits" value="false"/>
|
||||
<property key="labeling/fontStrikeout" value="false"/>
|
||||
<property key="labeling/fontUnderline" value="false"/>
|
||||
<property key="labeling/fontWeight" value="50"/>
|
||||
<property key="labeling/fontWordSpacing" value="0"/>
|
||||
<property key="labeling/formatNumbers" value="false"/>
|
||||
<property key="labeling/isExpression" value="false"/>
|
||||
<property key="labeling/labelOffsetInMapUnits" value="true"/>
|
||||
<property key="labeling/labelPerPart" value="false"/>
|
||||
<property key="labeling/leftDirectionSymbol" value="<"/>
|
||||
<property key="labeling/limitNumLabels" value="false"/>
|
||||
<property key="labeling/maxCurvedCharAngleIn" value="20"/>
|
||||
<property key="labeling/maxCurvedCharAngleOut" value="-20"/>
|
||||
<property key="labeling/maxNumLabels" value="2000"/>
|
||||
<property key="labeling/mergeLines" value="false"/>
|
||||
<property key="labeling/minFeatureSize" value="0"/>
|
||||
<property key="labeling/multilineAlign" value="0"/>
|
||||
<property key="labeling/multilineHeight" value="1"/>
|
||||
<property key="labeling/namedStyle" value=""/>
|
||||
<property key="labeling/obstacle" value="true"/>
|
||||
<property key="labeling/placeDirectionSymbol" value="0"/>
|
||||
<property key="labeling/placement" value="0"/>
|
||||
<property key="labeling/placementFlags" value="0"/>
|
||||
<property key="labeling/plussign" value="false"/>
|
||||
<property key="labeling/preserveRotation" value="true"/>
|
||||
<property key="labeling/previewBkgrdColor" value="#ffffff"/>
|
||||
<property key="labeling/priority" value="5"/>
|
||||
<property key="labeling/quadOffset" value="4"/>
|
||||
<property key="labeling/reverseDirectionSymbol" value="false"/>
|
||||
<property key="labeling/rightDirectionSymbol" value=">"/>
|
||||
<property key="labeling/scaleMax" value="10000000"/>
|
||||
<property key="labeling/scaleMin" value="1"/>
|
||||
<property key="labeling/scaleVisibility" value="false"/>
|
||||
<property key="labeling/shadowBlendMode" value="6"/>
|
||||
<property key="labeling/shadowColorB" value="0"/>
|
||||
<property key="labeling/shadowColorG" value="0"/>
|
||||
<property key="labeling/shadowColorR" value="0"/>
|
||||
<property key="labeling/shadowDraw" value="false"/>
|
||||
<property key="labeling/shadowOffsetAngle" value="135"/>
|
||||
<property key="labeling/shadowOffsetDist" value="1"/>
|
||||
<property key="labeling/shadowOffsetGlobal" value="true"/>
|
||||
<property key="labeling/shadowOffsetUnits" value="1"/>
|
||||
<property key="labeling/shadowRadius" value="1.5"/>
|
||||
<property key="labeling/shadowRadiusAlphaOnly" value="false"/>
|
||||
<property key="labeling/shadowRadiusUnits" value="1"/>
|
||||
<property key="labeling/shadowScale" value="100"/>
|
||||
<property key="labeling/shadowTransparency" value="30"/>
|
||||
<property key="labeling/shadowUnder" value="0"/>
|
||||
<property key="labeling/shapeBlendMode" value="0"/>
|
||||
<property key="labeling/shapeBorderColorA" value="255"/>
|
||||
<property key="labeling/shapeBorderColorB" value="128"/>
|
||||
<property key="labeling/shapeBorderColorG" value="128"/>
|
||||
<property key="labeling/shapeBorderColorR" value="128"/>
|
||||
<property key="labeling/shapeBorderWidth" value="0"/>
|
||||
<property key="labeling/shapeBorderWidthUnits" value="1"/>
|
||||
<property key="labeling/shapeDraw" value="false"/>
|
||||
<property key="labeling/shapeFillColorA" value="255"/>
|
||||
<property key="labeling/shapeFillColorB" value="255"/>
|
||||
<property key="labeling/shapeFillColorG" value="255"/>
|
||||
<property key="labeling/shapeFillColorR" value="255"/>
|
||||
<property key="labeling/shapeJoinStyle" value="64"/>
|
||||
<property key="labeling/shapeOffsetUnits" value="1"/>
|
||||
<property key="labeling/shapeOffsetX" value="0"/>
|
||||
<property key="labeling/shapeOffsetY" value="0"/>
|
||||
<property key="labeling/shapeRadiiUnits" value="1"/>
|
||||
<property key="labeling/shapeRadiiX" value="0"/>
|
||||
<property key="labeling/shapeRadiiY" value="0"/>
|
||||
<property key="labeling/shapeRotation" value="0"/>
|
||||
<property key="labeling/shapeRotationType" value="0"/>
|
||||
<property key="labeling/shapeSVGFile" value=""/>
|
||||
<property key="labeling/shapeSizeType" value="0"/>
|
||||
<property key="labeling/shapeSizeUnits" value="1"/>
|
||||
<property key="labeling/shapeSizeX" value="0"/>
|
||||
<property key="labeling/shapeSizeY" value="0"/>
|
||||
<property key="labeling/shapeTransparency" value="0"/>
|
||||
<property key="labeling/shapeType" value="0"/>
|
||||
<property key="labeling/textColorA" value="255"/>
|
||||
<property key="labeling/textColorB" value="0"/>
|
||||
<property key="labeling/textColorG" value="0"/>
|
||||
<property key="labeling/textColorR" value="0"/>
|
||||
<property key="labeling/textTransp" value="0"/>
|
||||
<property key="labeling/upsidedownLabels" value="0"/>
|
||||
<property key="labeling/wrapChar" value=""/>
|
||||
<property key="labeling/xOffset" value="0"/>
|
||||
<property key="labeling/yOffset" value="0"/>
|
||||
</customproperties>
|
||||
<blendMode>0</blendMode>
|
||||
<featureBlendMode>0</featureBlendMode>
|
||||
<layerTransparency>0</layerTransparency>
|
||||
<displayfield>OGC_FID</displayfield>
|
||||
<label>0</label>
|
||||
<labelattributes>
|
||||
<label fieldname="" text="Label"/>
|
||||
<family fieldname="" name="Sans"/>
|
||||
<size fieldname="" units="pt" value="12"/>
|
||||
<bold fieldname="" on="0"/>
|
||||
<italic fieldname="" on="0"/>
|
||||
<underline fieldname="" on="0"/>
|
||||
<strikeout fieldname="" on="0"/>
|
||||
<color fieldname="" red="0" blue="0" green="0"/>
|
||||
<x fieldname=""/>
|
||||
<y fieldname=""/>
|
||||
<offset x="0" y="0" units="pt" yfieldname="" xfieldname=""/>
|
||||
<angle fieldname="" value="0" auto="0"/>
|
||||
<alignment fieldname="" value="center"/>
|
||||
<buffercolor fieldname="" red="255" blue="255" green="255"/>
|
||||
<buffersize fieldname="" units="pt" value="1"/>
|
||||
<bufferenabled fieldname="" on=""/>
|
||||
<multilineenabled fieldname="" on=""/>
|
||||
<selectedonly on=""/>
|
||||
</labelattributes>
|
||||
<edittypes>
|
||||
<edittype labelontop="0" editable="1" type="0" name="OGC_FID"/>
|
||||
<edittype labelontop="0" editable="1" type="0" name="id"/>
|
||||
<edittype labelontop="0" editable="1" type="0" name="node_id"/>
|
||||
<edittype labelontop="0" editable="1" type="0" name="object_id"/>
|
||||
<edittype labelontop="0" editable="1" type="0" name="problem_type"/>
|
||||
<edittype labelontop="0" editable="1" type="0" name="type"/>
|
||||
</edittypes>
|
||||
<editform>.</editform>
|
||||
<editforminit></editforminit>
|
||||
<featformsuppress>0</featformsuppress>
|
||||
<annotationform>.</annotationform>
|
||||
<editorlayout>generatedlayout</editorlayout>
|
||||
<excludeAttributesWMS/>
|
||||
<excludeAttributesWFS/>
|
||||
<attributeactions/>
|
||||
</maplayer>
|
||||
</projectlayers>
|
||||
<properties>
|
||||
<WMSContactPerson type="QString"></WMSContactPerson>
|
||||
<WMSOnlineResource type="QString"></WMSOnlineResource>
|
||||
<WMSContactOrganization type="QString"></WMSContactOrganization>
|
||||
<WMSExtent type="QStringList">
|
||||
<value>0.82500024999999999</value>
|
||||
<value>-0.35415386986094277</value>
|
||||
<value>8.17498974999999994</value>
|
||||
<value>3.45415386986094308</value>
|
||||
</WMSExtent>
|
||||
<WMSKeywordList type="QStringList">
|
||||
<value></value>
|
||||
</WMSKeywordList>
|
||||
<WFSUrl type="QString"></WFSUrl>
|
||||
<Paths>
|
||||
<Absolute type="bool">false</Absolute>
|
||||
</Paths>
|
||||
<WMSServiceTitle type="QString">mp test</WMSServiceTitle>
|
||||
<WFSLayers type="QStringList"/>
|
||||
<WMSContactMail type="QString"></WMSContactMail>
|
||||
<PositionPrecision>
|
||||
<DecimalPlaces type="int">2</DecimalPlaces>
|
||||
<Automatic type="bool">true</Automatic>
|
||||
<DegreeFormat type="QString">D</DegreeFormat>
|
||||
</PositionPrecision>
|
||||
<WCSUrl type="QString"></WCSUrl>
|
||||
<WMSContactPhone type="QString"></WMSContactPhone>
|
||||
<WMSServiceCapabilities type="bool">true</WMSServiceCapabilities>
|
||||
<WMSServiceAbstract type="QString"></WMSServiceAbstract>
|
||||
<WMSAddWktGeometry type="bool">false</WMSAddWktGeometry>
|
||||
<Measure>
|
||||
<Ellipsoid type="QString">NONE</Ellipsoid>
|
||||
</Measure>
|
||||
<WFSTLayers>
|
||||
<Insert type="QStringList"/>
|
||||
<Update type="QStringList"/>
|
||||
<Delete type="QStringList"/>
|
||||
</WFSTLayers>
|
||||
<Gui>
|
||||
<SelectionColorBluePart type="int">0</SelectionColorBluePart>
|
||||
<CanvasColorGreenPart type="int">255</CanvasColorGreenPart>
|
||||
<CanvasColorRedPart type="int">255</CanvasColorRedPart>
|
||||
<SelectionColorRedPart type="int">255</SelectionColorRedPart>
|
||||
<SelectionColorAlphaPart type="int">255</SelectionColorAlphaPart>
|
||||
<SelectionColorGreenPart type="int">255</SelectionColorGreenPart>
|
||||
<CanvasColorBluePart type="int">255</CanvasColorBluePart>
|
||||
</Gui>
|
||||
<Identify>
|
||||
<disabledLayers type="QStringList"/>
|
||||
</Identify>
|
||||
<Macros>
|
||||
<pythonCode type="QString"></pythonCode>
|
||||
</Macros>
|
||||
<WMSAccessConstraints type="QString"></WMSAccessConstraints>
|
||||
<WCSLayers type="QStringList"/>
|
||||
<SpatialRefSys>
|
||||
<ProjectCrs type="QString">EPSG:4326</ProjectCrs>
|
||||
</SpatialRefSys>
|
||||
<DefaultStyles>
|
||||
<Fill type="QString"></Fill>
|
||||
<Line type="QString"></Line>
|
||||
<Marker type="QString"></Marker>
|
||||
<RandomColors type="bool">true</RandomColors>
|
||||
<AlphaInt type="int">255</AlphaInt>
|
||||
<ColorRamp type="QString"></ColorRamp>
|
||||
</DefaultStyles>
|
||||
<WMSFees type="QString"></WMSFees>
|
||||
<WMSUrl type="QString"></WMSUrl>
|
||||
</properties>
|
||||
</qgis>
|
||||
@@ -1,46 +0,0 @@
|
||||
#-----------------------------------------------------------------------------
|
||||
#
|
||||
# Helper script that runs the 'multipolygon' test.
|
||||
#
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
# Remove files that might be left over from previous run
|
||||
file(REMOVE multipolygon.db multipolygon-tests.json)
|
||||
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
#
|
||||
# Create multipolygons from test data.
|
||||
#
|
||||
#-----------------------------------------------------------------------------
|
||||
execute_process(
|
||||
COMMAND ${CMAKE_CURRENT_BINARY_DIR}/testdata-multipolygon
|
||||
${OSM_TESTDATA}/grid/data/all.osm
|
||||
RESULT_VARIABLE _result
|
||||
OUTPUT_FILE multipolygon.log
|
||||
ERROR_FILE multipolygon.log
|
||||
)
|
||||
|
||||
if(_result)
|
||||
message(FATAL_ERROR "Error running testdata-multipolygon command")
|
||||
endif()
|
||||
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
#
|
||||
# Compare created multipolygons with reference data.
|
||||
#
|
||||
#-----------------------------------------------------------------------------
|
||||
execute_process(
|
||||
COMMAND ${RUBY} ${OSM_TESTDATA}/bin/compare-areas.rb
|
||||
${OSM_TESTDATA}/grid/data/tests.json
|
||||
multipolygon-tests.json
|
||||
RESULT_VARIABLE _result
|
||||
)
|
||||
|
||||
if(_result)
|
||||
message(FATAL_ERROR "Error running compare-areas command")
|
||||
endif()
|
||||
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
@@ -1,41 +0,0 @@
|
||||
|
||||
#include "common.hpp"
|
||||
|
||||
class TestHandler100 : public osmium::handler::Handler {
|
||||
|
||||
public:
|
||||
|
||||
TestHandler100() :
|
||||
osmium::handler::Handler() {
|
||||
}
|
||||
|
||||
void node(osmium::Node& node) {
|
||||
if (node.id() == 100000) {
|
||||
REQUIRE(node.version() == 1);
|
||||
REQUIRE(node.timestamp() == osmium::Timestamp("2014-01-01T00:00:00Z"));
|
||||
REQUIRE(node.uid() == 1);
|
||||
REQUIRE(!strcmp(node.user(), "test"));
|
||||
REQUIRE(node.changeset() == 1);
|
||||
REQUIRE(node.location().lon() == 1.02);
|
||||
REQUIRE(node.location().lat() == 1.02);
|
||||
} else {
|
||||
throw std::runtime_error("Unknown ID");
|
||||
}
|
||||
}
|
||||
|
||||
}; // class TestHandler100
|
||||
|
||||
TEST_CASE("100") {
|
||||
|
||||
SECTION("test 100") {
|
||||
osmium::io::Reader reader(dirname + "/1/100/data.osm");
|
||||
|
||||
CheckBasicsHandler check_basics_handler(100, 1, 0, 0);
|
||||
CheckWKTHandler check_wkt_handler(dirname, 100);
|
||||
TestHandler100 test_handler;
|
||||
|
||||
osmium::apply(reader, check_basics_handler, check_wkt_handler, test_handler);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,43 +0,0 @@
|
||||
|
||||
#include "common.hpp"
|
||||
|
||||
class TestHandler101 : public osmium::handler::Handler {
|
||||
|
||||
public:
|
||||
|
||||
TestHandler101() :
|
||||
osmium::handler::Handler() {
|
||||
}
|
||||
|
||||
void node(osmium::Node& node) {
|
||||
if (node.id() == 101000) {
|
||||
REQUIRE(node.version() == 1);
|
||||
REQUIRE(node.location().lon() == 1.12);
|
||||
REQUIRE(node.location().lat() == 1.02);
|
||||
} else if (node.id() == 101001) {
|
||||
REQUIRE(node.version() == 1);
|
||||
REQUIRE(node.location().lon() == 1.12);
|
||||
REQUIRE(node.location().lat() == 1.03);
|
||||
} else if (node.id() == 101002) {
|
||||
} else if (node.id() == 101003) {
|
||||
} else {
|
||||
throw std::runtime_error("Unknown ID");
|
||||
}
|
||||
}
|
||||
|
||||
}; // class TestHandler101
|
||||
|
||||
TEST_CASE("101") {
|
||||
|
||||
SECTION("test 101") {
|
||||
osmium::io::Reader reader(dirname + "/1/101/data.osm");
|
||||
|
||||
CheckBasicsHandler check_basics_handler(101, 4, 0, 0);
|
||||
CheckWKTHandler check_wkt_handler(dirname, 101);
|
||||
TestHandler101 test_handler;
|
||||
|
||||
osmium::apply(reader, check_basics_handler, check_wkt_handler, test_handler);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,58 +0,0 @@
|
||||
|
||||
#include "common.hpp"
|
||||
|
||||
class TestHandler110 : public osmium::handler::Handler {
|
||||
|
||||
public:
|
||||
|
||||
TestHandler110() :
|
||||
osmium::handler::Handler() {
|
||||
}
|
||||
|
||||
void node(const osmium::Node& node) {
|
||||
if (node.id() == 110000) {
|
||||
REQUIRE(node.location().lon() == 1.02);
|
||||
REQUIRE(node.location().lat() == 1.12);
|
||||
} else if (node.id() == 110001) {
|
||||
REQUIRE(node.location().lon() == 1.07);
|
||||
REQUIRE(node.location().lat() == 1.13);
|
||||
} else {
|
||||
throw std::runtime_error("Unknown ID");
|
||||
}
|
||||
}
|
||||
|
||||
void way(const osmium::Way& way) {
|
||||
if (way.id() == 110800) {
|
||||
REQUIRE(way.version() == 1);
|
||||
REQUIRE(way.nodes().size() == 2);
|
||||
REQUIRE(!way.is_closed());
|
||||
|
||||
const char *test_id = way.tags().get_value_by_key("test:id");
|
||||
REQUIRE(test_id);
|
||||
REQUIRE(!strcmp(test_id, "110"));
|
||||
} else {
|
||||
throw std::runtime_error("Unknown ID");
|
||||
}
|
||||
}
|
||||
|
||||
}; // class TestHandler110
|
||||
|
||||
TEST_CASE("110") {
|
||||
|
||||
SECTION("test 110") {
|
||||
osmium::io::Reader reader(dirname + "/1/110/data.osm");
|
||||
|
||||
index_pos_type index_pos;
|
||||
index_neg_type index_neg;
|
||||
location_handler_type location_handler(index_pos, index_neg);
|
||||
location_handler.ignore_errors();
|
||||
|
||||
CheckBasicsHandler check_basics_handler(110, 2, 1, 0);
|
||||
CheckWKTHandler check_wkt_handler(dirname, 110);
|
||||
TestHandler110 test_handler;
|
||||
|
||||
osmium::apply(reader, location_handler, check_basics_handler, check_wkt_handler, test_handler);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,182 +0,0 @@
|
||||
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
#include <map>
|
||||
|
||||
#include <gdalcpp.hpp>
|
||||
|
||||
#include <osmium/index/map/sparse_mem_array.hpp>
|
||||
|
||||
#include <osmium/area/assembler.hpp>
|
||||
#include <osmium/area/multipolygon_collector.hpp>
|
||||
#include <osmium/area/problem_reporter_ogr.hpp>
|
||||
#include <osmium/geom/ogr.hpp>
|
||||
#include <osmium/geom/wkt.hpp>
|
||||
#include <osmium/handler.hpp>
|
||||
#include <osmium/handler/node_locations_for_ways.hpp>
|
||||
#include <osmium/io/xml_input.hpp>
|
||||
#include <osmium/visitor.hpp>
|
||||
|
||||
typedef osmium::index::map::SparseMemArray<osmium::unsigned_object_id_type, osmium::Location> index_type;
|
||||
|
||||
typedef osmium::handler::NodeLocationsForWays<index_type> location_handler_type;
|
||||
|
||||
struct less_charptr {
|
||||
|
||||
bool operator()(const char* a, const char* b) const {
|
||||
return std::strcmp(a, b) < 0;
|
||||
}
|
||||
|
||||
}; // less_charptr
|
||||
|
||||
typedef std::map<const char*, const char*, less_charptr> tagmap_type;
|
||||
|
||||
inline tagmap_type create_map(const osmium::TagList& taglist) {
|
||||
tagmap_type map;
|
||||
|
||||
for (auto& tag : taglist) {
|
||||
map[tag.key()] = tag.value();
|
||||
}
|
||||
|
||||
return map;
|
||||
}
|
||||
|
||||
class TestHandler : public osmium::handler::Handler {
|
||||
|
||||
gdalcpp::Layer m_layer_point;
|
||||
gdalcpp::Layer m_layer_lines;
|
||||
gdalcpp::Layer m_layer_mpoly;
|
||||
|
||||
osmium::geom::OGRFactory<> m_ogr_factory;
|
||||
osmium::geom::WKTFactory<> m_wkt_factory;
|
||||
|
||||
std::ofstream m_out;
|
||||
|
||||
bool m_first_out {true};
|
||||
|
||||
public:
|
||||
|
||||
explicit TestHandler(gdalcpp::Dataset& dataset) :
|
||||
m_layer_point(dataset, "points", wkbPoint),
|
||||
m_layer_lines(dataset, "lines", wkbLineString),
|
||||
m_layer_mpoly(dataset, "multipolygons", wkbMultiPolygon),
|
||||
m_out("multipolygon-tests.json") {
|
||||
|
||||
m_layer_point.add_field("id", OFTReal, 10);
|
||||
m_layer_point.add_field("type", OFTString, 30);
|
||||
|
||||
m_layer_lines.add_field("id", OFTReal, 10);
|
||||
m_layer_lines.add_field("type", OFTString, 30);
|
||||
|
||||
m_layer_mpoly.add_field("id", OFTReal, 10);
|
||||
m_layer_mpoly.add_field("from_type", OFTString, 1);
|
||||
}
|
||||
|
||||
~TestHandler() {
|
||||
m_out << "\n]\n";
|
||||
}
|
||||
|
||||
void node(const osmium::Node& node) {
|
||||
gdalcpp::Feature feature(m_layer_point, m_ogr_factory.create_point(node));
|
||||
feature.set_field("id", static_cast<double>(node.id()));
|
||||
feature.set_field("type", node.tags().get_value_by_key("type"));
|
||||
feature.add_to_layer();
|
||||
}
|
||||
|
||||
void way(const osmium::Way& way) {
|
||||
try {
|
||||
gdalcpp::Feature feature(m_layer_lines, m_ogr_factory.create_linestring(way));
|
||||
feature.set_field("id", static_cast<double>(way.id()));
|
||||
feature.set_field("type", way.tags().get_value_by_key("type"));
|
||||
feature.add_to_layer();
|
||||
} catch (osmium::geometry_error&) {
|
||||
std::cerr << "Ignoring illegal geometry for way " << way.id() << ".\n";
|
||||
}
|
||||
}
|
||||
|
||||
void area(const osmium::Area& area) {
|
||||
if (m_first_out) {
|
||||
m_out << "[\n";
|
||||
m_first_out = false;
|
||||
} else {
|
||||
m_out << ",\n";
|
||||
}
|
||||
m_out << "{\n \"test_id\": " << (area.orig_id() / 1000) << ",\n \"area_id\": " << area.id() << ",\n \"from_id\": " << area.orig_id() << ",\n \"from_type\": \"" << (area.from_way() ? "way" : "relation") << "\",\n \"wkt\": \"";
|
||||
try {
|
||||
std::string wkt = m_wkt_factory.create_multipolygon(area);
|
||||
m_out << wkt << "\",\n \"tags\": {";
|
||||
|
||||
auto tagmap = create_map(area.tags());
|
||||
bool first = true;
|
||||
for (auto& tag : tagmap) {
|
||||
if (first) {
|
||||
first = false;
|
||||
} else {
|
||||
m_out << ", ";
|
||||
}
|
||||
m_out << '"' << tag.first << "\": \"" << tag.second << '"';
|
||||
}
|
||||
m_out << "}\n}";
|
||||
} catch (osmium::geometry_error&) {
|
||||
m_out << "INVALID\"\n}";
|
||||
}
|
||||
try {
|
||||
gdalcpp::Feature feature(m_layer_mpoly, m_ogr_factory.create_multipolygon(area));
|
||||
feature.set_field("id", static_cast<double>(area.orig_id()));
|
||||
|
||||
std::string from_type;
|
||||
if (area.from_way()) {
|
||||
from_type = "w";
|
||||
} else {
|
||||
from_type = "r";
|
||||
}
|
||||
feature.set_field("from_type", from_type.c_str());
|
||||
feature.add_to_layer();
|
||||
} catch (osmium::geometry_error&) {
|
||||
std::cerr << "Ignoring illegal geometry for area " << area.id() << " created from " << (area.from_way() ? "way" : "relation") << " with id=" << area.orig_id() << ".\n";
|
||||
}
|
||||
}
|
||||
|
||||
}; // class TestHandler
|
||||
|
||||
/* ================================================== */
|
||||
|
||||
int main(int argc, char* argv[]) {
|
||||
if (argc != 2) {
|
||||
std::cerr << "Usage: " << argv[0] << " INFILE\n";
|
||||
exit(1);
|
||||
}
|
||||
|
||||
std::string output_format("SQLite");
|
||||
std::string input_filename(argv[1]);
|
||||
std::string output_filename("multipolygon.db");
|
||||
|
||||
CPLSetConfigOption("OGR_SQLITE_SYNCHRONOUS", "FALSE");
|
||||
gdalcpp::Dataset dataset{output_format, output_filename, gdalcpp::SRS{}, { "SPATIALITE=TRUE" }};
|
||||
|
||||
osmium::area::ProblemReporterOGR problem_reporter(dataset);
|
||||
osmium::area::Assembler::config_type assembler_config(&problem_reporter);
|
||||
assembler_config.enable_debug_output();
|
||||
osmium::area::MultipolygonCollector<osmium::area::Assembler> collector(assembler_config);
|
||||
|
||||
std::cerr << "Pass 1...\n";
|
||||
osmium::io::Reader reader1(input_filename);
|
||||
collector.read_relations(reader1);
|
||||
reader1.close();
|
||||
std::cerr << "Pass 1 done\n";
|
||||
|
||||
index_type index;
|
||||
location_handler_type location_handler(index);
|
||||
location_handler.ignore_errors();
|
||||
|
||||
TestHandler test_handler(dataset);
|
||||
|
||||
std::cerr << "Pass 2...\n";
|
||||
osmium::io::Reader reader2(input_filename);
|
||||
osmium::apply(reader2, location_handler, test_handler, collector.handler([&test_handler](const osmium::memory::Buffer& area_buffer) {
|
||||
osmium::apply(area_buffer, test_handler);
|
||||
}));
|
||||
reader2.close();
|
||||
std::cerr << "Pass 2 done\n";
|
||||
}
|
||||
|
||||
@@ -1,101 +0,0 @@
|
||||
/* The code in this file is released into the Public Domain. */
|
||||
|
||||
#include <iostream>
|
||||
|
||||
#include <gdalcpp.hpp>
|
||||
|
||||
#include <osmium/index/map/sparse_mem_array.hpp>
|
||||
|
||||
#include <osmium/geom/ogr.hpp>
|
||||
#include <osmium/handler.hpp>
|
||||
#include <osmium/handler/node_locations_for_ways.hpp>
|
||||
#include <osmium/io/xml_input.hpp>
|
||||
#include <osmium/visitor.hpp>
|
||||
|
||||
typedef osmium::index::map::SparseMemArray<osmium::unsigned_object_id_type, osmium::Location> index_type;
|
||||
typedef osmium::handler::NodeLocationsForWays<index_type> location_handler_type;
|
||||
|
||||
class TestOverviewHandler : public osmium::handler::Handler {
|
||||
|
||||
gdalcpp::Layer m_layer_nodes;
|
||||
gdalcpp::Layer m_layer_labels;
|
||||
gdalcpp::Layer m_layer_ways;
|
||||
|
||||
osmium::geom::OGRFactory<> m_factory;
|
||||
|
||||
public:
|
||||
|
||||
explicit TestOverviewHandler(gdalcpp::Dataset& dataset) :
|
||||
m_layer_nodes(dataset, "nodes", wkbPoint),
|
||||
m_layer_labels(dataset, "labels", wkbPoint),
|
||||
m_layer_ways(dataset, "ways", wkbLineString) {
|
||||
|
||||
m_layer_nodes.add_field("id", OFTReal, 10);
|
||||
|
||||
m_layer_labels.add_field("id", OFTReal, 10);
|
||||
m_layer_labels.add_field("label", OFTString, 30);
|
||||
|
||||
m_layer_ways.add_field("id", OFTReal, 10);
|
||||
m_layer_ways.add_field("test", OFTInteger, 3);
|
||||
}
|
||||
|
||||
void node(const osmium::Node& node) {
|
||||
const char* label = node.tags().get_value_by_key("label");
|
||||
if (label) {
|
||||
gdalcpp::Feature feature(m_layer_labels, m_factory.create_point(node));
|
||||
feature.set_field("id", static_cast<double>(node.id()));
|
||||
feature.set_field("label", label);
|
||||
feature.add_to_layer();
|
||||
} else {
|
||||
gdalcpp::Feature feature(m_layer_nodes, m_factory.create_point(node));
|
||||
feature.set_field("id", static_cast<double>(node.id()));
|
||||
feature.add_to_layer();
|
||||
}
|
||||
}
|
||||
|
||||
void way(const osmium::Way& way) {
|
||||
try {
|
||||
gdalcpp::Feature feature(m_layer_ways, m_factory.create_linestring(way));
|
||||
feature.set_field("id", static_cast<double>(way.id()));
|
||||
|
||||
const char* test = way.tags().get_value_by_key("test");
|
||||
if (test) {
|
||||
feature.set_field("test", test);
|
||||
}
|
||||
|
||||
feature.add_to_layer();
|
||||
} catch (osmium::geometry_error&) {
|
||||
std::cerr << "Ignoring illegal geometry for way " << way.id() << ".\n";
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
/* ================================================== */
|
||||
|
||||
int main(int argc, char* argv[]) {
|
||||
if (argc != 2) {
|
||||
std::cerr << "Usage: " << argv[0] << " INFILE\n";
|
||||
exit(1);
|
||||
}
|
||||
|
||||
std::string output_format("SQLite");
|
||||
std::string input_filename(argv[1]);
|
||||
std::string output_filename("testdata-overview.db");
|
||||
::unlink(output_filename.c_str());
|
||||
|
||||
CPLSetConfigOption("OGR_SQLITE_SYNCHRONOUS", "FALSE");
|
||||
gdalcpp::Dataset dataset(output_format, output_filename, gdalcpp::SRS{}, { "SPATIALITE=TRUE" });
|
||||
|
||||
osmium::io::Reader reader(input_filename);
|
||||
|
||||
index_type index;
|
||||
location_handler_type location_handler(index);
|
||||
location_handler.ignore_errors();
|
||||
|
||||
TestOverviewHandler handler(dataset);
|
||||
|
||||
osmium::apply(reader, location_handler, handler);
|
||||
reader.close();
|
||||
}
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
|
||||
#define CATCH_CONFIG_RUNNER
|
||||
|
||||
#include "testdata-testcases.hpp"
|
||||
|
||||
std::string dirname;
|
||||
|
||||
int main(int argc, char* argv[]) {
|
||||
const char* testcases_dir = getenv("TESTCASES_DIR");
|
||||
if (testcases_dir) {
|
||||
dirname = testcases_dir;
|
||||
std::cerr << "Running tests from '" << dirname << "' (from TESTCASES_DIR environment variable)\n";
|
||||
} else {
|
||||
std::cerr << "Please set TESTCASES_DIR environment variable.\n";
|
||||
exit(1);
|
||||
}
|
||||
|
||||
int result = Catch::Session().run(argc, argv);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -1,561 +0,0 @@
|
||||
/* The code in this file is released into the Public Domain. */
|
||||
|
||||
#define CATCH_CONFIG_MAIN
|
||||
#include "catch.hpp"
|
||||
|
||||
#include <cassert>
|
||||
#include <cstdlib>
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
|
||||
#include <osmium/io/detail/queue_util.hpp>
|
||||
#include <osmium/io/xml_input.hpp>
|
||||
#include <osmium/io/gzip_compression.hpp>
|
||||
#include <osmium/visitor.hpp>
|
||||
|
||||
std::string S_(const char* s) {
|
||||
return std::string(s);
|
||||
}
|
||||
|
||||
std::string filename(const char* test_id, const char* suffix = "osm") {
|
||||
const char* testdir = getenv("TESTDIR");
|
||||
if (!testdir) {
|
||||
std::cerr << "You have to set TESTDIR environment variable before running testdata-xml\n";
|
||||
exit(2);
|
||||
}
|
||||
|
||||
std::string f;
|
||||
f += testdir;
|
||||
f += "/";
|
||||
f += test_id;
|
||||
f += "/data.";
|
||||
f += suffix;
|
||||
return f;
|
||||
}
|
||||
|
||||
struct header_buffer_type {
|
||||
osmium::io::Header header;
|
||||
osmium::memory::Buffer buffer;
|
||||
};
|
||||
|
||||
// =============================================
|
||||
|
||||
// The following helper functions are used to call different parts of the
|
||||
// Osmium internals used to read and parse XML files. This way those parts
|
||||
// can be tested individually. These function can not be used in normal
|
||||
// operations, because they make certain assumptions, for instance that
|
||||
// file contents fit into small buffers.
|
||||
|
||||
std::string read_file(const char* test_id) {
|
||||
int fd = osmium::io::detail::open_for_reading(filename(test_id));
|
||||
assert(fd >= 0);
|
||||
|
||||
std::string input(10000, '\0');
|
||||
auto n = ::read(fd, reinterpret_cast<unsigned char*>(const_cast<char*>(input.data())), 10000);
|
||||
assert(n >= 0);
|
||||
input.resize(static_cast<std::string::size_type>(n));
|
||||
|
||||
close(fd);
|
||||
|
||||
return input;
|
||||
}
|
||||
|
||||
std::string read_gz_file(const char* test_id, const char* suffix) {
|
||||
int fd = osmium::io::detail::open_for_reading(filename(test_id, suffix));
|
||||
assert(fd >= 0);
|
||||
|
||||
osmium::io::GzipDecompressor gzip_decompressor(fd);
|
||||
std::string input = gzip_decompressor.read();
|
||||
gzip_decompressor.close();
|
||||
|
||||
return input;
|
||||
}
|
||||
|
||||
|
||||
header_buffer_type parse_xml(std::string input) {
|
||||
osmium::io::detail::future_string_queue_type input_queue;
|
||||
osmium::io::detail::future_buffer_queue_type output_queue;
|
||||
std::promise<osmium::io::Header> header_promise;
|
||||
std::future<osmium::io::Header> header_future = header_promise.get_future();
|
||||
|
||||
osmium::io::detail::add_to_queue(input_queue, std::move(input));
|
||||
osmium::io::detail::add_to_queue(input_queue, std::string{});
|
||||
|
||||
osmium::io::detail::XMLParser parser(input_queue, output_queue, header_promise, osmium::osm_entity_bits::all);
|
||||
parser.parse();
|
||||
|
||||
header_buffer_type result;
|
||||
result.header = header_future.get();
|
||||
std::future<osmium::memory::Buffer> future_buffer;
|
||||
output_queue.wait_and_pop(future_buffer);
|
||||
result.buffer = future_buffer.get();
|
||||
|
||||
if (result.buffer) {
|
||||
std::future<osmium::memory::Buffer> future_buffer2;
|
||||
output_queue.wait_and_pop(future_buffer2);
|
||||
assert(!future_buffer2.get());
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
header_buffer_type read_xml(const char* test_id) {
|
||||
std::string input = read_file(test_id);
|
||||
return parse_xml(input);
|
||||
}
|
||||
|
||||
// =============================================
|
||||
|
||||
TEST_CASE("Reading OSM XML 100") {
|
||||
|
||||
SECTION("Direct") {
|
||||
header_buffer_type r = read_xml("100-correct_but_no_data");
|
||||
|
||||
REQUIRE(r.header.get("generator") == "testdata");
|
||||
REQUIRE(0 == r.buffer.committed());
|
||||
REQUIRE(! r.buffer);
|
||||
}
|
||||
|
||||
SECTION("Using Reader") {
|
||||
osmium::io::Reader reader(filename("100-correct_but_no_data"));
|
||||
|
||||
osmium::io::Header header = reader.header();
|
||||
REQUIRE(header.get("generator") == "testdata");
|
||||
|
||||
osmium::memory::Buffer buffer = reader.read();
|
||||
REQUIRE(0 == buffer.committed());
|
||||
REQUIRE(! buffer);
|
||||
reader.close();
|
||||
}
|
||||
|
||||
SECTION("Using Reader asking for header only") {
|
||||
osmium::io::Reader reader(filename("100-correct_but_no_data"), osmium::osm_entity_bits::nothing);
|
||||
|
||||
osmium::io::Header header = reader.header();
|
||||
REQUIRE(header.get("generator") == "testdata");
|
||||
reader.close();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// =============================================
|
||||
|
||||
TEST_CASE("Reading OSM XML 101") {
|
||||
|
||||
SECTION("Direct") {
|
||||
REQUIRE_THROWS_AS(read_xml("101-missing_version"), osmium::format_version_error);
|
||||
try {
|
||||
read_xml("101-missing_version");
|
||||
} catch (osmium::format_version_error& e) {
|
||||
REQUIRE(e.version.empty());
|
||||
}
|
||||
}
|
||||
|
||||
SECTION("Using Reader") {
|
||||
REQUIRE_THROWS_AS({
|
||||
osmium::io::Reader reader(filename("101-missing_version"));
|
||||
osmium::io::Header header = reader.header();
|
||||
osmium::memory::Buffer buffer = reader.read();
|
||||
reader.close();
|
||||
}, osmium::format_version_error);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// =============================================
|
||||
|
||||
TEST_CASE("Reading OSM XML 102") {
|
||||
|
||||
SECTION("Direct") {
|
||||
REQUIRE_THROWS_AS(read_xml("102-wrong_version"), osmium::format_version_error);
|
||||
try {
|
||||
read_xml("102-wrong_version");
|
||||
} catch (osmium::format_version_error& e) {
|
||||
REQUIRE(e.version == "0.1");
|
||||
}
|
||||
}
|
||||
|
||||
SECTION("Using Reader") {
|
||||
REQUIRE_THROWS_AS({
|
||||
osmium::io::Reader reader(filename("102-wrong_version"));
|
||||
|
||||
osmium::io::Header header = reader.header();
|
||||
osmium::memory::Buffer buffer = reader.read();
|
||||
reader.close();
|
||||
}, osmium::format_version_error);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// =============================================
|
||||
|
||||
TEST_CASE("Reading OSM XML 103") {
|
||||
|
||||
SECTION("Direct") {
|
||||
REQUIRE_THROWS_AS(read_xml("103-old_version"), osmium::format_version_error);
|
||||
try {
|
||||
read_xml("103-old_version");
|
||||
} catch (osmium::format_version_error& e) {
|
||||
REQUIRE(e.version == "0.5");
|
||||
}
|
||||
}
|
||||
|
||||
SECTION("Using Reader") {
|
||||
REQUIRE_THROWS_AS({
|
||||
osmium::io::Reader reader(filename("103-old_version"));
|
||||
osmium::io::Header header = reader.header();
|
||||
osmium::memory::Buffer buffer = reader.read();
|
||||
reader.close();
|
||||
}, osmium::format_version_error);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// =============================================
|
||||
|
||||
TEST_CASE("Reading OSM XML 104") {
|
||||
|
||||
SECTION("Direct") {
|
||||
REQUIRE_THROWS_AS(read_xml("104-empty_file"), osmium::xml_error);
|
||||
try {
|
||||
read_xml("104-empty_file");
|
||||
} catch (osmium::xml_error& e) {
|
||||
REQUIRE(e.line == 1);
|
||||
REQUIRE(e.column == 0);
|
||||
}
|
||||
}
|
||||
|
||||
SECTION("Using Reader") {
|
||||
REQUIRE_THROWS_AS({
|
||||
osmium::io::Reader reader(filename("104-empty_file"));
|
||||
osmium::io::Header header = reader.header();
|
||||
osmium::memory::Buffer buffer = reader.read();
|
||||
reader.close();
|
||||
}, osmium::xml_error);
|
||||
}
|
||||
}
|
||||
|
||||
// =============================================
|
||||
|
||||
TEST_CASE("Reading OSM XML 105") {
|
||||
|
||||
SECTION("Direct") {
|
||||
REQUIRE_THROWS_AS(read_xml("105-incomplete_xml_file"), osmium::xml_error);
|
||||
}
|
||||
|
||||
SECTION("Using Reader") {
|
||||
REQUIRE_THROWS_AS({
|
||||
osmium::io::Reader reader(filename("105-incomplete_xml_file"));
|
||||
osmium::io::Header header = reader.header();
|
||||
osmium::memory::Buffer buffer = reader.read();
|
||||
reader.close();
|
||||
}, osmium::xml_error);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// =============================================
|
||||
|
||||
TEST_CASE("Reading OSM XML 120") {
|
||||
|
||||
SECTION("Direct") {
|
||||
std::string data = read_gz_file("120-correct_gzip_file_without_data", "osm.gz");
|
||||
|
||||
REQUIRE(data.size() == 102);
|
||||
|
||||
header_buffer_type r = parse_xml(data);
|
||||
REQUIRE(r.header.get("generator") == "testdata");
|
||||
REQUIRE(0 == r.buffer.committed());
|
||||
REQUIRE(! r.buffer);
|
||||
}
|
||||
|
||||
SECTION("Using Reader") {
|
||||
osmium::io::Reader reader(filename("120-correct_gzip_file_without_data", "osm.gz"));
|
||||
|
||||
osmium::io::Header header = reader.header();
|
||||
REQUIRE(header.get("generator") == "testdata");
|
||||
|
||||
osmium::memory::Buffer buffer = reader.read();
|
||||
REQUIRE(0 == buffer.committed());
|
||||
REQUIRE(! buffer);
|
||||
reader.close();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// =============================================
|
||||
|
||||
TEST_CASE("Reading OSM XML 121") {
|
||||
|
||||
SECTION("Direct") {
|
||||
REQUIRE_THROWS_AS( {
|
||||
read_gz_file("121-truncated_gzip_file", "osm.gz");
|
||||
}, osmium::gzip_error);
|
||||
}
|
||||
|
||||
SECTION("Using Reader") {
|
||||
// can throw osmium::gzip_error or osmium::xml_error
|
||||
REQUIRE_THROWS({
|
||||
osmium::io::Reader reader(filename("121-truncated_gzip_file", "osm.gz"));
|
||||
osmium::io::Header header = reader.header();
|
||||
osmium::memory::Buffer buffer = reader.read();
|
||||
reader.close();
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// =============================================
|
||||
|
||||
TEST_CASE("Reading OSM XML 122") {
|
||||
|
||||
SECTION("Direct") {
|
||||
REQUIRE_THROWS_AS( {
|
||||
read_xml("122-no_osm_element");
|
||||
}, osmium::xml_error);
|
||||
}
|
||||
|
||||
SECTION("Using Reader") {
|
||||
REQUIRE_THROWS_AS({
|
||||
osmium::io::Reader reader(filename("122-no_osm_element"));
|
||||
osmium::io::Header header = reader.header();
|
||||
osmium::memory::Buffer buffer = reader.read();
|
||||
reader.close();
|
||||
}, osmium::xml_error);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// =============================================
|
||||
|
||||
TEST_CASE("Reading OSM XML 140") {
|
||||
|
||||
SECTION("Using Reader") {
|
||||
osmium::io::Reader reader(filename("140-unicode"));
|
||||
osmium::memory::Buffer buffer = reader.read();
|
||||
reader.close();
|
||||
|
||||
int count = 0;
|
||||
for (auto it = buffer.begin<osmium::Node>(); it != buffer.end<osmium::Node>(); ++it) {
|
||||
++count;
|
||||
REQUIRE(it->id() == count);
|
||||
const osmium::TagList& t = it->tags();
|
||||
|
||||
const char* uc = t["unicode_char"];
|
||||
|
||||
auto len = atoi(t["unicode_utf8_length"]);
|
||||
REQUIRE(len == strlen(uc));
|
||||
|
||||
REQUIRE(S_(uc) == t["unicode_xml"]);
|
||||
|
||||
// workaround for missing support for u8 string literals on Windows
|
||||
#if !defined(_MSC_VER)
|
||||
switch (count) {
|
||||
case 1:
|
||||
REQUIRE(S_(uc) == u8"a");
|
||||
break;
|
||||
case 2:
|
||||
REQUIRE(S_(uc) == u8"\u00e4");
|
||||
break;
|
||||
case 3:
|
||||
REQUIRE(S_(uc) == u8"\u30dc");
|
||||
break;
|
||||
case 4:
|
||||
REQUIRE(S_(uc) == u8"\U0001d11e");
|
||||
break;
|
||||
case 5:
|
||||
REQUIRE(S_(uc) == u8"\U0001f6eb");
|
||||
break;
|
||||
default:
|
||||
REQUIRE(false); // should not be here
|
||||
}
|
||||
#endif
|
||||
}
|
||||
REQUIRE(count == 5);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
// =============================================
|
||||
|
||||
TEST_CASE("Reading OSM XML 141") {
|
||||
|
||||
SECTION("Using Reader") {
|
||||
osmium::io::Reader reader(filename("141-entities"));
|
||||
osmium::memory::Buffer buffer = reader.read();
|
||||
reader.close();
|
||||
REQUIRE(buffer.committed() > 0);
|
||||
REQUIRE(buffer.get<osmium::memory::Item>(0).type() == osmium::item_type::node);
|
||||
|
||||
const osmium::Node& node = buffer.get<osmium::Node>(0);
|
||||
const osmium::TagList& tags = node.tags();
|
||||
|
||||
REQUIRE(S_(tags["less-than"]) == "<");
|
||||
REQUIRE(S_(tags["greater-than"]) == ">");
|
||||
REQUIRE(S_(tags["apostrophe"]) == "'");
|
||||
REQUIRE(S_(tags["ampersand"]) == "&");
|
||||
REQUIRE(S_(tags["quote"]) == "\"");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
// =============================================
|
||||
|
||||
TEST_CASE("Reading OSM XML 142") {
|
||||
|
||||
SECTION("Using Reader to read nodes") {
|
||||
osmium::io::Reader reader(filename("142-whitespace"));
|
||||
osmium::memory::Buffer buffer = reader.read();
|
||||
reader.close();
|
||||
|
||||
int count = 0;
|
||||
for (auto it = buffer.begin<osmium::Node>(); it != buffer.end<osmium::Node>(); ++it) {
|
||||
++count;
|
||||
REQUIRE(it->id() == count);
|
||||
REQUIRE(it->tags().size() == 1);
|
||||
const osmium::Tag& tag = *(it->tags().begin());
|
||||
|
||||
switch (count) {
|
||||
case 1:
|
||||
REQUIRE(S_(it->user()) == "user name");
|
||||
REQUIRE(S_(tag.key()) == "key with space");
|
||||
REQUIRE(S_(tag.value()) == "value with space");
|
||||
break;
|
||||
case 2:
|
||||
REQUIRE(S_(it->user()) == "line\nfeed");
|
||||
REQUIRE(S_(tag.key()) == "key with\nlinefeed");
|
||||
REQUIRE(S_(tag.value()) == "value with\nlinefeed");
|
||||
break;
|
||||
case 3:
|
||||
REQUIRE(S_(it->user()) == "carriage\rreturn");
|
||||
REQUIRE(S_(tag.key()) == "key with\rcarriage\rreturn");
|
||||
REQUIRE(S_(tag.value()) == "value with\rcarriage\rreturn");
|
||||
break;
|
||||
case 4:
|
||||
REQUIRE(S_(it->user()) == "tab\tulator");
|
||||
REQUIRE(S_(tag.key()) == "key with\ttab");
|
||||
REQUIRE(S_(tag.value()) == "value with\ttab");
|
||||
break;
|
||||
case 5:
|
||||
REQUIRE(S_(it->user()) == "unencoded linefeed");
|
||||
REQUIRE(S_(tag.key()) == "key with unencoded linefeed");
|
||||
REQUIRE(S_(tag.value()) == "value with unencoded linefeed");
|
||||
break;
|
||||
default:
|
||||
REQUIRE(false); // should not be here
|
||||
}
|
||||
}
|
||||
REQUIRE(count == 5);
|
||||
}
|
||||
|
||||
SECTION("Using Reader to read relation") {
|
||||
osmium::io::Reader reader(filename("142-whitespace"));
|
||||
osmium::memory::Buffer buffer = reader.read();
|
||||
reader.close();
|
||||
|
||||
auto it = buffer.begin<osmium::Relation>();
|
||||
REQUIRE(it != buffer.end<osmium::Relation>());
|
||||
REQUIRE(it->id() == 21);
|
||||
const auto& members = it->members();
|
||||
REQUIRE(members.size() == 5);
|
||||
|
||||
int count = 0;
|
||||
for (const auto& member : members) {
|
||||
++count;
|
||||
switch (count) {
|
||||
case 1:
|
||||
REQUIRE(S_(member.role()) == "role with whitespace");
|
||||
break;
|
||||
case 2:
|
||||
REQUIRE(S_(member.role()) == "role with\nlinefeed");
|
||||
break;
|
||||
case 3:
|
||||
REQUIRE(S_(member.role()) == "role with\rcarriage\rreturn");
|
||||
break;
|
||||
case 4:
|
||||
REQUIRE(S_(member.role()) == "role with\ttab");
|
||||
break;
|
||||
case 5:
|
||||
REQUIRE(S_(member.role()) == "role with unencoded linefeed");
|
||||
break;
|
||||
default:
|
||||
REQUIRE(false); // should not be here
|
||||
}
|
||||
}
|
||||
REQUIRE(count == 5);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
// =============================================
|
||||
|
||||
TEST_CASE("Reading OSM XML 200") {
|
||||
|
||||
SECTION("Direct") {
|
||||
header_buffer_type r = read_xml("200-nodes");
|
||||
|
||||
REQUIRE(r.header.get("generator") == "testdata");
|
||||
REQUIRE(r.buffer.committed() > 0);
|
||||
REQUIRE(r.buffer.get<osmium::memory::Item>(0).type() == osmium::item_type::node);
|
||||
REQUIRE(r.buffer.get<osmium::Node>(0).id() == 36966060);
|
||||
REQUIRE(std::distance(r.buffer.begin(), r.buffer.end()) == 3);
|
||||
}
|
||||
|
||||
SECTION("Using Reader") {
|
||||
osmium::io::Reader reader(filename("200-nodes"));
|
||||
|
||||
osmium::io::Header header = reader.header();
|
||||
REQUIRE(header.get("generator") == "testdata");
|
||||
|
||||
osmium::memory::Buffer buffer = reader.read();
|
||||
REQUIRE(buffer.committed() > 0);
|
||||
REQUIRE(buffer.get<osmium::memory::Item>(0).type() == osmium::item_type::node);
|
||||
REQUIRE(buffer.get<osmium::Node>(0).id() == 36966060);
|
||||
REQUIRE(std::distance(buffer.begin(), buffer.end()) == 3);
|
||||
reader.close();
|
||||
}
|
||||
|
||||
SECTION("Using Reader asking for nodes") {
|
||||
osmium::io::Reader reader(filename("200-nodes"), osmium::osm_entity_bits::node);
|
||||
|
||||
osmium::io::Header header = reader.header();
|
||||
REQUIRE(header.get("generator") == "testdata");
|
||||
|
||||
osmium::memory::Buffer buffer = reader.read();
|
||||
REQUIRE(buffer.committed() > 0);
|
||||
REQUIRE(buffer.get<osmium::memory::Item>(0).type() == osmium::item_type::node);
|
||||
REQUIRE(buffer.get<osmium::Node>(0).id() == 36966060);
|
||||
REQUIRE(std::distance(buffer.begin(), buffer.end()) == 3);
|
||||
reader.close();
|
||||
}
|
||||
|
||||
SECTION("Using Reader asking for header only") {
|
||||
osmium::io::Reader reader(filename("200-nodes"), osmium::osm_entity_bits::nothing);
|
||||
|
||||
osmium::io::Header header = reader.header();
|
||||
REQUIRE(header.get("generator") == "testdata");
|
||||
|
||||
REQUIRE_THROWS({
|
||||
reader.read();
|
||||
});
|
||||
|
||||
reader.close();
|
||||
}
|
||||
|
||||
SECTION("Using Reader asking for ways") {
|
||||
osmium::io::Reader reader(filename("200-nodes"), osmium::osm_entity_bits::way);
|
||||
|
||||
osmium::io::Header header = reader.header();
|
||||
REQUIRE(header.get("generator") == "testdata");
|
||||
|
||||
osmium::memory::Buffer buffer = reader.read();
|
||||
REQUIRE(0 == buffer.committed());
|
||||
REQUIRE(! buffer);
|
||||
reader.close();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user