Commit 27f08d28 authored by Dávid Kolozsvári's avatar Dávid Kolozsvári

Some bug fixes for the upcoming osm-simplify tool.

parent 83f2dc5d
......@@ -691,6 +691,8 @@ void GeoDataFeaturePrivate::initializeDefaultStyles()
QSharedPointer<GeoDataStyle> GeoDataFeature::presetStyle( GeoDataVisualCategory category )
{
if ( GeoDataFeaturePrivate::s_defaultStyleInitialized == false )
GeoDataFeaturePrivate::initializeDefaultStyles();
return GeoDataFeaturePrivate::s_defaultStyle[ category ];
}
......
......@@ -62,7 +62,8 @@ bool OsmDocumentTagTranslator::writeMid( const GeoNode *node, GeoWriter& writer
if ( placemark->geometry()->nodeType() == GeoDataTypes::GeoDataPointType ) {
writeElement( placemark, writer );
}
else if ( placemark->geometry()->nodeType() == GeoDataTypes::GeoDataLineStringType ) {
else if ( placemark->geometry()->nodeType() == GeoDataTypes::GeoDataLineStringType ||
placemark->geometry()->nodeType() == GeoDataTypes::GeoDataLinearRingType ) {
// Writing all the lineString nodes directly from the hash, as order is irrelevant
OsmNodeTagWriter::writeAllNodes( osmData, writer );
polylines.append( placemark );
......
......@@ -53,6 +53,10 @@ bool OsmPlacemarkTagTranslator::writeMid( const GeoNode *node, GeoWriter& writer
const GeoDataLineString* lineString = static_cast<const GeoDataLineString*>( placemark->geometry() );
OsmWayTagWriter::writeWay( *lineString, osmData, writer );
}
else if ( placemark->geometry()->nodeType() == GeoDataTypes::GeoDataLinearRingType ) {
const GeoDataLinearRing* linearRing = static_cast<const GeoDataLinearRing*>( placemark->geometry() );
OsmWayTagWriter::writeWay( *linearRing, osmData, writer );
}
else if ( placemark->geometry()->nodeType() == GeoDataTypes::GeoDataPolygonType ) {
const GeoDataPolygon* polygon = static_cast<const GeoDataPolygon*>( placemark->geometry() );
OsmRelationTagWriter::writeMultipolygon( *polygon, osmData, writer );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment