Commit e4b24539 authored by Julien Cabieces's avatar Julien Cabieces
Browse files

fix type filtering

parent 60eff336
Pipeline #6409 passed with stage
in 12 minutes and 8 seconds
......@@ -143,7 +143,7 @@ private:
OGRFieldType fieldType = feature.ogr().GetFieldDefnRef(iField)->GetType();
if (std::find(typeFilter.begin(), typeFilter.end(), fieldType) != std::end(typeFilter))
if (typeFilter.empty() || std::find(typeFilter.begin(), typeFilter.end(), fieldType) != std::end(typeFilter))
{
std::string tmpKey = "field." + key.substr(0, end - key.begin());
AddChoice(tmpKey, item);
......
......@@ -175,7 +175,7 @@ private:
OGRFieldType fieldType = feature.ogr().GetFieldDefnRef(iField)->GetType();
if (std::find(typeFilter.begin(), typeFilter.end(), fieldType) != std::end(typeFilter))
if (typeFilter.empty() || std::find(typeFilter.begin(), typeFilter.end(), fieldType) != std::end(typeFilter))
{
std::string tmpKey = "field." + key.substr(0, end - key.begin());
AddChoice(tmpKey, item);
......
......@@ -146,7 +146,7 @@ private:
OGRFieldType fieldType = feature.ogr().GetFieldDefnRef(iField)->GetType();
if (std::find(typeFilter.begin(), typeFilter.end(), fieldType) != std::end(typeFilter))
if (typeFilter.empty() || std::find(typeFilter.begin(), typeFilter.end(), fieldType) != std::end(typeFilter))
{
std::string tmpKey = "field." + key.substr(0, end - key.begin());
AddChoice(tmpKey, item);
......
......@@ -122,12 +122,12 @@ void TrainVectorBase<TInputValue, TOutputValue>::DoUpdateParameters()
OGRFieldType fieldType = feature.ogr().GetFieldDefnRef(iField)->GetType();
if (std::find(featTypeFilter.begin(), featTypeFilter.end(), fieldType) != std::end(featTypeFilter))
if (featTypeFilter.empty() || std::find(featTypeFilter.begin(), featTypeFilter.end(), fieldType) != std::end(featTypeFilter))
{
std::string tmpKey = "feat." + key.substr(0, static_cast<unsigned long>(end - key.begin()));
this->AddChoice(tmpKey, item);
}
if (std::find(cfieldTypeFilter.begin(), cfieldTypeFilter.end(), fieldType) != std::end(cfieldTypeFilter))
if (cfieldTypeFilter.empty() || std::find(cfieldTypeFilter.begin(), cfieldTypeFilter.end(), fieldType) != std::end(cfieldTypeFilter))
{
std::string tmpKey = "cfield." + key.substr(0, static_cast<unsigned long>(end - key.begin()));
this->AddChoice(tmpKey, item);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment