├── README.md
├── public
├── logo.webp
├── favicon-64.png
├── fonts
│ ├── Ubuntu-R.woff2
│ ├── CascadiaMono.woff2
│ └── DINPro-Medium.woff2
└── favicon.svg
├── src
├── env.d.ts
├── styles
│ ├── base.css
│ └── markdown.css
├── pages
│ ├── about.astro
│ ├── 404.astro
│ ├── index.astro
│ ├── blog.astro
│ ├── blog
│ │ └── [...slug].astro
│ └── syy.astro
├── components
│ ├── mdx
│ │ └── Blockquote.astro
│ ├── icons
│ │ ├── moon.astro
│ │ ├── sun.astro
│ │ └── date.astro
│ ├── Nav.astro
│ ├── PostsMenu.astro
│ ├── PostList.astro
│ ├── Footer.astro
│ ├── CodeCopy.astro
│ ├── DoubanItem.astro
│ ├── vue
│ │ ├── TileDebug.vue
│ │ ├── TileCalc.vue
│ │ ├── StrongholdClac.vue
│ │ └── gmapstyle.vue
│ └── DarkThemeSwitch.astro
├── layouts
│ ├── MarkdownLayout.astro
│ └── BaseLayout.astro
└── content
│ ├── config.ts
│ └── blog
│ ├── pip 换源.md
│ ├── Termux 安装 Mitmproxy.md
│ ├── fx-es模拟器编译及使用.md
│ ├── 末地传送门坐标计算.mdx
│ ├── 树莓派ImmortalWrt旁路由设置.md
│ ├── 耕地等别计算.md
│ ├── 自定义谷歌XYZ瓦片地图样式.mdx
│ ├── Termux 安装 Matplotlib.md
│ ├── 瓦片计算.mdx
│ ├── Markdown基本语法.md
│ ├── 在Windows上编译Mdbtools.md
│ └── Python绘制风玫瑰图.md
├── .gitignore
├── tsconfig.json
├── tailwind.config.mjs
├── package.json
└── astro.config.mjs
/README.md:
--------------------------------------------------------------------------------
1 | # liuxs.pro
2 |
3 | My Website Build With Astro
4 |
--------------------------------------------------------------------------------
/public/logo.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/liuxspro/liuxs.pro/main/public/logo.webp
--------------------------------------------------------------------------------
/public/favicon-64.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/liuxspro/liuxs.pro/main/public/favicon-64.png
--------------------------------------------------------------------------------
/public/fonts/Ubuntu-R.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/liuxspro/liuxs.pro/main/public/fonts/Ubuntu-R.woff2
--------------------------------------------------------------------------------
/src/env.d.ts:
--------------------------------------------------------------------------------
1 | /// 我的 Astro 网站
7 |
6 | “ 7 |9 | -------------------------------------------------------------------------------- /src/pages/404.astro: -------------------------------------------------------------------------------- 1 | --- 2 | import BaseLayout from "@layouts/BaseLayout.astro"; 3 | --- 4 | 5 |8 |
11 | 表1 耕地质量等级评定自然质量参评因素及权重
46 | 47 | | 指标区因素 | 水稻权重 | 小麦权重 | 玉米权重 | 48 | | ---------------- | ---- | ---- | ---- | 49 | | 耕作层厚度 | 10.3 | 10.4 | 10.4 | 50 | | 障碍层距地表深度 | 5 | 4.8 | 4.8 | 51 | | 表层土壤质地 | 10.9 | 10.6 | 10.6 | 52 | | 土壤有机质含量 | 17.8 | 17.4 | 17.4 | 53 | | 土壤pH值 | 5.5 | 5.6 | 5.6 | 54 | | 灌溉保证率 | 22.9 | 19.8 | 19.8 | 55 | | 排水条件 | 10.4 | 12.6 | 12.6 | 56 | | 土壤盐渍化程度 | 11.8 | 12.7 | 12.7 | 57 | | 土壤侵蚀程度 | 5.4 | 6.1 | 6.1 | 58 | 59 | ### 外业调查 60 | 61 | 调查内容主要包括由农田基础条件变化引起的因素(如排水条件、灌溉保证率、有效土层厚度等)和新增耕地力因素值(如土壤有机质、pH值等)。同时根据《农用地质量分等规程》要求,评定对象是针对长期耕种、肥力相对稳定的耕地,新增耕地土壤需通过培肥措施才能达到正常种植的条件,新增耕地地力因素值部分直接引用了原地块或邻近地块的数值 62 | 63 | | 评价单元编号 | 样点面积(公顷) | 表层土壤质地 | 耕作层厚度(cm) | 障碍层距地表层深度(cm) | 灌溉保证率(%) | 排水条件 | 土壤pH值 | 土壤有机质含量(‰) | 64 | | ------------ | ---------------- | ------------ | ---------------- | ------------------------ | --------------- | -------- | -------- | ------------------- | 65 | | FXXCTXX-01 | 0.0935 | 砂壤 | 13 | 58 | 80 | 良 | 7.28 | 8.5 | 66 | -------------------------------------------------------------------------------- /src/components/DarkThemeSwitch.astro: -------------------------------------------------------------------------------- 1 | --- 2 | import IconSun from "@components/icons/sun.astro"; 3 | import IconMoon from "@components/icons/moon.astro"; 4 | --- 5 | 6 |
52 | x={{ result_xy.x }}
53 | y={{ result_xy.y }}
54 |
76 | 瓦片西北(左上)角的坐标(经度、纬度)为:
77 | {{ result_latlon.lon.toFixed(6) }}
78 | {{ result_latlon.lat.toFixed(6) }}
79 |
当前瓦片地址:
84 |{{ map_url }}
85 |选择底图
88 | 97 | 106 | 115 | 124 | 133 | 142 |
91 |
92 | ## 4. 绘制 CAD 风格风玫瑰图
93 |
94 | 我们经常见到的一直风玫瑰图是黑白相间,并且带指北箭头的(可以称之为 CAD 风格玫瑰图?),可以使用`matplotlib`的路径`Path`去绘制风玫瑰的形状及箭头,最后隐藏掉坐标轴和网格。
95 |
96 | > 关于`matplotlib`中`Path`的使用,可以参考此教程:[Path Tutorial — Matplotlib 3.7.1 documentation](https://matplotlib.org/stable/tutorials/advanced/path_tutorial.html)。
97 | > 这是翻译的版本:[路径教程 · Matplotlib 用户指南 @飞龙 (gitbooks.io)](https://wizardforcel.gitbooks.io/matplotlib-user-guide/content/3.8.html)
98 |
99 | 完整代码如下:
100 |
101 | ```python
102 | import math
103 |
104 | import matplotlib.pyplot as plt
105 | import numpy as np
106 | from matplotlib.patches import PathPatch, FancyArrowPatch
107 | from matplotlib.path import Path
108 |
109 |
110 | def create_polygons(angles: list, data: list):
111 | """创建风玫瑰黑白色填充图形"""
112 | black_vertices = []
113 | black_codes = []
114 | white_vertices = []
115 | white_codes = []
116 | for i in range(0, 16, 2):
117 | black_codes += [Path.MOVETO] + [Path.LINETO] * 2 + [Path.CLOSEPOLY]
118 | black_vertices += [(0, 0), (angles[i], data[i]), (angles[i + 1], data[i + 1]), (0, 0)]
119 |
120 | for i in range(1, 16, 2):
121 | white_codes += [Path.MOVETO] + [Path.LINETO] * 2 + [Path.CLOSEPOLY]
122 | white_vertices += [(0, 0), (angles[i], data[i]), (angles[i + 1], data[i + 1]), (0, 0)]
123 |
124 | black_path = Path(black_vertices, black_codes)
125 | white_path = Path(white_vertices, white_codes)
126 | black_pathpatch = PathPatch(black_path, facecolor='black')
127 | white_pathpatch = PathPatch(white_path, facecolor='white')
128 | return black_pathpatch, white_pathpatch
129 |
130 |
131 | def create_axis(h_start, h_end, v_start, v_end):
132 | """创建坐标轴"""
133 | arrowstyle = '-|>' # 箭头样式
134 | mutation_scale = 25 # 箭头大小
135 | linewidth = 2 # 箭头边框宽度
136 | edgecolor = 'black' # 箭头边框颜色
137 | facecolor = 'black' # 箭头填充颜色
138 |
139 | h_axis = FancyArrowPatch(
140 | h_start, # 起点坐标
141 | h_end, # 终点坐标
142 | arrowstyle=arrowstyle,
143 | mutation_scale=mutation_scale,
144 | linewidth=linewidth,
145 | edgecolor=edgecolor,
146 | facecolor=facecolor
147 | )
148 |
149 | v_axis = FancyArrowPatch(
150 | v_start, # 起点坐标
151 | v_end, # 终点坐标
152 | arrowstyle=arrowstyle,
153 | mutation_scale=mutation_scale,
154 | linewidth=linewidth,
155 | edgecolor=edgecolor,
156 | facecolor=facecolor
157 | )
158 | return h_axis, v_axis
159 |
160 |
161 | # 定义角度和风频数据
162 | deg_angles = [0, 22.5, 45, 67.5, 90, 112.5, 135, 157.5, 180, 202.5, 225, 247.5, 270, 292.5, 315, 337.5, 0]
163 | data = [6.48, 3.50, 5.89, 1.54, 7.69, 10.95, 8.77, 8.25, 7.04, 7.35, 6.98, 3.15, 1.86, 2.04, 8.07, 10.43, 6.48]
164 | max_data = math.ceil(max(data))
165 | angles = np.deg2rad(deg_angles)
166 | labels = ['N', 'NNE', 'NE', 'ENE', 'E', 'ESE', 'SE', 'SSE', 'S', 'SSW', 'SW', 'WSW', 'W', 'WNW', 'NW', 'NNW', 'N']
167 |
168 | # Create the plot
169 | fig = plt.figure(figsize=(8, 8))
170 | ax1 = fig.add_subplot(121, polar=True)
171 | ax2 = fig.add_subplot(122, polar=True)
172 |
173 | # 设置theta的零的位置为正北。
174 | # https://matplotlib.org/stable/api/projections/polar.html#matplotlib.projections.polar.PolarAxes.set_theta_zero_location
175 | ax1.set_theta_zero_location('N')
176 | # 设置角度增加的方向为逆时针
177 | ax1.set_theta_direction(-1)
178 |
179 | # 设置标题
180 | # ax.set_title('Windrose', fontsize=14)
181 | # 设置X轴
182 | ax1.set_xticks(angles)
183 | ax1.set_xticklabels(labels, fontsize=22, fontname="Times New Roman")
184 | ax1.tick_params(axis='x', which='major', pad=18)
185 | # 设置Y轴
186 | ax1.set_yticks([4, 6, 8, 10, 12])
187 | ax1.set_ylim(0, max_data + 2)
188 | ax1.set_yticklabels(['4%', '6%', '8%', '10%', '12%'])
189 | # 设置网格
190 | ax1.xaxis.grid(color='gray', linestyle='-', linewidth=1)
191 | ax1.yaxis.grid(color='gray', linestyle='--', linewidth=1)
192 | # ax.grid(True)
193 |
194 | black, white = create_polygons(angles, data)
195 |
196 | h_axis, v_axis = create_axis(
197 | (angles[8], max_data + 1), (angles[0], max_data + 1),
198 | (angles[12], max_data + 1), (angles[4], max_data + 1)
199 | )
200 |
201 | ax1.plot(angles, data, '.-', linewidth=1, color="blue")
202 | ax1.fill(angles, data, alpha=0.3, color='blue', )
203 |
204 | # CAD风格风玫瑰图
205 | ax2.set_theta_zero_location('N')
206 | ax2.set_theta_direction(-1)
207 |
208 | ax2.set_xticks(angles)
209 | ax2.set_ylim(0, max_data + 2)
210 | ax2.add_patch(black)
211 | ax2.add_patch(white)
212 | ax2.add_patch(h_axis)
213 | ax2.add_patch(v_axis)
214 | ax2.text(angles[0] + 0.1, max_data + 0.5, "N", ha="center", va="center", fontsize=22)
215 | ax2.grid(False)
216 | ax2.set_axis_off()
217 |
218 | plt.show()
219 |
220 | ```
221 |
222 | 
223 |
224 | [^1]: [风玫瑰图 - 维基百科,自由的百科全书 (wikipedia.org)](https://zh.wikipedia.org/wiki/%E9%A3%8E%E7%8E%AB%E7%91%B0%E5%9B%BE)
225 | [^2]: [matplotlib.projections.polar — Matplotlib 3.7.1 documentation](https://matplotlib.org/stable/api/projections/polar.html#matplotlib.projections.polar.PolarAxes.set_theta_zero_location)
226 |
--------------------------------------------------------------------------------