Commit 360834e
committed
[Minor] Improving the way to read
> 改进从 INI 中读取 `.shp` 文件名的方式
The original processing method would check if there is a file extension.
If not, it would automatically add the `.shp` extension to read. This is
a good safeguard, but there are two problems:
> 原先的处理方式会检查是否有后缀名,如果没有,那么会自动补上 `.shp` 后缀来读取,这是一个不错的保障手段,但是存在两个问题:
1. It only strictly checks for lowercase `.shp`, meaning that
`RING1.SHP` would be considered as *having **no** extension*, so it
would automatically add to become `RING1.SHP.shp` for reading.
> 只严格检查小写 `.shp`,也就是说 `RING1.SHP` 会被视为 **没有** 后缀,因此自动补充为 `RING1.SHP.shp`
来读取,
2. It does not strictly check whether it is an extension, meaning that
`.shp.RING2` would be considered as *having **an** extension*, so it
would not add, and actually try to read a file named `.shp.RING2`,
rather than `.shp.RING2.shp`.
> 不严格检查是否为后缀,也就是说 `.shp.RING2` 会被视为 **已有** 后缀,不会补充,并真的去读取名为 `.shp.RING2`
的文件,而不是 `.shp.RING2.shp`。
Now, some improvements have been made so that uppercase `.SHP` is
***not*** considered as *having **no** extension*, and at the same time,
cases where `.shp` is not at the end are ***no longer*** considered as
*having **an** extension*.
> 现在对它们进行了一些改进,使得大写 `.SHP` **不会** 被视为 **没有** 后缀,同时 **不再** 将 `.shp`
不在末尾的情况视为 **已有** 后缀。
Expected effect of the current changes (`PDFXLOC` (red) as the original
incorrect effect, `RING1` (blue) as the expected correct effect):
> 当前更改的预期效果(`PDFXLOC`(红)作为原始的错误效果,`RING1`(蓝)作为预期的正确效果):
<img width="736" height="613" alt="RING1 SHP"
src="https://github.com/user-attachments/assets/470f5dd2-8290-45bc-8966-2ce436ebe20b"
/>
<img width="736" height="613" alt="RING2 shp A"
src="https://github.com/user-attachments/assets/fb54ce79-d725-4306-bc97-59ad72e8e2af"
/>
- [x] Test has passed.
> 测试通过。.shp file names from INI (#1852)1 parent 5d943fd commit 360834e
File tree
4 files changed
+4
-2
lines changed- docs
- src/Utilities
4 files changed
+4
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
485 | 485 | | |
486 | 486 | | |
487 | 487 | | |
| 488 | + | |
488 | 489 | | |
489 | 490 | | |
490 | 491 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
673 | 673 | | |
674 | 674 | | |
675 | 675 | | |
| 676 | + | |
676 | 677 | | |
677 | 678 | | |
678 | 679 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
261 | 261 | | |
262 | 262 | | |
263 | 263 | | |
264 | | - | |
| 264 | + | |
265 | 265 | | |
266 | 266 | | |
267 | 267 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
335 | 335 | | |
336 | 336 | | |
337 | 337 | | |
338 | | - | |
| 338 | + | |
339 | 339 | | |
340 | 340 | | |
341 | 341 | | |
| |||
0 commit comments