本文整理汇总了C#中IO.ShapeFile.Extended.ShapeReader.ReadShapeAtIndex方法的典型用法代码示例。如果您正苦于以下问题:C# IO.ShapeFile.Extended.ShapeReader.ReadShapeAtIndex方法的具体用法?C# IO.ShapeFile.Extended.ShapeReader.ReadShapeAtIndex怎么用?C# IO.ShapeFile.Extended.ShapeReader.ReadShapeAtIndex使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IO.ShapeFile.Extended.ShapeReader
的用法示例。
在下文中一共展示了IO.ShapeFile.Extended.ShapeReader.ReadShapeAtIndex方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ReadShapeAtIndex_SendNegativeIndex_ShouldThrowException
public void ReadShapeAtIndex_SendNegativeIndex_ShouldThrowException()
{
// Arrange.
m_TmpFile = new TempFileWriter("shape.shp", ShpFiles.Read("UnifiedChecksMaterial"));
m_Reader = new IO.ShapeFile.Extended.ShapeReader(m_TmpFile.Path);
IGeometryFactory factory = new GeometryFactory();
// Act.
m_Reader.ReadShapeAtIndex(-1, factory);
}
示例2: ReadShapeAtIndex_SendNullFactory_ShouldThrowException
public void ReadShapeAtIndex_SendNullFactory_ShouldThrowException()
{
// Arrange.
m_TmpFile = new TempFileWriter("shape.shp", ShpFiles.Read("UnifiedChecksMaterial"));
m_Reader = new IO.ShapeFile.Extended.ShapeReader(m_TmpFile.Path);
// Act.
m_Reader.ReadShapeAtIndex(0, null);
}
示例3: ReadShapeAtIndex_ReadUnifiedCheckMaterialWithNulLInMiddle_ShouldReturnBothShapesCorrectly
public void ReadShapeAtIndex_ReadUnifiedCheckMaterialWithNulLInMiddle_ShouldReturnBothShapesCorrectly()
{
// Arrange.
m_TmpFile = new TempFileWriter("shape.shp", ShpFiles.Read("UnifiedChecksMaterialNullInMiddle"));
m_Reader = new IO.ShapeFile.Extended.ShapeReader(m_TmpFile.Path);
IGeometryFactory factory = new GeometryFactory();
IPolygon[] expectedResult = new Polygon[]
{
new Polygon(new LinearRing(new Coordinate[]
{
new Coordinate(-0.815656565656566, -0.439393939393939),
new Coordinate(-0.353535353535354, -0.795454545454545),
new Coordinate(-0.888888888888889,-0.929292929292929),
new Coordinate(-1.151515151515152, -0.419191919191919),
new Coordinate(-0.815656565656566,-0.439393939393939),
})),
new Polygon(new LinearRing(new Coordinate[]
{
new Coordinate(0.068181818181818,0.578282828282829),
new Coordinate(0.421717171717172,0.070707070707071),
new Coordinate(-0.457070707070707,0.080808080808081),
new Coordinate(0.068181818181818,0.578282828282829),
}))
};
// Act.
for (int i = 0; i < expectedResult.Length; i++)
{
IGeometry result = m_Reader.ReadShapeAtIndex(i, factory);
Assert.IsNotNull(result);
Assert.IsInstanceOf<IPolygon>(result);
HelperMethods.AssertPolygonsEqual(expectedResult[i], result as IPolygon);
}
}
示例4: ReadShapeAtIndex_ReadSecondUnifiedCheckMaterialShape_ShouldReturnTriangle
public void ReadShapeAtIndex_ReadSecondUnifiedCheckMaterialShape_ShouldReturnTriangle()
{
// Arrange.
m_TmpFile = new TempFileWriter("shape.shp", ShpFiles.Read("UnifiedChecksMaterial"));
m_Reader = new IO.ShapeFile.Extended.ShapeReader(m_TmpFile.Path);
IGeometryFactory factory = new GeometryFactory();
Polygon expectedPolygon = new Polygon(new LinearRing(new Coordinate[]
{
new Coordinate(0.068181818181818,0.578282828282829),
new Coordinate(0.421717171717172,0.070707070707071),
new Coordinate(-0.457070707070707,0.080808080808081),
new Coordinate(0.068181818181818,0.578282828282829),
}));
// Act.
IGeometry polygon = m_Reader.ReadShapeAtIndex(1, factory);
Assert.IsNotNull(polygon);
Assert.IsInstanceOf<IPolygon>(polygon);
HelperMethods.AssertPolygonsEqual(polygon as IPolygon, expectedPolygon);
}
示例5: ReadShapeAtIndex_ReadFirstUnifiedCheckMaterialShape_ShouldReturnRectangle
public void ReadShapeAtIndex_ReadFirstUnifiedCheckMaterialShape_ShouldReturnRectangle()
{
// Arrange.
m_TmpFile = new TempFileWriter("shape.shp", ShpFiles.Read("UnifiedChecksMaterial"));
m_Reader = new IO.ShapeFile.Extended.ShapeReader(m_TmpFile.Path);
IGeometryFactory factory = new GeometryFactory();
Polygon expectedPolygon = new Polygon(new LinearRing(new Coordinate[]
{
new Coordinate(-0.815656565656566, -0.439393939393939),
new Coordinate(-0.353535353535354, -0.795454545454545),
new Coordinate(-0.888888888888889,-0.929292929292929),
new Coordinate(-1.151515151515152, -0.419191919191919),
new Coordinate(-0.815656565656566,-0.439393939393939),
}));
// Act.
IGeometry polygon = m_Reader.ReadShapeAtIndex(0, factory);
Assert.IsNotNull(polygon);
Assert.IsInstanceOf<IPolygon>(polygon);
HelperMethods.AssertPolygonsEqual(polygon as IPolygon, expectedPolygon);
}
示例6: ReadShapeAtIndex_SendNullFactory_ShouldThrowException
public void ReadShapeAtIndex_SendNullFactory_ShouldThrowException()
{
// Arrange.
m_TmpFile = new TempFileCloudUploader("shape.shp", ShpFiles.Read("UnifiedChecksMaterial"));
m_Reader = new IO.ShapeFile.Extended.ShapeReader(new ShapefileStreamProviderRegistry(GetProvider(m_TmpFile.Path), null, true, false));
// Act.
m_Reader.ReadShapeAtIndex(0, null);
}