Last active
May 29, 2020 11:07
-
-
Save salgo60/4db238c9e9839fab31feb1d865fb49c7 to your computer and use it in GitHub Desktop.
Read glacier info see https://phabricator.wikimedia.org/T236131 GSD-Fjällinformation, vektor https://www.lantmateriet.se/sv/Kartor-och-geografisk-information/geodataprodukter/produktlista/fjallinformation/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://phabricator.wikimedia.org/T236131#6175780 | |
# GSD-Fjällinformation, vektor https://www.lantmateriet.se/sv/Kartor-och-geografisk-information/geodataprodukter/produktlista/fjallinformation/ | |
import geopandas as gpd | |
import pprint | |
data = gpd.read_file("/Users/magnus/Documents/GitHub/SwedishGlaciers/data/fj_riks_Sweref_99_TM_shape/vagk/riks/zg_riks.shp").set_geometry('geometry') | |
print(data.head()) | |
print(data.info()) | |
gl = data[data["KKOD"]>171] | |
gl.to_crs({'init': 'EPSG:3006'}) | |
print(gl) | |
print(gl.head()) | |
print(gl.info()) | |
for index,row in gl.iterrows(): | |
pprint.pprint(row) | |
print(row['TEXT'], row['KKOD'], row['KATEGORI'], row['TJUST'], row['TSPARR'],row['TRIKT'],row['geometry'], | |
"\n\tLength: ",row['geometry'].length, | |
"\n\tArea: ",row['geometry'].area/10**6, | |
"\n\tBounds: ",row['geometry'].bounds, | |
"\n\tCentroid: ",row['geometry'].centroid, | |
"\n\tGeom type: ",row['geometry'].geom_type, | |
"\n") | |
#gl.plot(cmap='OrRd') | |
#gl.plot(facecolor="none", edgecolor="black") | |
import matplotlib.pyplot as plt | |
plt.show() |
Author
salgo60
commented
May 29, 2020
•
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment