LuciadCPillar support for SHP
LuciadCPillar supports the decoding of SHP data through the GDAL library.
The GdalModelDecoder
GdalModelDecoder
GdalModelDecoder
reference documentation lists the supported SHP features and the limitations.
Decoding example
Program: Decoding SHP data
luciad::expected<std::shared_ptr<Model>, ErrorInfo> modelExpected = GdalModelDecoder::decode(source);
if (modelExpected.has_value()) {
auto model = std::dynamic_pointer_cast<IFeatureModel>(*modelExpected);
if (model != nullptr) {
// ...
}
} else {
ErrorInfo errorInfo = modelExpected.error();
std::cout << "could not be decoded: " << errorInfo.getMessage();
}
std::cout << std::endl;
try
{
var model = GdalModelDecoder.Decode(source);
if (model is IFeatureModel featureModel)
{
// ...
}
}
catch (IOException exception)
{
Console.Error.WriteLine("Failed to open file '" + source + "': " + exception.Message);
}
try {
Model model = GdalModelDecoder.decode(source);
if (model instanceof IFeatureModel) {
IFeatureModel featureModel = (IFeatureModel) model;
// ...
}
} catch (IOException exception) {
Log.w("", "Failed to open file '" + source + "': " + exception.getMessage());
}
See Visualizing Feature Data for more information about visualizing and styling vector data.