ジオメトリコンストラクタ
Contents
[
Hide
]
ポイントジオメトリ
ポイントの作成
APIを使用して測地ポイントを作成するのは簡単です。以下のコードサンプルを参照してください。
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 | |
Point point = new Point(40.7128, -74.006); |
マルチポイントの作成
Aspose.GIS for .NETは、複数のポイントを単一のMultiPointクラスとして表現する機能を提供します。各ポイントの緯度経度情報によって定義された1つまたは複数のポイントを含めることができます。
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 | |
MultiPoint multipoint = new MultiPoint(); | |
multipoint.Add(new Point(1, 2)); | |
multipoint.Add(new Point(3, 4)); |
ラインストリングジオメトリ
ポイントジオメトリを指定してラインストリングを作成できます。
ラインストリングの作成
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 | |
LineString line = new LineString(); | |
line.AddPoint(78.65, -32.65); | |
line.AddPoint(-98.65, 12.65); |
マルチラインストリングの作成
マルチラインストリングは、Pointジオメトリから構築されたLine Stringのコレクションです。
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 | |
LineString firstLine = new LineString(); | |
firstLine.AddPoint(7.5, -3.5); | |
firstLine.AddPoint(-9.6, 12.6); | |
LineString secondLine = new LineString(); | |
secondLine.AddPoint(8.5, -2.6); | |
secondLine.AddPoint(-8.6, 1.5); | |
MultiLineString multiLineString = new MultiLineString(); | |
multiLineString.Add(firstLine); | |
multiLineString.Add(secondLine); |
ポリゴンジオメトリ
ポリゴンは、LinearRingの形式でポイントによって定義されたPointジオメトリのコレクションです。
ポリゴンの作成
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 | |
Polygon polygon = new Polygon(); | |
LinearRing ring = new LinearRing(); | |
ring.AddPoint(50.02, 36.22); | |
ring.AddPoint(49.99, 36.26); | |
ring.AddPoint(49.97, 36.23); | |
ring.AddPoint(49.98, 36.17); | |
ring.AddPoint(50.02, 36.22); | |
polygon.ExteriorRing = ring; |
マルチポリゴンの作成
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 | |
LinearRing firstRing = new LinearRing(); | |
firstRing.AddPoint(8.5, -2.5); | |
firstRing.AddPoint(-8.5, 2.5); | |
firstRing.AddPoint(8.5, -2.5); | |
Polygon firstPolygon = new Polygon(firstRing); | |
LinearRing secondRing = new LinearRing(); | |
secondRing.AddPoint(7.6, -3.6); | |
secondRing.AddPoint(-9.6, 1.5); | |
secondRing.AddPoint(7.6, -3.6); | |
Polygon secondPolygon = new Polygon(secondRing); | |
MultiPolygon multiPolygon = new MultiPolygon(); | |
multiPolygon.Add(firstPolygon); | |
multiPolygon.Add(secondPolygon); |
穴のあるポリゴンの作成
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 | |
Polygon polygon = new Polygon(); | |
LinearRing ring = new LinearRing(); | |
ring.AddPoint(50.02, 36.22); | |
ring.AddPoint(49.99, 36.26); | |
ring.AddPoint(49.97, 36.23); | |
ring.AddPoint(49.98, 36.17); | |
ring.AddPoint(50.02, 36.22); | |
LinearRing hole = new LinearRing(); | |
hole.AddPoint(50.00, 36.22); | |
hole.AddPoint(49.99, 36.20); | |
hole.AddPoint(49.98, 36.23); | |
hole.AddPoint(50.00, 36.24); | |
hole.AddPoint(50.00, 36.22); | |
polygon.ExteriorRing = ring; | |
polygon.AddInteriorRing(hole); |
ジオメトリコレクションの作成
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 | |
Point point = new Point(40.7128, -74.006); | |
LineString line = new LineString(); | |
line.AddPoint(78.65, -32.65); | |
line.AddPoint(-98.65, 12.65); | |
GeometryCollection geometryCollection = new GeometryCollection(); | |
geometryCollection.Add(point); | |
geometryCollection.Add(line); |