WKB geometrie - Well-Known Binary
Contents
[
Hide
]
Knihovna Aspose.GIS C# vám umožní pracovat s reprezentací geometrie ve formátu Well-Known Binary (WKB).
Převod geometrie z WKB
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For complete examples and data files, please go to https://github.com/aspose-gis/Aspose.GIS-for-.NET | |
string path = Path.Combine(RunExamples.GetDataDir(), "WkbFile.wkb"); | |
byte[] wkb = File.ReadAllBytes(path); | |
IGeometry geometry = Geometry.FromBinary(wkb); | |
Console.WriteLine(geometry.AsText()); // LINESTRING (1.2 3.4, 5.6 7.8) |
Převod geometrie do WKB
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For complete examples and data files, please go to https://github.com/aspose-gis/Aspose.GIS-for-.NET | |
IGeometry geometry = Geometry.FromText("LINESTRING (1.2 3.4, 5.6 7.8)"); | |
byte[] wkb = geometry.AsBinary(); | |
//File.WriteAllBytes(Path.Combine(TestConfiguration.TestOutputPath, "file.wkb"), wkb); | |
File.WriteAllBytes(Path.Combine(RunExamples.GetDataDir(), "WkbFile.wkb"), wkb); |
Specifikace varianty WKB při převodu
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For complete examples and data files, please go to https://github.com/aspose-gis/Aspose.GIS-for-.NET | |
IGeometry geometry = Geometry.FromText("LINESTRING (1.2 3.4, 5.6 7.8)"); | |
byte[] wkb = geometry.AsBinary(WkbVariant.ExtendedPostGis); | |
File.WriteAllBytes(Path.Combine(RunExamples.GetDataDir(), "EWkbFile.ewkb"), wkb); |