Skip to content
Snippets Groups Projects
Commit a5a55452 authored by Arnaud Jaen's avatar Arnaud Jaen
Browse files

BUG: Handle the case of shapefile for the GetLayer method in FusionOGRTileFilter.

parent 04650906
Branches
Tags
No related merge requests found
......@@ -105,7 +105,12 @@ FusionOGRTileFilter<TInputImage>
{
typename InputImageType::ConstPointer inputImage = this->GetInput();
OGRDataSourcePointerType inputDataSource = this->GetOGRDataSource();
OGRLayerType inputLayer = inputDataSource->GetLayerChecked(m_LayerName);
//Handle the case of shapefile. A shapefile is a layer and not a datasource.
//The layer name in a shapefile is the shapefile's name.
//This is not the case for a database as sqlite or PG.
OGRLayerType inputLayer = inputDataSource->GetLayersCount() == 1
? inputDataSource->GetLayer(0)
: inputDataSource->GetLayerChecked(m_LayerName);
//compute the number of stream division in row and column
SizeType imageSize = this->GetInput()->GetLargestPossibleRegion().GetSize();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment