Fix compoundcurve parser

This commit is contained in:
Tamas Szekeres 2019-06-11 13:11:51 +02:00 committed by Nyall Dawson
parent 68a5d1a994
commit 2dc40ae039

View File

@ -467,11 +467,13 @@ std::unique_ptr< QgsCompoundCurve > QgsMssqlGeometryParser::readCompoundCurve( i
switch ( SegmentType( mSegment ) )
{
case SMT_FIRSTLINE:
if ( isCurve )
poCompoundCurve->addCurve( readCircularString( iPoint - nPointsPrepared, iPoint + 1 ).release() );
else
poCompoundCurve->addCurve( readLineString( iPoint - nPointsPrepared, iPoint + 1 ).release() );
if (nPointsPrepared > 0)
{
if ( isCurve )
poCompoundCurve->addCurve( readCircularString( iPoint - nPointsPrepared, iPoint + 1 ).release() );
else
poCompoundCurve->addCurve( readLineString( iPoint - nPointsPrepared, iPoint + 1 ).release() );
}
isCurve = false;
nPointsPrepared = 1;
++iPoint;
@ -481,11 +483,13 @@ std::unique_ptr< QgsCompoundCurve > QgsMssqlGeometryParser::readCompoundCurve( i
++iPoint;
break;
case SMT_FIRSTARC:
if ( isCurve )
poCompoundCurve->addCurve( readCircularString( iPoint - nPointsPrepared, iPoint + 1 ).release() );
else
poCompoundCurve->addCurve( readLineString( iPoint - nPointsPrepared, iPoint + 1 ).release() );
if ( nPointsPrepared > 0 )
{
if ( isCurve )
poCompoundCurve->addCurve( readCircularString( iPoint - nPointsPrepared, iPoint + 1 ).release() );
else
poCompoundCurve->addCurve( readLineString( iPoint - nPointsPrepared, iPoint + 1 ).release() );
}
isCurve = true;
nPointsPrepared = 2;
iPoint += 2;