GeoBaseInfo Class
A class holding metadata according to French standard GéoBase Défense Edition V2.
NuGet/Assembly: Carmenta.Engine.5.16.2.nupkg (in the CECore assembly)
Syntax
public class GeoBaseInfo : ProfileSpecificInfo
Remarks
A GeoBaseInfo instance holds additional metadata for a data set or data file, according to the French standard GéoBase Défense, edition 2. It can be retrieved through the DataSet.GetDataSetInfo method and DataSetInfo.ProfileSpecificInfo, if such metadata is present.
The standard specifies a number of products, each with its own specific data format and associated metadata. So only a few Carmenta Engine data sets will actually look for additional GéoBase Défense metadata files:
Product | Data format | Carmenta Engine data set |
---|---|---|
ORTHO2 | GeoTIFF | |
ORTHO3 | JPEG 2000 | |
DTED1, DTED2 | DTED |
Only a subset of the available metadata is read. QualityParameters will contain a number of single-value quality parameters valid for the entire data set or file, whereas QualityLayers may contain one or more references to an external raster file containing a mask with associated quality values.
Example
// Read GeoBase MGO quality info at a specified point
static AttributeSet getQualityAttributes(DataSet ds, Point p)
{
// Get GeoBase metadata from data set
var dataSetInfo = ds.GetDataSetInfo();
var profileSpecificMetadata = dataSetInfo.ProfileSpecificInfo;
if (!(profileSpecificMetadata is GeoBaseInfo))
{
// If root node didn't have the information, get it from the child covering p
foreach (var dsi in dataSetInfo.Children)
{
if (dsi.Bounds.Inside(p))
{
profileSpecificMetadata = dsi.ProfileSpecificInfo;
if (profileSpecificMetadata is GeoBaseInfo)
break;
}
}
}
if (!(profileSpecificMetadata is GeoBaseInfo))
return null;
var geoBaseInfo = profileSpecificMetadata as GeoBaseInfo;
// Find the MGO quality layer
GeoBaseInfoEntry mgo = null;
foreach (var ql in geoBaseInfo.QualityLayers)
{
if (ql.MeasureIdentification == "MGO")
{
mgo = ql;
break;
}
}
if (mgo == null)
return null;
// Create dataset to read the quality data
DataSetInfo qdsi = DataSetInfo.FromFile(System.IO.Path.Combine(mgo.Path, mgo.FileName));
if (qdsi == null || !qdsi.CanCreateDataSet)
return null;
var qds = qdsi.CreateDataSet();
if (qds == null)
return null;
// Read raster value
int val = qds.GetValueAt(p);
// Lookup raster value in raster attribute table
return mgo.RasterAttributeTable.LookupRasterValue(val);
}
|// Read GeoBase MGO quality info at a specified point
static AttributeSetPtr getQualityAttributes(DataSetPtr ds, Point p)
{
// Get GeoBase metadata from data set
auto dataSetInfo = ds->getDataSetInfo();
auto profileSpecificMetadata = dataSetInfo->profileSpecificInfo();
if (!dynamic_cast<GeoBaseInfo*>(profileSpecificMetadata.get()))
{
// If root node didn't have the information, get it from the child covering p
auto children = dataSetInfo->children();
for (DataSetInfoPtr dsi : *children)
{
if (dsi->bounds().inside(p))
{
profileSpecificMetadata = dsi->profileSpecificInfo();
if (dynamic_cast<GeoBaseInfo*>(profileSpecificMetadata.get()))
break;
}
}
}
if (!dynamic_cast<GeoBaseInfo*>(profileSpecificMetadata.get()))
return nullptr;
auto geoBaseInfo = dynamic_cast<GeoBaseInfo*>(profileSpecificMetadata.get());
// Find the MGO quality layer
GeoBaseInfoEntryPtr mgo;
auto qls = geoBaseInfo->qualityLayers();
for (GeoBaseInfoEntryPtr ql : *qls)
{
if (ql->measureIdentification() == "MGO")
{
mgo = ql;
break;
}
}
if (!mgo)
return nullptr;
// Create dataset to read the quality data
DataSetInfoPtr qdsi = DataSetInfo::fromFile((std::string(mgo->path().c_str()) + "/" + mgo->fileName().c_str()).c_str());
if (!qdsi || !qdsi->canCreateDataSet())
return nullptr;
auto qds = qdsi->createDataSet();
if (!qds)
return nullptr;
// Read raster value
int val = qds->getValueAt(p);
// Lookup raster value in raster attribute table
return mgo->rasterAttributeTable()->lookupRasterValue(val);
}
|// Read GeoBase MGO quality info at a specified point
static AttributeSet getQualityAttributes(DataSet ds, Point p)
{
// Get GeoBase metadata from data set
DataSetInfo dataSetInfo = ds.getDataSetInfo();
ProfileSpecificInfo profileSpecificMetadata = dataSetInfo.getProfileSpecificInfo();
if (!(profileSpecificMetadata instanceof GeoBaseInfo))
{
// If root node didn't have the information, get it from the child covering p
for (DataSetInfo dsi : dataSetInfo.getChildren())
{
if (dsi.getBounds().inside(p))
{
profileSpecificMetadata = dsi.getProfileSpecificInfo();
if (profileSpecificMetadata instanceof GeoBaseInfo)
break;
}
}
}
if (!(profileSpecificMetadata instanceof GeoBaseInfo))
return null;
GeoBaseInfo geoBaseInfo = (GeoBaseInfo)profileSpecificMetadata;
// Find the MGO quality layer
GeoBaseInfoEntry mgo = null;
for (GeoBaseInfoEntry ql : geoBaseInfo.getQualityLayers())
{
if (ql.getMeasureIdentification().equals("MGO"))
{
mgo = ql;
break;
}
}
if (mgo == null)
return null;
// Create dataset to read the quality data
DataSetInfo qdsi = DataSetInfo.fromFile(mgo.getPath() + "/" + mgo.getFileName());
if (qdsi == null || !qdsi.getCanCreateDataSet())
return null;
DataSet qds = qdsi.createDataSet();
if (qds == null)
return null;
// Read raster value
int val = qds.getValueAt(p);
// Lookup raster value in raster attribute table
return mgo.getRasterAttributeTable().lookupRasterValue(val);
}
|
Inheritance Hierarchy
System.Object (not available in C#)
EngineObject
ProfileSpecificInfo
GeoBaseInfo
Platforms
Windows, Linux, Android
GeoBaseInfo Members
The GeoBaseInfo type has the following members.
Properties
Name | Description |
---|---|
IsDisposed | Gets a value that tells whether the current GeoBaseInfo has been disposed. Inherited from EngineObject |
NativeHandle | Gets the native Carmenta Engine kernel object the current GeoBaseInfo represents. Inherited from EngineObject |
QualityLayers | Gets a collection of additional quality layers. |
QualityParameters | Gets a set of single-valued quality parameters valid for the entire data set or file. |
Methods
Name | Description |
---|---|
Clone | Creates a copy of an object. Inherited from EngineObject |
Dispose | Releases the reference to the native Carmenta Engine kernel instance the EngineObject represents. Inherited from EngineObject |
Equals | Determines whether this instance is equal to another. Inherited from EngineObject |