Merge 0e3b5f763d into dc86007fa9
This commit is contained in:
commit
aee152b62f
@ -266,6 +266,14 @@ private:
|
|||||||
|
|
||||||
void parseRelation(_ThreadData * threadData) {
|
void parseRelation(_ThreadData * threadData) {
|
||||||
const OSMPBF::PrimitiveGroup& group = threadData->PBFprimitiveBlock.primitivegroup( threadData->currentGroupID );
|
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++ ) {
|
for(int i = 0; i < group.relations_size(); i++ ) {
|
||||||
const OSMPBF::Relation& inputRelation = threadData->PBFprimitiveBlock.primitivegroup( threadData->currentGroupID ).relations(i);
|
const OSMPBF::Relation& inputRelation = threadData->PBFprimitiveBlock.primitivegroup( threadData->currentGroupID ).relations(i);
|
||||||
bool isRestriction = false;
|
bool isRestriction = false;
|
||||||
|
|||||||
@ -53,6 +53,11 @@ public:
|
|||||||
return (xmlTextReaderRead( inputReader ) == 1);
|
return (xmlTextReaderRead( inputReader ) == 1);
|
||||||
}
|
}
|
||||||
bool Parse() {
|
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 ) {
|
while ( xmlTextReaderRead( inputReader ) == 1 ) {
|
||||||
const int type = xmlTextReaderNodeType( inputReader );
|
const int type = xmlTextReaderNodeType( inputReader );
|
||||||
|
|
||||||
@ -113,7 +118,7 @@ public:
|
|||||||
}
|
}
|
||||||
if ( xmlStrEqual( currentName, ( const xmlChar* ) "relation" ) == 1 ) {
|
if ( xmlStrEqual( currentName, ( const xmlChar* ) "relation" ) == 1 ) {
|
||||||
_RawRestrictionContainer r = _ReadXMLRestriction();
|
_RawRestrictionContainer r = _ReadXMLRestriction();
|
||||||
if(r.fromWay != UINT_MAX) {
|
if(useRestrictions && r.fromWay != UINT_MAX) {
|
||||||
if(!(*restrictionCallback)(r)) {
|
if(!(*restrictionCallback)(r)) {
|
||||||
std::cerr << "[XMLParser] restriction not parsed" << std::endl;
|
std::cerr << "[XMLParser] restriction not parsed" << std::endl;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user