MCPcopy Create free account
hub / github.com/Kitware/VTK / GetLayerType

Method GetLayerType

IO/GDAL/vtkGDALVectorReader.cxx:428–474  ·  view source on GitHub ↗

------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

426
427//------------------------------------------------------------------------------
428int vtkGDALVectorReader::GetLayerType(int layerIndex)
429{
430 if (this->InitializeInternal() == VTK_ERROR)
431 {
432 return -1;
433 }
434
435 OGRLayer* layer = this->Implementation->Source->GetLayer(layerIndex);
436
437 if (!layer)
438 {
439 return -1;
440 }
441
442 switch (layer->GetGeomType())
443 {
444 case wkbUnknown:
445 return VTK_EMPTY_CELL;
446 case wkbPoint:
447 case wkbPoint25D:
448 return VTK_VERTEX;
449 case wkbLinearRing: // OGR docs imply that wkbLinearRing may not inherit wkbLineString in the
450 // future.
451 case wkbLineString:
452 case wkbLineString25D:
453 return VTK_LINE;
454 case wkbPolygon:
455 case wkbPolygon25D:
456 return VTK_POLYGON;
457 case wkbMultiPoint:
458 case wkbMultiPoint25D:
459 return VTK_POLY_VERTEX;
460 case wkbMultiLineString:
461 case wkbMultiLineString25D:
462 return VTK_POLY_LINE;
463 case wkbMultiPolygon:
464 case wkbMultiPolygon25D:
465 return VTK_POLYGON;
466 case wkbGeometryCollection:
467 case wkbGeometryCollection25D:
468 return VTK_NUMBER_OF_CELL_TYPES;
469 case wkbNone:
470 return -1;
471 default:
472 return -1;
473 }
474}
475
476//------------------------------------------------------------------------------
477int vtkGDALVectorReader::GetFeatureCount(int layerIndex)

Callers 1

GetActiveLayerTypeMethod · 0.95

Calls 2

InitializeInternalMethod · 0.95
GetLayerMethod · 0.80

Tested by

no test coverage detected