示例#1
0
void OsmConverter::processPolygon(GeoDataPolygon *polygon,
                                  const OsmPlacemarkData& osmData,
                                  GeoDataPlacemark* placemark)
{
    int index = -1;

    // Writing all the outerRing's nodes
    const GeoDataLinearRing &outerRing = polygon->outerBoundary();
    const OsmPlacemarkData outerRingOsmData = osmData.memberReference( index );
    for (auto const &coordinates: outerRing) {
        m_nodes << OsmConverter::Node(coordinates, outerRingOsmData.nodeReference(coordinates));
    }
    m_ways << OsmConverter::Way(&outerRing, outerRingOsmData);

    // Writing all nodes for each innerRing
    for (auto const &innerRing: polygon->innerBoundaries() ) {
        ++index;
        const OsmPlacemarkData innerRingOsmData = osmData.memberReference( index );
        for (auto const &coordinates: innerRing) {
            m_nodes << OsmConverter::Node(coordinates, innerRingOsmData.nodeReference(coordinates));
        }
        m_ways << OsmConverter::Way(&innerRing, innerRingOsmData);
    }
    m_relations.append(OsmConverter::Relation(placemark, osmData));
}
示例#2
0
void OsmConverter::processLinearRing(GeoDataLinearRing *linearRing,
                                     const OsmPlacemarkData& osmData)
{
    for (auto const &coordinates: *linearRing) {
        m_nodes << OsmConverter::Node(coordinates, osmData.nodeReference(coordinates));
    }
    m_ways << OsmConverter::Way(linearRing, osmData);
}
示例#3
0
 foreach(const GeoDataCoordinates &coordinates, innerRing) {
     m_nodes << OsmConverter::Node(coordinates, innerRingOsmData.nodeReference(coordinates));
 }