Exemple #1
0
def test_Geojson():
    # Data with Polygon and Point
    result = getPolygon.getPolygon("getPolygonData.geojson", file_path)
    assert result == ([(3.5595703125, 46.558860303117164),
                       (13.9306640625, 46.558860303117164),
                       (13.9306640625, 51.23440735163459),
                       (3.5595703125, 51.23440735163459)], None)
Exemple #2
0
def test_ShapeFile():
    result = getPolygon.getPolygon("POLYGON.shp", file_path)
    assert result == ([(51.94246595679555, 7.5951576232910165),
                       (51.94341833637654, 7.594213485717774),
                       (51.95341710118838, 7.606229782104492),
                       (51.95727846118796, 7.613525390624999),
                       (51.95648505819626, 7.61824607849121),
                       (51.94447651219544, 7.59953498840332)], None)
 def polyOption(path, name):
     res = poly.getPolygon(name, path)
     if res[0] is not None:
         return res[0]
     else:
         return res[1]
Exemple #4
0
def test_FalseInputFile():
    falseInput = getPolygon.getPolygon("falsetime.geojson", file_path)
    assert falseInput == (None, 'File Error!')
Exemple #5
0
def test_ErrorFile():
    errorfile = getPolygon.getPolygon("error.file", file_path)
    assert errorfile == (None, 'type .file not yet supported')
Exemple #6
0
def test_NetCdf():
    result = getPolygon.getPolygon("cami_0000-09-01_64x128_L26_c030918.nc",
                                   file_path)
    assert result == ([(0.0, -87.86379883923348), (0.0, 87.86379883923263),
                       (357.1875, 87.86379883923263),
                       (357.1875, -87.86379883923348)], None)
Exemple #7
0
def test_LineGeojson():
    result = getPolygon.getPolygon("lineString.geojson", file_path)
    assert result == ([(6.564331, 51.119041), (7.099915, 51.108696),
                       (6.995544, 51.280817)], None)