MapWindow / MapWinGIS

MapWinGIS.ocx is a FREE and OPEN SOURCE C++ based geographic information system programming ActiveX Control and application programmer interface (API) that can be added to a Windows Form in Visual Basic, C#, Delphi, or other languages that support ActiveX, providing your app with a map. Go to our forum for questions and help:
https://mapwindow.discourse.group/
Mozilla Public License 2.0
270 stars 134 forks source link

The Error of COgrLayer::LoadShapefile() #160

Closed wangxiya closed 5 years ago

wangxiya commented 5 years ago

The error of COgrLayer::LoadShapefile()

old version:

IShapefile* COgrLayer::LoadShapefile()
{ 
    bool isTrimmed = false; 

    IShapefile* sf = Ogr2Shape::Layer2Shapefile(_layer, _activeShapeType, _loader.GetMaxCacheCount(), isTrimmed, &_loader, _globalCallback);
    if (isTrimmed) {
        ErrorMessage(tkOGR_LAYER_TRIMMED);
    }
    return sf;
}

new version:

IShapefile* COgrLayer::LoadShapefile()
{ 
    bool isTrimmed = false; 
    ShpfileType shpType;
    get_ShapeType(&shpType);

    shpType = shpType != SHP_NULLSHAPE ? shpType : _activeShapeType;

    IShapefile* sf = Ogr2Shape::Layer2Shapefile(_layer, shpType, _loader.GetMaxCacheCount(), isTrimmed, &_loader, _globalCallback);
    if (isTrimmed) {
        ErrorMessage(tkOGR_LAYER_TRIMMED);
    }
    return sf;
}

I don't know whether I modify correctly!

pmeems commented 5 years ago

I saw you made pull request #161 I've asked @jerryfaust to review.

mathijs-dumon commented 5 years ago

Closing as the pull request was closed