This commit is contained in:
Sarah Hoffmann 2012-10-14 12:51:20 -07:00
commit aee152b62f
2 changed files with 14 additions and 1 deletions

View File

@ -266,6 +266,14 @@ private:
void parseRelation(_ThreadData * threadData) {
const OSMPBF::PrimitiveGroup& group = threadData->PBFprimitiveBlock.primitivegroup( threadData->currentGroupID );
if(0 != luaL_dostring( myLuaState, "return use_restrictions\n")) {
ERR(lua_tostring(myLuaState,-1)<< " occured in scripting block");
}
if (!lua_toboolean(myLuaState, -1)) {
return;
}
for(int i = 0; i < group.relations_size(); i++ ) {
const OSMPBF::Relation& inputRelation = threadData->PBFprimitiveBlock.primitivegroup( threadData->currentGroupID ).relations(i);
bool isRestriction = false;

View File

@ -53,6 +53,11 @@ public:
return (xmlTextReaderRead( inputReader ) == 1);
}
bool Parse() {
if(0 != luaL_dostring( myLuaState, "return use_restrictions\n")) {
ERR(lua_tostring(myLuaState,-1)<< " occured in scripting block");
}
bool useRestrictions = lua_toboolean(myLuaState, -1) != 0;
while ( xmlTextReaderRead( inputReader ) == 1 ) {
const int type = xmlTextReaderNodeType( inputReader );
@ -113,7 +118,7 @@ public:
}
if ( xmlStrEqual( currentName, ( const xmlChar* ) "relation" ) == 1 ) {
_RawRestrictionContainer r = _ReadXMLRestriction();
if(r.fromWay != UINT_MAX) {
if(useRestrictions && r.fromWay != UINT_MAX) {
if(!(*restrictionCallback)(r)) {
std::cerr << "[XMLParser] restriction not parsed" << std::endl;
}