io related tests.
Tests for reading and writing of raster and vector data.
Multiband rasters can be read and written correctly
SQLite vector data can be read and written correctly
3D polygons can be read correctly with z component dismissed
3D polygons are a specialisation of ‘2d’ polygons which assigns a ‘z’ to each vertex (wkbPolygon25D in ogr parlance). It’s normally referred to as 2.5D since the format does not truly represent volumetric spaces
This test verifies that such polygons can be read as 2d - i.e. with the third dimension removed.
ogrinfo reports this for 25d polygons:
INFO: Open of `../inasafe_data/test/25dpolygon.shp' using driver `ESRI Shapefile' successful. 1: 25dpolygon (3D Polygon)
Analysis of vector data - get top N of an attribute
Conversion to wkt data works
Different attribute types are handled correctly in vector data
ASC raster files with bad data causes good error message
This example is courtesy of Hyeuk Ryu
Linear and quantile bins are correct
Bounding boxes can be converted between list and string
Intersections of bounding boxes work
Bounding box can be buffered
Centroid point data can be derived from polygon data
Test against centroid data generated by QGIS: shapefiles with a _centroids.shp suffix.
Projections that are compatible but not identical are recognised
This is a test for issue #304
Donut polygon can be read, interpreted and written correctly
Empty keywords can be handled
Bounding box can be extracted from geotransform
Resolution can be extracted from geotransform
Bounding box is correctly extracted from file.
gdalinfo Earthquake_Ground_Shaking_clip.tif Driver: GTiff/GeoTIFF Files: Earthquake_Ground_Shaking_clip.tif Size is 345, 263 Coordinate System is: GEOGCS["WGS 84", DATUM["WGS_1984", SPHEROID["WGS 84",6378137,298.2572235630016, AUTHORITY["EPSG","7030"]], AUTHORITY["EPSG","6326"]], PRIMEM["Greenwich",0], UNIT["degree",0.0174532925199433], AUTHORITY["EPSG","4326"]] Origin = (99.364169565217395,-0.004180608365019) Pixel Size = (0.008339130434783,-0.008361216730038) Metadata: AREA_OR_POINT=Point TIFFTAG_XRESOLUTION=1 TIFFTAG_YRESOLUTION=1 TIFFTAG_RESOLUTIONUNIT=1 (unitless) Image Structure Metadata: COMPRESSION=LZW INTERLEAVE=BAND Corner Coordinates: Upper Left ( 99.3641696, -0.0041806) ( 99d21'51.01"E, 0d 0'15.05"S) Lower Left ( 99.3641696, -2.2031806) ( 99d21'51.01"E, 2d12'11.45"S) Upper Right ( 102.2411696, -0.0041806) (102d14'28.21"E, 0d 0'15.05"S) Lower Right ( 102.2411696, -2.2031806) (102d14'28.21"E, 2d12'11.45"S) Center ( 100.8026696, -1.1036806) (100d48'9.61"E, 1d 6'13.25"S) Band 1 Block=256x256 Type=Float64, ColorInterp=Gray
Vector and Raster objects can be instantiated with None
Keywords can be written and read
Keywords and values with colons raise error messages
Vector and Raster instances have a similar API
Points along line are computed correctly
Bounding box minimal size can be controlled
Multipart polygons are be converted to singlepart
Raster layers with no projection causes Exception to be raised
NODATA value is correctly handled for GDAL layers
Ordering of polygon vertices is preserved when writing and reading
Polygon areas are computed correctly
Polygon centroids are computed correctly
Polygons with inner rings can be written and read
Projection information can be correctly compared
Raster extrema (including NAN’s) are correct.
Raster layers can be converted to vector point layers
Raster layers can be converted to vector point layers (real data)
# See qgis project in test data: raster_point_and_clipping_test.qgs
Consistency of rasters and associated arrays.
Rasters can be created from arrays in projected coordinates
Rasters can be read and written correctly in different formats
Vector line data can be read and written correctly
Vector point data can be read and written correctly
Vector polygon data can be read and written correctly
Consistency of vector class for point data
Admissible geometry types work in vector class
Also check that reported bounding boxes are correct
Vector extremum calculation works
Number of features read from vector data is as expected
Auxiliary function for use with raster test :param x: :param y: