Skip to content

Commit

Permalink
Fix compoundcurve parser
Browse files Browse the repository at this point in the history
  • Loading branch information
szekerest authored and nyalldawson committed Jun 15, 2019
1 parent 68a5d1a commit 2dc40ae
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions src/providers/mssql/qgsmssqlgeometryparser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down

0 comments on commit 2dc40ae

Please sign in to comment.