コード例 #1
0
 def testConvertUtmPtToLonLatPtassert(self):
     """ConvertUtmPtToLonLatPt traps bad inputs"""
     utm = Types.structType()
     utm.X = 'abc'
     utm.Y = '4760814.7962907264'
     utm.Zone = '15'
     self.assertRaises(pyTerraError, ConvertUtmPtToLonLatPt, utm)
コード例 #2
0
 def testGetPlaceFactsequals(self):
     """GetPlaceFacts returns correct results"""
     place = Types.structType()
     place.City = 'Ames'
     place.State = 'Iowa'
     place.Country = 'United States'
     resp = GetPlaceFacts(place)
     self.assertEqual(resp.Center.Lat, '42.029998779296875')
     self.assertEqual(resp.Center.Lon, '-93.610000610351562')
コード例 #3
0
 def testConvertUtmPtToLonLatPtequals(self):
     """ConvertUtmPtToLonLatPt returns correct results"""
     utm = Types.structType()
     utm.X = '500000'
     utm.Y = '4760814.7962907264'
     utm.Zone = '15'
     resp = ConvertUtmPtToLonLatPt(utm)
     self.assertEqual(resp.Lat, '42.999999999999943')
     self.assertEqual(resp.Lon, '-92.9999999999999')
コード例 #4
0
 def testGetTileassert(self):
     """GetTile traps bad inputs"""
     id = Types.structType()
     id.X = 'abc'
     id.Y = '5951'
     id.Scene = '15'
     id.Theme = theme
     id.Scale = scale
     self.assertRaises(pyTerraError, GetTile, id)
コード例 #5
0
 def testGetAreaFromTileIdassert(self):
     """GetAreaFromTileId traps bad inputs"""
     id = Types.structType()
     id.X = 'abc'
     id.Y = '5951'
     id.scene = '15'
     id.theme = theme
     id.scale = scale
     self.assertRaises(pyTerraError, GetAreaFromTileId, id)
コード例 #6
0
ファイル: pyTerra.py プロジェクト: dortmans/PythonUtilities
 def testGetPlaceFactsequals(self):
     """GetPlaceFacts returns correct results"""
     place = Types.structType()
     place.City = 'Ames'
     place.State = 'Iowa'
     place.Country = 'United States'
     resp = GetPlaceFacts(place)
     self.assertEqual(resp.Center.Lat, '42.029998779296875')
     self.assertEqual(resp.Center.Lon, '-93.610000610351562')
コード例 #7
0
ファイル: pyTerra.py プロジェクト: dortmans/PythonUtilities
 def testConvertUtmPtToLonLatPtassert(self):
     """ConvertUtmPtToLonLatPt traps bad inputs"""
     utm = Types.structType()
     utm.X = 'abc'
     utm.Y = '4760814.7962907264'
     utm.Zone = '15'
     self.assertRaises(pyTerraError,
                       ConvertUtmPtToLonLatPt,
                       utm)
コード例 #8
0
ファイル: pyTerra.py プロジェクト: dortmans/PythonUtilities
 def testConvertUtmPtToLonLatPtequals(self):
     """ConvertUtmPtToLonLatPt returns correct results"""
     utm = Types.structType()
     utm.X = '500000'
     utm.Y = '4760814.7962907264'
     utm.Zone = '15'
     resp = ConvertUtmPtToLonLatPt(utm)
     self.assertEqual(resp.Lat, '42.999999999999943')
     self.assertEqual(resp.Lon, '-92.9999999999999')
コード例 #9
0
 def testGetTileequals(self):
     """GetTile returns correct results"""
     id = Types.structType()
     id.X = '624'
     id.Y = '5951'
     id.Scene = '15'
     id.Theme = theme
     id.Scale = scale
     resp = GetTile(id)
     self.assertEqual(len(resp), 6942)
コード例 #10
0
ファイル: pyTerra.py プロジェクト: dortmans/PythonUtilities
 def testGetTileequals(self):
     """GetTile returns correct results"""
     id = Types.structType()
     id.X = '624'
     id.Y = '5951'
     id.Scene = '15'
     id.Theme = theme
     id.Scale = scale
     resp = GetTile(id)
     self.assertEqual(len(resp), 6942)
コード例 #11
0
ファイル: pyTerra.py プロジェクト: dortmans/PythonUtilities
 def testGetTileassert(self):
     """GetTile traps bad inputs"""
     id = Types.structType()
     id.X = 'abc'
     id.Y = '5951'
     id.Scene = '15'
     id.Theme = theme
     id.Scale = scale
     self.assertRaises(pyTerraError,
                       GetTile,
                       id)
コード例 #12
0
ファイル: pyTerra.py プロジェクト: dortmans/PythonUtilities
 def testGetAreaFromTileIdequals(self):
     """GetAreaFromTileId returns correct results"""
     id = Types.structType()
     id.X = '624'
     id.Y = '5951'
     id.Scene = '15'
     id.Theme = theme
     id.Scale = scale
     resp = GetAreaFromTileId(id)
     self.assertEqual(resp.NorthWest.TileMeta.NorthWest.Lat, '43.014274597167969')
     self.assertEqual(resp.NorthWest.TileMeta.NorthWest.Lon, '-93.019638061523438')
コード例 #13
0
ファイル: pyTerra.py プロジェクト: dortmans/PythonUtilities
 def testGetAreaFromTileIdassert(self):
     """GetAreaFromTileId traps bad inputs"""
     id = Types.structType()
     id.X = 'abc'
     id.Y = '5951'
     id.scene = '15'
     id.theme = theme
     id.scale = scale
     self.assertRaises(pyTerraError,
                       GetAreaFromTileId,
                       id)
コード例 #14
0
 def testGetAreaFromTileIdequals(self):
     """GetAreaFromTileId returns correct results"""
     id = Types.structType()
     id.X = '624'
     id.Y = '5951'
     id.Scene = '15'
     id.Theme = theme
     id.Scale = scale
     resp = GetAreaFromTileId(id)
     self.assertEqual(resp.NorthWest.TileMeta.NorthWest.Lat,
                      '43.014274597167969')
     self.assertEqual(resp.NorthWest.TileMeta.NorthWest.Lon,
                      '-93.019638061523438')
コード例 #15
0
if __name__ == '__main__':

    import unittest
    import sys
    imagePresence = 'true'
    MaxItems = '10'
    placeName = 'Ames'
    theme = "Photo"
    scale = "Scale4m"
    ptype = 'CityTown'

    displayPixWidth = 200
    displayPixHeight = 200

    place = Types.structType()
    place.City = 'Ames'
    place.State = 'Iowa'
    place.Country = 'United States'

    pt = Types.structType()
    pt.Lon = -93.000
    pt.Lat = 43.000
    center = pt

    upperLeft = Types.structType()
    upperLeft.Lon = -93.000
    upperLeft.Lat = 43.000

    lowerRight = Types.structType()
    lowerRight.Lon = -92.8999
コード例 #16
0
ファイル: pyTerra.py プロジェクト: dortmans/PythonUtilities
if __name__ == '__main__':
    
    import unittest
    import sys
    imagePresence='true'
    MaxItems='10'
    placeName='Ames'
    theme = "Photo"
    scale = "Scale4m"
    ptype = 'CityTown'

    displayPixWidth = 200
    displayPixHeight = 200

    place = Types.structType()
    place.City = 'Ames'
    place.State = 'Iowa'
    place.Country = 'United States'

    pt = Types.structType()
    pt.Lon = -93.000
    pt.Lat = 43.000
    center = pt

    upperLeft = Types.structType()
    upperLeft.Lon = -93.000
    upperLeft.Lat = 43.000

    lowerRight = Types.structType()
    lowerRight.Lon = -92.8999