楼主: ReneeBK
1544 3

[Github]ArcPy and ArcGIS Second Edition by Packt [推广有奖]

  • 1关注
  • 62粉丝

VIP

已卖:4901份资源

学术权威

14%

还不是VIP/贵宾

-

TA的文库  其他...

R资源总汇

Panel Data Analysis

Experimental Design

威望
1
论坛币
49675 个
通用积分
56.1287
学术水平
370 点
热心指数
273 点
信用等级
335 点
经验
57805 点
帖子
4005
精华
21
在线时间
582 小时
注册时间
2005-5-8
最后登录
2023-11-26

楼主
ReneeBK 发表于 2017-7-7 04:26:26 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

求职就业群
赵安豆老师微信:zhaoandou666

经管之家联合CDA

送您一个全额奖学金名额~ !

感谢您参与论坛问题回答

经管之家送您两个论坛币!

+2 论坛币


本帖隐藏的内容

ArcPy-and-ArcGIS-Second-Edition-master.zip (366.88 KB)


二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

关键词:Edition Second GitHub editio dition

已有 1 人评分经验 学术水平 热心指数 信用等级 收起 理由
nuomin + 60 + 1 + 1 + 1 奖励积极上传好的资料

总评分: 经验 + 60  学术水平 + 1  热心指数 + 1  信用等级 + 1   查看全部评分

本帖被以下文库推荐

沙发
ReneeBK 发表于 2017-7-7 04:27:18
  1. # -*- coding: utf-8 -*-
  2. # ---------------------------------------------------------------------------
  3. # Chapter2Model1.py
  4. # Created on: 2017-01-26 04:26:31.00000
  5. #   (generated by ArcGIS/ModelBuilder)
  6. # Description:
  7. # ---------------------------------------------------------------------------

  8. #Import libraries
  9. import arcpy
  10. import csv

  11. # if uncommented, the next line allows for overwriting existing files with output. Be careful!
  12. arcpy.env.overwriteOutput = True   

  13. # Local variables:
  14. Bus_Stops = r"C:\Projects\SanFrancisco.gdb\SanFrancisco\Bus_Stops"
  15. CensusBlocks2010 = r"C:\Projects\SanFrancisco.gdb\SanFrancisco\CensusBlocks2010"
  16. Inbound71 = r"C:\Projects\SanFrancisco.gdb\Chapter2Results\Inbound71"
  17. Inbound71_400ft_buffer = r"C:\Projects\SanFrancisco.gdb\Chapter2Results\Inbound71_400ft_buffer"
  18. Intersect71Census = r"C:\Projects\SanFrancisco.gdb\Chapter2Results\Intersect71Census"

  19. # Process: Select
  20. arcpy.Select_analysis(Bus_Stops,
  21.                       Inbound71,
  22.                       "NAME = '71 IB' AND BUS_SIGNAG = 'Ferry Plaza'")

  23. # Process: Buffer
  24. arcpy.Buffer_analysis(Inbound71,
  25.                       Inbound71_400ft_buffer,
  26.                       "400 Feet", "FULL", "ROUND", "NONE", "")

  27. # Process: Intersect
  28. arcpy.Intersect_analysis([Inbound71_400ft_buffer,CensusBlocks2010],
  29.                          Intersect71Census, "ALL", "", "INPUT")

  30. # Organize the census block population using a dictionary
  31. # The stop ID is the key and the census block populations are added to a list as the value
  32. dataDictionary = {}
  33. with arcpy.da.SearchCursor(Intersect71Census, ["STOPID","POP10"]) as cursor:
  34.     for row in cursor:
  35.         busStopID = row[0]
  36.         pop10 = row[1]
  37.         if busStopID not in dataDictionary.keys():
  38.             dataDictionary[busStopID] = [pop10]
  39.         else:
  40.             dataDictionary[busStopID].append(pop10)

  41. #Create an output CSV spreadsheet. Check the folder path to be sure it's legal
  42. with open(r'C:\Projects\Averages.csv', 'wb') as csvfile:
  43.     csvwriter = csv.writer(csvfile, delimiter=',')
  44.     for busStopID in dataDictionary.keys():
  45.         popList = dataDictionary[busStopID]
  46.         averagePop = sum(popList)/len(popList)
  47.         data = [busStopID, averagePop]
  48.         csvwriter.writerow(data)

  49. print "Data Analysis Complete"
复制代码

藤椅
hjtoh 发表于 2017-7-7 06:11:16 来自手机
ReneeBK 发表于 2017-7-7 04:26
**** 本内容被作者隐藏 ****
谢谢分享

板凳
kaiwu 发表于 2017-7-14 17:55:43
thanks a lot

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注jltj
拉您入交流群
GMT+8, 2026-1-29 21:53