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)
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')
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')
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)
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)
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)
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')
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
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