本文整理汇总了Python中treemap.models.Plot.zipcode方法的典型用法代码示例。如果您正苦于以下问题:Python Plot.zipcode方法的具体用法?Python Plot.zipcode怎么用?Python Plot.zipcode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类treemap.models.Plot
的用法示例。
在下文中一共展示了Plot.zipcode方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: handle_row
# 需要导入模块: from treemap.models import Plot [as 别名]
# 或者: from treemap.models.Plot import zipcode [as 别名]
#.........这里部分代码省略.........
plot.owner_orig_id = row['ID']
if row.get('ORIGID'):
plot.owner_additional_properties = "ORIGID=" + str(row['ORIGID'])
if row.get('OWNER_ADDITIONAL_PROPERTIES'):
plot.owner_additional_properties = str(plot.owner_additional_properties) + " " + str(row['OWNER_ADDITIONAL_PROPERTIES'])
if row.get('OWNER_ADDITIONAL_ID'):
plot.owner_additional_id = str(row['OWNER_ADDITIONAL_ID'])
if row.get('POWERLINE'):
for k, v in choices['powerlines']:
if v == row['POWERLINE']:
plot.powerline_conflict_potential = k
break;
sidewalk_damage = row.get('SIDEWALK')
if sidewalk_damage is None or sidewalk_damage.strip() == "":
pass
elif sidewalk_damage is True or sidewalk_damage.lower() == "true" or sidewalk_damage.lower() == 'yes':
plot.sidewalk_damage = 2
else:
plot.sidewalk_damage = 1
plot.quick_save()
pnt = plot.geometry
n = Neighborhood.objects.filter(geometry__contains=pnt)
z = ZipCode.objects.filter(geometry__contains=pnt)
plot.neighborhoods = ""
plot.neighborhood.clear()
plot.zipcode = None
if n:
for nhood in n:
if nhood:
plot.neighborhoods = plot.neighborhoods + " " + nhood.id.__str__()
plot.neighborhood.add(nhood)
if z: plot.zipcode = z[0]
plot.quick_save()
if tree:
tree.plot = plot
tree.readonly = self.readonly
tree.import_event = self.import_event
tree.last_updated_by = self.updater
if row.get('OWNER'):
tree.tree_owner = str(row["OWNER"])
if row.get('STEWARD'):
tree.steward_name = str(row["STEWARD"])
if row.get('SPONSOR'):
tree.sponsor = str(row["SPONSOR"])
if row.get('DATEPLANTED'):
date_string = str(row['DATEPLANTED'])
try:
date = datetime.strptime(date_string, "%m/%d/%Y")
except:
pass
示例2: handle_row
# 需要导入模块: from treemap.models import Plot [as 别名]
# 或者: from treemap.models.Plot import zipcode [as 别名]
#.........这里部分代码省略.........
if row.get("ORIGID"):
plot.owner_additional_properties = "ORIGID=" + str(row["ORIGID"])
if row.get("OWNER_ADDITIONAL_PROPERTIES"):
plot.owner_additional_properties = (
str(plot.owner_additional_properties) + " " + str(row["OWNER_ADDITIONAL_PROPERTIES"])
)
if row.get("OWNER_ADDITIONAL_ID"):
plot.owner_additional_id = str(row["OWNER_ADDITIONAL_ID"])
if row.get("POWERLINE"):
for k, v in choices["powerlines"]:
if v == row["POWERLINE"]:
plot.powerline = k
break
sidewalk_damage = row.get("SIDEWALK")
if sidewalk_damage is None or sidewalk_damage.strip() == "":
pass
elif sidewalk_damage is True or sidewalk_damage.lower() == "true" or sidewalk_damage.lower() == "yes":
plot.sidewalk_damage = 2
else:
plot.sidewalk_damage = 1
plot.quick_save()
pnt = plot.geometry
n = Neighborhood.objects.filter(geometry__contains=pnt)
z = ZipCode.objects.filter(geometry__contains=pnt)
plot.neighborhoods = ""
plot.neighborhood.clear()
plot.zipcode = None
if n:
for nhood in n:
if nhood:
plot.neighborhoods = plot.neighborhoods + " " + nhood.id.__str__()
plot.neighborhood.add(nhood)
if z:
plot.zipcode = z[0]
plot.quick_save()
if tree:
tree.plot = plot
tree.readonly = self.readonly
tree.import_event = self.import_event
tree.last_updated_by = self.updater
if row.get("OWNER"):
tree.tree_owner = str(row["OWNER"])
if row.get("STEWARD"):
tree.steward_name = str(row["STEWARD"])
if row.get("SPONSOR"):
tree.sponsor = str(row["SPONSOR"])
if row.get("DATEPLANTED"):
date_string = str(row["DATEPLANTED"])
try:
date = datetime.strptime(date_string, "%m/%d/%Y")
except: