Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add geo3al dataset #364

Merged
merged 72 commits into from
Jun 25, 2021
Merged
Show file tree
Hide file tree
Changes from 71 commits
Commits
Show all changes
72 commits
Select commit Hold shift + click to select a range
fbc6e94
Add geology data
CovMat Jun 9, 2021
c992b6c
Update index.rst
CovMat Jun 10, 2021
11f2ff0
Update geo3al.rst
CovMat Jun 15, 2021
0a6e1e1
fix
CovMat Jun 16, 2021
dbfcc8b
Update geo3al.rst
CovMat Jun 16, 2021
809aebf
Apply suggestions from code review
CovMat Jun 17, 2021
a01ad25
update
CovMat Jun 18, 2021
fec8c24
Update geo3al.rst
CovMat Jun 18, 2021
53f0511
update
CovMat Jun 18, 2021
e7ca33d
Update geo3al.rst
CovMat Jun 18, 2021
5c8af40
Apply suggestions from code review
CovMat Jun 18, 2021
cee6d12
Apply suggestions from code review
CovMat Jun 18, 2021
bfcd531
Apply suggestions from code review
CovMat Jun 18, 2021
f77b46e
fix
CovMat Jun 18, 2021
903d80a
Apply suggestions from code review
CovMat Jun 18, 2021
75e1ada
Apply suggestions from code review
CovMat Jun 18, 2021
43442f0
Apply suggestions from code review
CovMat Jun 18, 2021
e51045c
Apply suggestions from code review
CovMat Jun 18, 2021
2c938be
Apply suggestions from code review
CovMat Jun 18, 2021
610a8a6
Apply suggestions from code review
CovMat Jun 18, 2021
01264c1
Apply suggestions from code review
CovMat Jun 18, 2021
1bb7d2e
Apply suggestions from code review
CovMat Jun 18, 2021
11dddf7
Apply suggestions from code review
CovMat Jun 18, 2021
01614f3
Apply suggestions from code review
CovMat Jun 18, 2021
ea8ea22
Update source/dataset-CN/geo3al/index.rst
seisman Jun 18, 2021
34d9871
Update source/dataset-CN/geo3al/index.rst
seisman Jun 18, 2021
95af4ce
Apply suggestions from code review
seisman Jun 18, 2021
2089ad4
Apply suggestions from code review
seisman Jun 18, 2021
aac1af8
Merge branch 'master' into Add_geology_data
seisman Jun 19, 2021
427eac0
fix
CovMat Jun 21, 2021
eb62fb0
Apply suggestions from code review
CovMat Jun 21, 2021
e30dcc2
Apply suggestions from code review
CovMat Jun 21, 2021
d9d1c4e
Apply suggestions from code review
CovMat Jun 21, 2021
2c017f7
Apply suggestions from code review
CovMat Jun 21, 2021
1baddc6
Apply suggestions from code review
CovMat Jun 21, 2021
2bffb21
Apply suggestions from code review
CovMat Jun 21, 2021
3f6e7db
Apply suggestions from code review
CovMat Jun 21, 2021
5453c6a
Merge branch 'master' into Add_geology_data
seisman Jun 21, 2021
971bfbd
Cache data
core-man Jun 21, 2021
77ae957
Apply suggestions from code review
core-man Jun 21, 2021
712ef9c
Disable cache data in PR
core-man Jun 21, 2021
89f8e5c
Update source/dataset-CN/geo3al/plot_geo3al.sh
seisman Jun 21, 2021
59919f0
Apply suggestions from code review
CovMat Jun 21, 2021
0e7df1b
Apply suggestions from code review
CovMat Jun 21, 2021
78ce3e2
Apply suggestions from code review
CovMat Jun 21, 2021
17852ee
Rename plot_geo3al.sh to geo3al.sh
seisman Jun 22, 2021
1d6cc30
Merge branch 'master' into Add_geology_data
core-man Jun 22, 2021
99e0365
Merge branch 'master' into Add_geology_data
seisman Jun 22, 2021
ab89c4e
Directly include code and image
seisman Jun 23, 2021
3d8bda7
Centering the image
seisman Jun 23, 2021
8a4bef5
Update the description of geo3al data
seisman Jun 23, 2021
f3fa560
Upate geo3al data description
seisman Jun 23, 2021
7b48fbe
Fix
seisman Jun 23, 2021
131c4fd
Fix
seisman Jun 23, 2021
12d3d3a
Fix
seisman Jun 23, 2021
444477f
Update plotting scripts
seisman Jun 23, 2021
e9c7cb9
fix
seisman Jun 23, 2021
b4f402b
Fix
seisman Jun 23, 2021
ebda17e
Apply suggestions from code review
CovMat Jun 24, 2021
fe6d958
Apply suggestions from code review
CovMat Jun 24, 2021
f97c568
Apply suggestions from code review
CovMat Jun 24, 2021
0456689
Apply suggestions from code review
CovMat Jun 24, 2021
cd48765
Apply suggestions from code review
CovMat Jun 24, 2021
bf14c40
Apply suggestions from code review
CovMat Jun 24, 2021
e5046d9
Fix descriptions
seisman Jun 24, 2021
2a2d2d3
Merge branch 'master' into Add_geology_data
seisman Jun 25, 2021
92a9e44
Update CPT
seisman Jun 25, 2021
24a2b9e
More fixes in geoage.cpt
seisman Jun 25, 2021
f45b531
Apply suggestions from code review
seisman Jun 25, 2021
f63e8c8
Apply suggestions from code review
seisman Jun 25, 2021
b463db6
Update source/dataset-CN/geo3al/index.rst
seisman Jun 25, 2021
73c3980
Merge branch 'master' into Add_geology_data
core-man Jun 25, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 53 additions & 0 deletions source/dataset-CN/geo3al/geo3al.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#!/usr/bin/env bash
CovMat marked this conversation as resolved.
Show resolved Hide resolved
#
# 中国及邻区地质图
#

data=geo3al.gmt
cpt=geoage.cpt

gmt begin geo3al pdf,png
# 绘制陆地为白色,即灰度 255
gmt coast -R70/150/13/55 -JM22c -G255 -Baf -BWsNe

# Plot the geological map by geologic ages
# -aZ="GEN_GLG": use the "GEN_GLG" metadata as the Z value
# -G+z -C$cpt: the fill color is determined by the Z value and the CPT file
gmt plot $data -C$cpt -aZ="GEN_GLG" -G+z

# Plot rock types using diffenrent patterns (28, 29 and 44)
# -aI="TYPE": using the "TYPE" metadata as ID
# -S"-Iv": only keep data segments that matches "-Iv" (v means "Volcanic rocks")
# -S"-Ii": only keep data segments that matches "-Ii" (i means "Intrusive rocks")
# -S"-Iw": only keep data segments that matches "-Iw" (w means "Ultrabasic igneous rock or ophiolites")
# -Gp28+r500+f100+b-: fill with pattern 28, dpi=500, foreground color=100 (gray), background color=- (transparent)
gmt convert $data -aI="TYPE" -S"-Iv" | gmt plot -Gp28+r500+f100+b-
gmt convert $data -aI="TYPE" -S"-Ii" | gmt plot -Gp29+r500+f100+b-
gmt convert $data -aI="TYPE" -S"-Iw" | gmt plot -Gp44+r500+f100+b-

# 绘制海洋或者湖泊为 CADETBLUE1 颜色
gmt coast -SCADETBLUE1
CovMat marked this conversation as resolved.
Show resolved Hide resolved

# Plot geologic age legend
gmt set FONT_ANNOT_PRIMARY 7p # font for legend labels
cat > age_legend.txt << EOF
H 10 3 Age of rock units
N 3
EOF
# Output non-empty lines that don't start with "B", "F", "N" or "#"
gawk '!/^($|B|F|N|#)/' $cpt | while read label color period
core-man marked this conversation as resolved.
Show resolved Hide resolved
seisman marked this conversation as resolved.
Show resolved Hide resolved
do
echo "S 0.3c r 0.38c $color 0.3p 0.7c $period" >> age_legend.txt
done
gmt legend age_legend.txt -DJBR+w10.5c+jTR+o0c/-2c+l1.3 -F+p0.7p+g255 -C3p/3p
rm age_legend.txt

# Plot rock type legend
gmt legend -DJBR+w5.0c+jBR+o0c/2c+l1.9 -F+p0.7p+g255 -C3p/1p <<EOF
H 10 3 Rock type
N 2
S 0.3c r 0.5c p28+r500+f100+b255 0.3p 0.7c Volcanic rocks
S 0.3c r 0.5c p29+r500+f100+b255 0.3p 0.7c Intrusive rocks
S 0.3c r 0.5c p44+r500+f100+b255 0.3p 0.7c Ultrabasic igneous rock or ophiolites
EOF
gmt end show
51 changes: 51 additions & 0 deletions source/dataset-CN/geo3al/geoage.cpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# Geological time scale categorical color scheme
core-man marked this conversation as resolved.
Show resolved Hide resolved
# Refer to GTS2012 (Gradstein et al., 2012)
#
# Mijian Xu, mailto:mijian.xu@smail.nju.edu.cn
# 17/6/2021 00:10:05 AM
#
#-----------------------------------------------------------------------------
# COLOR_MODEL = RGB

Q 255/242/186 ;Quaternary
\N 255/230/25 ;Neogene
Pg 253/154/82 ;Paleogene
T 242/249/29 ;Tertiary (undivided)
Cz 255/255/191 ;Cenozoic (undivided)
TK 242/250/140 ;Cretaceous-Tertiary
CzMz 166/216/74 ;Mesozoic-Cenozoic
K 127/198/78 ;Cretaceous
KJ 179/227/238 ;Jurassic-Cretaceous
J 52/178/201 ;Jurassic
JTr 227/185/219 ;Triassic-Jurassic
Tr 201/155/203 ;Triassic
Mz 103/197/202 ;Mesozoic (undivided)
TrP 252/192/178 ;Permian-Triassic
MzPz 251/167/148 ;Paleozoic-Mesozoic
P 240/64/40 ;Permian
PC 166/199/183 ;Carboniferous-Permian
Pzu 153/180/108 ;Upper Paleozoic
C 103/165/153 ;Carboniferous
CD 241/225/157 ;Devonian-Carboniferous
D 203/140/55 ;Devonian
DS 230/245/225 ;Silurian-Devonian
S 179/225/182 ;Silurian
SO 166/219/171 ;Ordovician-Silurian
O 0/146/112 ;Ordovician
OCm 204/235/174 ;Cambrian-Ordovician
Pzl 166/207/134 ;Lower Paleozoic
Cm 127/160/86 ;Cambrian
Pz 153/192/141 ;Paleozoic (undivided)
PtCm 254/217/106 ;Proterozoic-Cambrian
PzpCm 254/191/78 ;Precambrian-Paleozoic
Pt 247/53/99 ;Proterozoic
A 240/4/127 ;Archean
pCm 247/67/112 ;Precambrian (undivided)

oth gray ;Geology not shown
und white ;Undetermined age
H2O skyblue ;Water

B black
F white
N gray
82 changes: 82 additions & 0 deletions source/dataset-CN/geo3al/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
geo3al: 中国及邻区地质图数据
============================

core-man marked this conversation as resolved.
Show resolved Hide resolved
geo3al 数据是由 U.S. Geological Survey (USGS) 提供的中国及邻区地质图数据,
是“\ `世界地质地图 <https://certmapper.cr.usgs.gov/data/apps/world-maps/>`__\ ”的一部分,
数据分辨率为 1:5,000,000。

core-man marked this conversation as resolved.
Show resolved Hide resolved
数据文件
--------

中文社区提供了可供 GMT 直接使用的数据文件:

- :file:`geo3al.gmt`\ :中国及邻区地质图数据

数据的具体下载地址和使用方式请见:\ :doc:`/dataset-CN/index`\

数据中包含了如下非空间元信息(可以参考
`geo3al.shp.xml <https://certmapper.cr.usgs.gov/data/we/ofr97470f/spatial/shape/geo3al.shp.xml>`__
以获取元信息的更多细节):

- ``NAREA``\ :地层多边形区域的面积(单位 :math:`m^2`)
- ``PERIMETER``\ :地层多边形区域的周长(单位 m)
- ``TYPE``\ :岩性
- ``GLG``\ :原始地图上显示地表露头的地质年代
- ``GEN_GLG``\ :编者从 ``GLG`` 中计算得到的地质年代,在单元年龄跨越一个以上地质年龄的情况下用“代”表示

示例图
------

下面的示例图使用 :file:`geo3al.gmt` 数据绘制了中国大陆及邻区地质图:

- 地质年代从数据的 ``GEN_GLG`` 属性中提取,用不同的颜色表示
- 岩性从数据的 ``TYPE`` 属性中提取,用不同的填充图案表示

示例代码中使用的地质年代 CPT 色标文件 :download:`geoage.cpt`
修改自 `GTS2012_epochs <http://soliton.vm.bytemark.co.uk/pub/cpt-city/heine/GTS2012_epochs.cpt>`__\

.. literalinclude:: geo3al.sh

.. image:: https://user-images.githubusercontent.com/3974108/123166472-7376e080-d443-11eb-9289-d8913afed442.png
:width: 95%
:align: center

数据转换和处理流程
------------------

*以下内容仅供数据维护者参考,一般用户无需关心。*

1. 从 “\ `World Geologic Maps <https://certmapper.cr.usgs.gov/data/apps/world-maps/>`__\
下载 “Generalized Geology of the Far East” 对应的 Shapefile 压缩文件

2. 使用 :doc:`ogr2ogr </table/ogr2ogr>` 将 Shapefile 格式转换为 GMT 可识别的 OGR/GMT 格式::

$ ogr2ogr -t_srs EPSG:4326 -f OGR_GMT geo3al.gmt geo3al.shp

- 原始数据使用的是以米为单位的投影坐标,而非以经纬度表示的地理坐标。因而在使用
``ogr2ogr`` 时需要加上 ``-t_srs EPSG:4326`` 参数进行坐标转换
- 转换时 :file:`.dbf`\ 、\ :file:`.prj`\ 、\ :file:`.shx` 等文件必须和
:file:`shp` 文件放在同一目录下

数据转换与处理参考了如下博文:

- `Mijian Xu <https://home.xumijian.me/>`__ 的博客:
`用 GMT 绘制中国大陆及邻区地质年代图 <https://blog.xumijian.me/post/gmt-geo/>`__
- `Po-Chin Tseng <https://github.com/jimmytseng79>`__ 的
`GMT5 教程:地质图 <https://jimmytseng79.github.io/GMT5_tutorials/geology_map.html>`__

扩展阅读
--------

`World Geologic Maps <https://certmapper.cr.usgs.gov/data/apps/world-maps/>`__
提供了几乎所有区域的地质图数据。本文只提供了中国及邻区地质图(即 Generalized Geology of the Far East)。
需要绘制其他地区地质图的用户可以参考本文的数据处理方式和绘图脚本,但需要注意:

- 部分原始数据使用的是经纬度坐标,因此格式转换时不需要使用 ``-t_srs EPSG:4326``
core-man marked this conversation as resolved.
Show resolved Hide resolved
- 每个数据提供的属性可能不同,因而用户应查阅从源文件中解压得到的 ``.xml`` 文件
以了解数据提供的元信息,并相应地修改绘图脚本。

数据来源及引用
core-man marked this conversation as resolved.
Show resolved Hide resolved
--------------
seisman marked this conversation as resolved.
Show resolved Hide resolved

- Steinshouer, D.W., Qiang, J., McCabe, P.J., and Ryder, R.T, 1999, Maps showing geology, oil and gas fields, and geologic provinces of the Asia Pacific region: U.S. Geological Survey Open-File Report 97-470-F, 16 p., https://doi.org/10.3133/ofr97470F.
1 change: 1 addition & 0 deletions source/dataset-CN/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
CN-border
CN-faults
CN-block/index
geo3al/index

**下载数据**

Expand Down