本文整理汇总了Python中Map.Map.addPOIGroupAndLayer方法的典型用法代码示例。如果您正苦于以下问题:Python Map.addPOIGroupAndLayer方法的具体用法?Python Map.addPOIGroupAndLayer怎么用?Python Map.addPOIGroupAndLayer使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Map.Map
的用法示例。
在下文中一共展示了Map.addPOIGroupAndLayer方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: testSimple
# 需要导入模块: from Map import Map [as 别名]
# 或者: from Map.Map import addPOIGroupAndLayer [as 别名]
def testSimple(self):
map = Map(MapDirectory(self.testdatadir), maptype=MapTypeImage)
map.open("a")
map.addPOIGroupAndLayer()
poigroup = map.getPOIGroup()
cat = POICategory("Aerials")
cat.addField("POI Name")
subcat = cat.addSubCategory(POISubCategory("NOSUB1000"))
expected = [cat]
poigroup.addCategory(cat)
# cat.addField
actual = poigroup.getCategories()
if actual != expected:
print "actual:", actual
print "expected:", expected
self.assertEqual(actual, expected)
# Close map and try it to open it again
map.close()
map = Map()
map = createMap(self.testdatadir)
map.open()
poigroup = map.getPOIGroup()
poigroup.open("r")
catman = poigroup.getCategoryManager()
print catman.getCategories()
self.assertTrue("Aerials" in [cat.getName() for cat in catman.getCategories()])
actual = poigroup.getCategories()
if actual != expected:
print "actual:", actual
print "expected:", expected
self.assertEqual(actual, expected, "categories were not read back correctly")