91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小:
    文件類型: .zip
    金幣: 2
    下載: 1 次
    發布日期: 2021-07-09
  • 語言: Python
  • 標簽: python??GIS??

資源簡介

資源截圖

代碼片段和文件信息

“““SimpleGIS.py?-?A?Simple?GIS“““

import?turtle?as?t

#?DATA?MODEL
#?All?layers?will?have?a?name?1+?points?and?population?count
NAME?=?0
POINTS?=?1
POP?=?2

#?Create?the?state?layer
state?=?[“COLORADO“?[[-109?37]?[-109?41]?[-102?41]?[-102?37]]?5187582]

#?Cities?layer?list
#?city?=?[name?[point]?population]
cities?=?[]

#?Add?Denver
cities.append([“DENVER“?[-104.98?39.74]?634265])
#?Add?Boulder
cities.append([“BOULDER“?[-105.27?40.02]?98889])
#?Add?Durango
cities.append([“DURANGO“?[-107.88?37.28]?17069])

#?MAP?GRAPHICS?RENDERING
map_width?=?800
map_height?=?500

#?State?Bounding?Box
#?Use?Python?min/max?function?to?get?bounding?box
minx?=?180
maxx?=?-180
miny?=?90
maxy?=?-90
for?x?y?in?state[POINTS]:
????if?x?????????minx?=?x
????elif?x?>?maxx:
????????maxx?=?x
????if?y?????????miny?=?y
????elif?y?>?maxy:
????????maxy?=?y

#?Get?earth?distance?on?each?axis
dist_x?=?maxx?-?minx
dist_y?=?maxy?-?miny

#?Scaling?ratio?each?axis
#?to?map?points?from?world?to?screen
x_ratio?=?map_width?/?dist_x
y_ratio?=?map_height?/?dist_y


def?convert(point):
????“““Convert?lat/lon?to?screen?coordinates“““
????lon?=?point[0]
????lat?=?point[1]
????x?=?map_width?-?((maxx?-?lon)?*?x_ratio)
????y?=?map_height?-?((maxy?-?lat)?*?y_ratio)
????#?Python?turtle?graphics?start?in?the?middle?of?the?screen
????#?so?we?must?offset?the?points?so?they?are?centered
????x?=?x?-?(map_width/2)
????y?=?y?-?(map_height/2)
????return?[x?y]

#?Add?a?title?to?the?window
wn?=?t.Screen()
wn.title(“Simple?GIS“)

#?Draw?the?state
t.up()
first_pixel?=?None

for?point?in?state[POINTS]:
????pixel?=?convert(point)
????if?not?first_pixel:
????????first_pixel?=?pixel
????t.goto(pixel)
????t.down()
#?Go?back?to?the?first?point
t.goto(first_pixel)
#?Label?the?state
t.up()
t.goto([0?0])
t.write(state[NAME]?align=“center“?font=(“Arial“?16?“bold“))

#?Draw?the?cities
for?city?in?cities:
????pixel?=?convert(city[POINTS])
????t.up()
????t.goto(pixel)
????#?Place?a?point?for?the?city
????t.dot(10)
????#?Label?the?city
????t.write(city[NAME]?+?“?Pop.:?“?+?str(city[POP])?align=“left“)
????t.up()

#?Perform?an?attribute?query
#?Question:?Which?city?has?the?largest?population?
#?Write?the?result?but?make?sure?it‘s?under?the?map
biggest_city?=?max(cities?key=lambda?city:?city[POP])
t.goto(0?-1*((map_height/2)+20))
t.write(“The?highest-populated?city?is:?“?+?biggest_city[NAME])

#?Perform?a?spatial?query
#?Question:?Which?is?the?western?most?city?
#?Write?the?result?but?make?sure?it‘s?under?the?other?question
western_city?=?min(cities?key=lambda?city:?city[POINTS])
t.goto(0?-1*((map_height/2)+40))
t.write(“The?western-most?city?is:?“?+?western_city[NAME])

#?Hide?our?map?pen
t.pen(shown=False)
t.done()

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2019-07-18?09:28??Python地理空間分析指南(第2版)源代碼\
?????目錄???????????0??2019-07-18?09:28??Python地理空間分析指南(第2版)源代碼\B04606_01_Code\
?????文件????????2852??2015-02-24?17:24??Python地理空間分析指南(第2版)源代碼\B04606_01_Code\B04606_01_01_SimpleGIS.py
?????目錄???????????0??2019-07-18?09:28??Python地理空間分析指南(第2版)源代碼\B04606_02_Code\
?????文件?????????665??2015-02-25?05:17??Python地理空間分析指南(第2版)源代碼\B04606_02_Code\B04606_02_01_structDemo.py
?????文件????????5015??2015-04-24?05:33??Python地理空間分析指南(第2版)源代碼\B04606_02_Code\B04606_02_02_fmtDecode.py
?????文件?????????360??2015-04-23?12:12??Python地理空間分析指南(第2版)源代碼\B04606_02_Code\B04606_02_03_GeoJSON.py
?????目錄???????????0??2019-07-18?09:28??Python地理空間分析指南(第2版)源代碼\B04606_04_Code\
?????文件?????????168??2015-06-01?06:03??Python地理空間分析指南(第2版)源代碼\B04606_04_Code\B04606_04_01-site-packages.py
?????文件?????????236??2015-06-02?05:50??Python地理空間分析指南(第2版)源代碼\B04606_04_Code\B04606_04_02-urlretrieve.py
?????文件?????????379??2015-06-02?06:31??Python地理空間分析指南(第2版)源代碼\B04606_04_Code\B04606_04_03-earthquake-data.py
?????文件?????????402??2015-06-01?06:03??Python地理空間分析指南(第2版)源代碼\B04606_04_Code\B04606_04_04-ftp.py
?????文件?????????434??2015-06-01?07:13??Python地理空間分析指南(第2版)源代碼\B04606_04_Code\B04606_04_05-ftp-url.py
?????文件?????????488??2015-06-02?05:50??Python地理空間分析指南(第2版)源代碼\B04606_04_Code\B04606_04_06-zipfile.py
?????文件?????????321??2015-06-02?05:50??Python地理空間分析指南(第2版)源代碼\B04606_04_Code\B04606_04_07-zipfile-loop.py
?????文件?????????258??2015-06-02?05:49??Python地理空間分析指南(第2版)源代碼\B04606_04_Code\B04606_04_08-tarfile-create.py
?????文件?????????218??2015-06-02?05:49??Python地理空間分析指南(第2版)源代碼\B04606_04_Code\B04606_04_09-tarfile-extract.py
?????文件?????????465??2015-06-02?05:48??Python地理空間分析指南(第2版)源代碼\B04606_04_Code\B04606_04_10-cloud-zipfile.py
?????文件?????????736??2015-06-02?05:47??Python地理空間分析指南(第2版)源代碼\B04606_04_Code\B04606_04_11-kml-minidom.py
?????文件?????????372??2015-06-02?06:55??Python地理空間分析指南(第2版)源代碼\B04606_04_Code\B04606_04_12-kml-etree.py
?????文件?????????488??2015-06-02?05:45??Python地理空間分析指南(第2版)源代碼\B04606_04_Code\B04606_04_13-make-kml-strings.py
?????文件?????????693??2015-06-02?06:56??Python地理空間分析指南(第2版)源代碼\B04606_04_Code\B04606_04_14-make-kml-etree.py
?????文件?????????482??2015-06-02?05:38??Python地理空間分析指南(第2版)源代碼\B04606_04_Code\B04606_04_15-gpx-soup.py
?????文件?????????160??2015-06-01?06:03??Python地理空間分析指南(第2版)源代碼\B04606_04_Code\B04606_04_16-shapely-wkt.py
?????文件?????????418??2015-06-02?00:09??Python地理空間分析指南(第2版)源代碼\B04606_04_Code\B04606_04_17-ogr-wkt.py
?????文件?????????556??2015-06-01?06:51??Python地理空間分析指南(第2版)源代碼\B04606_04_Code\B04606_04_18-json.py
?????文件?????????257??2015-06-01?06:24??Python地理空間分析指南(第2版)源代碼\B04606_04_Code\B04606_04_19-geojson.py
?????文件?????????374??2015-06-02?05:37??Python地理空間分析指南(第2版)源代碼\B04606_04_Code\B04606_04_20-ogr.py
?????文件?????????286??2015-06-02?05:37??Python地理空間分析指南(第2版)源代碼\B04606_04_Code\B04606_04_21-pyshp.py
?????文件?????????337??2015-06-02?05:36??Python地理空間分析指南(第2版)源代碼\B04606_04_Code\B04606_04_22-dbfpy.py
?????文件?????????202??2015-06-01?06:03??Python地理空間分析指南(第2版)源代碼\B04606_04_Code\B04606_04_23-shapely.py
............此處省略72個文件信息

評論

共有 條評論