Hi Alexander,
Can you please explain about GISNET-2063,
Is it connected to options, we talked about , connecting failure error with fixing by conversion error?
Thanks,
Hi @danies8
No
Improve conversion/save logging details for recoverable operation errors collected during format conversion.
This task follows GISNET-2042, in which an optional SRS transformation error collection was added for invalid Shapefile conversions using the general OperationErrorCollector API. The same mechanism should now be used to improve diagnostic logging for conversion/save operations in a generalized way.
Can you please give what the change is:
Before and after.
Thanks,
Can you please answer?
Hi @danies8
var errors = new OperationErrorCollector();
var options = new ConversionOptions
{
DestinationSpatialReferenceSystem = SpatialReferenceSystem.Wgs84,
DestinationDriverOptions = new KmlOptions
{
ErrorCollector = errors
}
};
VectorLayer.Convert(
sourcePath,
Drivers.Shapefile,
destinationPath,
Drivers.Kml,
options);
Console.WriteLine("Converted with recoverable errors: " + errors.Count);
foreach (var error in errors.Errors)
{
Console.WriteLine(error);
}
This was the old code:
Shapefile to Kmk - Conversion succeeded -input and output are not the same.
Solution :
Using ‘ErrorCollector’ option during conversion features with this values
(Transformation of coordinate error) will ignore.
var errors = new OperationErrorCollector();
var options = new ConversionOptions()
{
DestinationDriverOptions = new KmlOptions()
{
ErrorCollector = errors
},
};
New code:
You add this line:
DestinationSpatialReferenceSystem = SpatialReferenceSystem.Wgs84,
and this the way to solve this problem now ?
Thanks,
No!
Now we can see error details during conversion.
foreach (var error in errors.Errors)
{
Console.WriteLine(error);
}
OK.
Please close it.
Thank you!
I close this topic