GetLayerInfo

globalmapper.GetLayerInfo(GM_LayerHandle_t32 aLayer) GM_LayerInfo_t[source]

Retrieves information about the given layer. If the layer is not loaded, nothing is returned. Otherwise, information about the layer is returned as a GM_LayerInfo_t object.

The GM_LayerInfo_t object is a comprehensive container of all the stored useful data about a layer. If you want to fetch a specific piece of data, reference it as a variable of the info object. For example, this is one way to get a bounding box for an entire layer:

info = gm.GetLayerInfo(the_layer)
bounding_box = info.mGlobalRect
Parameters:

aLayer (GM_LayerHandle_t32) – the layer to retrieve info for

Returns:

The layer’s metadata, or 0

Return type:

GM_LayerInfo_t

Below is the complete list of values for a layer that can be grabbed from a GM_LayerInfo_t object. You can also call print(…) on the info object to see all the values displayed at once. Note that the variables labeled RASTER/ELEV/VECTOR ONLY will still be present regardless of layer type; they may just have default values if the layer is not of the corresponding type.

  • mArchiveFilename: - Filename within archive file (e.g. .zip or .tar.gz) from which layer was loaded, if any (might be NULL)

  • mBandBitDepth: - RASTER/ELEV ONLY: number of bits per band value. Multiply by mNumBands to get total bit depth per sample.

  • mBandValType: - RASTER/ELEV ONLY: type of data for the bands

  • mCodePage: - Code page for text in layer. 0 is default and current active code page (CP_ACP). CP_UTF8 is for UTF-8 interpretation.

  • mControlPoints: - RASTER ONLY: The array of Ground Control Points for the layer. It’s stored as a pointer to a GM_GroundControlPoint_t, so use GM_GroundControlPoint_array_frompointer(…) to convert into an indexable array.

  • mDescription: - Layer description string

  • mDfltViewGlobal: - Default view bounding rectangle of layer in global coordinates (usually same as mGlobalRect)

  • mElevUnits: - Elevation units for layer

  • mEnabled: - Is this layer enabled for display or it it hidden?

  • mExtraLoadFlags: - Additional load flags with options selected by user during load. Pass these to GM_LoadLayerListEx to remember options.

  • mFilename: - Filename from which layer was loaded. If this is an archive file, like .zip, then the name of the actual loaded file will be in mArchiveFilename

  • mGlobalPixelHeight: - RASTER/ELEV ONLY: Approximate number of pixels required in height for a 1:1 pixel mapping in the current projection

  • mGlobalPixelWidth: - RASTER/ELEV ONLY: Approximate number of pixels required in width for a 1:1 pixel mapping in the current projection

  • mGlobalRect: - Bounding rectangle of the layer in global coordinates

  • mGroupName: - Group name that the layer is in. Empty string if part of no group. Separated with <sep> if multiple levels.

  • mHasRasterData: - Does this layer have raster or elevation data?

  • mHasVectorData: - Does this layer have vector data?

  • mLayerFlags: - Extra GM_LayerFlags_t32 flags for the layer

  • mMaxElevation: - ELEV ONLY: Maximum elevation in meters

  • mMetadataList: - List of metadata attributes and values for the layer. Stored as a pointer to a GM_AttrValue_t, so use GM_AttrValue_array_frompointer(…) to convert into an indexable array.

  • mMetadataListSize: - Number of metadata attributes in mMetadataList

  • mMinElevation: - ELEV ONLY: Minimum elevation in meters

  • mNativeProj: - Native projection of layer

  • mNativeRect: - Bounding rectangle of layer in native coordinates

  • mNumAreas: - VECTOR ONLY: Number of area features

  • mNumBands: - Number of bands in a raster image (use SetRasterDisplayOptions to change color band layout)

  • mNumGCPs: - Number of ground control points in mControlPoints

  • mNumLidarPoints: - VECTOR ONLY: Number of Lidar point cloud points (fetch individual points with GetLidarPoint)

  • mNumLines: - VECTOR ONLY: Number of line features

  • mNumPoints: - VECTOR ONLY: Number of point features

  • mPalette: - Array of palette entries for palette-based raster layer. Stored as a pointer to a GM_PaletteEntry_t, so use GM_PaletteEntry_array_frompointer(…) to convert into an indexable array.

  • mPaletteSize: - Number of palette entries in mPalette

  • mParentLayer: - Handle to parent layer if this is a child (i.e. from catalog or online layer). Will be 0 for all top-level layers.

  • mPixelHeight: - RASTER/ELEV ONLY: Layer’s height in number of pixels

  • mPixelSizeX: - RASTER/ELEV ONLY: Size of one pixel, in meters, in the x direction

  • mPixelSizeY: - RASTER/ELEV ONLY: Size of one pixel, in meters, in the y direction

  • mPixelWidth: - RASTER/ELEV ONLY: Layer’s width in number of pixels

  • mRasterTypeFlags: - Raster type flags (GM_RasterTypeFlags_t32), specifies what type of data a raster layer actually contains

  • mTypeName: - Layer type name

  • mUsedDefaultPos: - RASTER/ELEV ONLY: Was the default position used for this layer since the file could not be automatically positioned?

  • mUsedDefaultProj: - Was the default projection used for this layer since a projection for the file could not be automatically determined?

  • mUserData: - Custom data associated with layer provided by user via SetLayerUserData function

  • mUserText: - Custom text string associated with layer provided by user via SetLayerUserText function or loaded form workspace