Skip to content
Permalink
Browse files

Fix MSSQL driver when parsing geometries with ZM values (#5689)

  • Loading branch information...
szekerest committed Oct 27, 2018
1 parent 3c44e49 commit 540d61373642091a720b9d0f4147223134a144c8
Showing with 20 additions and 8 deletions.
  1. +20 −8 mapmssql2008.c
@@ -243,10 +243,21 @@ void ReadPoint(msGeometryParserInfo* gpi, pointObj* p, int iPoint)
}

#ifdef USE_POINT_Z_M
if ( gpi->chProps & SP_HASZVALUES )
if ((gpi->chProps & SP_HASZVALUES) && (gpi->chProps & SP_HASMVALUES))
{
p->z = ReadZ(iPoint);
if ( gpi->chProps & SP_HASMVALUES )
p->z = ReadM(iPoint);
p->m = ReadM(iPoint);
}
else if (gpi->chProps & SP_HASZVALUES)
{
p->z = ReadZ(iPoint);
p->m = 0.0;
}
else if (gpi->chProps & SP_HASMVALUES)
{
p->z = 0.0;
p->m = ReadZ(iPoint);
}
#endif
}

@@ -271,12 +282,13 @@ int ParseSqlGeometry(msMSSQL2008LayerInfo* layerinfo, shapeObj *shape)

gpi->chProps = ReadByte(5);

gpi->nPointSize = 16;

if ( gpi->chProps & SP_HASMVALUES )
gpi->nPointSize = 32;
else if ( gpi->chProps & SP_HASZVALUES )
gpi->nPointSize = 24;
else
gpi->nPointSize = 16;
gpi->nPointSize += 8;

if ( gpi->chProps & SP_HASZVALUES )
gpi->nPointSize += 8;

if ( gpi->chProps & SP_ISSINGLEPOINT ) {
// single point geometry

0 comments on commit 540d613

Please sign in to comment.
You can’t perform that action at this time.