Skip to content
Permalink
Browse files
Fix compoundcurve parser
  • Loading branch information
szekerest authored and nyalldawson committed Jun 15, 2019
1 parent 68a5d1a commit 2dc40ae039b1bdd34d39290411d7d388aa685daf
Showing 1 changed file with 14 additions and 10 deletions.
@@ -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;

0 comments on commit 2dc40ae

Please sign in to comment.