本文整理汇总了C#中IO.ShapeFile.Extended.ShapeReader.ReadMBRs方法的典型用法代码示例。如果您正苦于以下问题:C# IO.ShapeFile.Extended.ShapeReader.ReadMBRs方法的具体用法?C# IO.ShapeFile.Extended.ShapeReader.ReadMBRs怎么用?C# IO.ShapeFile.Extended.ShapeReader.ReadMBRs使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IO.ShapeFile.Extended.ShapeReader
的用法示例。
在下文中一共展示了IO.ShapeFile.Extended.ShapeReader.ReadMBRs方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ReadMBRs_ReadPolygon_ShouldReturnCorrectValues
public void ReadMBRs_ReadPolygon_ShouldReturnCorrectValues()
{
// Arrange.
MBRInfo[] infos = null;
MBRInfo[] expectedInfos = new[]
{
new MBRInfo(new Envelope(33.719047819505683, 33.78096814177016, 31.928805665809271, 32.025301664150398),
100,
0),
new MBRInfo(new Envelope(33.819000337359398, 33.929011051318348, 31.97406740944362, 32.072449163771559),
252,
1),
};
m_TmpFile = new TempFileWriter("shape.shp", ShpFiles.Read("polygon_ed50_geo"));
// Act.
m_Reader = new IO.ShapeFile.Extended.ShapeReader(m_TmpFile.Path);
infos = m_Reader.ReadMBRs().ToArray();
// Assert.
Assert.IsNotNull(infos);
Assert.AreEqual(2, infos.Length);
int currIndex = 0;
foreach (MBRInfo expectedInfo in expectedInfos)
{
HelperMethods.AssertMBRInfoEqual(expectedInfo, infos[currIndex++]);
}
}
示例2: ReadMBRs_ReadUnifiedWithNullAtEnd_ShouldReturnCorrectValues
public void ReadMBRs_ReadUnifiedWithNullAtEnd_ShouldReturnCorrectValues()
{
// Arrange.
MBRInfo[] infos = null;
MBRInfo[] expectedInfos = new[]
{
new MBRInfo(new Envelope(-1.151515151515152, -0.353535353535354, -0.929292929292929, -0.419191919191919),
100,
0),
new MBRInfo(new Envelope(-0.457070707070707, 0.421717171717172, 0.070707070707071, 0.578282828282829),
236,
1),
};
m_TmpFile = new TempFileWriter("shape.shp", ShpFiles.Read("UnifiedChecksMaterialNullAtEnd"));
// Act.
m_Reader = new IO.ShapeFile.Extended.ShapeReader(m_TmpFile.Path);
infos = m_Reader.ReadMBRs().ToArray();
// Assert.
Assert.IsNotNull(infos);
Assert.AreEqual(expectedInfos.Length, infos.Length);
int currIndex = 0;
foreach (MBRInfo expectedInfo in expectedInfos)
{
HelperMethods.AssertMBRInfoEqual(expectedInfo, infos[currIndex++]);
}
}
示例3: ReadMBRs_ReadLine_ShouldReturnCorrectValues
public void ReadMBRs_ReadLine_ShouldReturnCorrectValues()
{
// Arrange.
MBRInfo[] infos = null;
MBRInfo[] expectedInfos = new[]
{
new MBRInfo(new Envelope(34.573027972716453, 34.628034609274806, 31.803273460424684, 31.895998933480186),
100,
0),
new MBRInfo(new Envelope(34.396692412092257, 34.518021336158107, 31.778756216701534, 31.864880893370035),
236,
1),
};
m_TmpFile = new TempFileWriter("shape.shp", ShpFiles.Read("line_wgs84_geo"));
// Act.
m_Reader = new IO.ShapeFile.Extended.ShapeReader(m_TmpFile.Path);
infos = m_Reader.ReadMBRs().ToArray();
// Assert.
Assert.IsNotNull(infos);
Assert.AreEqual(2, infos.Length);
int currIndex = 0;
foreach (MBRInfo expectedInfo in expectedInfos)
{
HelperMethods.AssertMBRInfoEqual(expectedInfo, infos[currIndex++]);
}
}
示例4: ReadMBRs_ReadPoint_ShouldReturnCorrectValues
public void ReadMBRs_ReadPoint_ShouldReturnCorrectValues()
{
// Arrange.
MBRInfo[] infos = null;
MBRInfo[] expectedInfos = new[]
{
new MBRInfo(new Envelope(new Coordinate(34.282930701329349, 31.851167389309651)),
100,
0),
new MBRInfo(new Envelope(new Coordinate(34.145260222088822, 31.864369159253059)),
128,
1),
new MBRInfo(new Envelope(new Coordinate(34.181721116813314, 31.920632180204553)),
156,
2),
};
m_TmpFile = new TempFileWriter("shape.shp", ShpFiles.Read("point_ed50_geo"));
// Act.
m_Reader = new IO.ShapeFile.Extended.ShapeReader(m_TmpFile.Path);
infos = m_Reader.ReadMBRs().ToArray();
// Assert.
Assert.IsNotNull(infos);
Assert.AreEqual(3, infos.Length);
int currIndex = 0;
foreach (MBRInfo expectedInfo in expectedInfos)
{
HelperMethods.AssertMBRInfoEqual(expectedInfo, infos[currIndex++]);
}
}