Java发布GeoServer栅格数据
SRS
tiff获取坐标信息
通过geotools读取tiff坐标信息
EPSG:4490
复制代码
1
2
3
4
5
6
7
8GEOGCS["GCS Name = GCS_China_Geodetic_Coordinate_System_2000", DATUM["Datum = China_2000", SPHEROID["Ellipsoid = CGCS2000", 6378137.0, 298.257222101]], PRIMEM["Greenwich", 0.0], UNIT["degree", 0.017453292519943295], AXIS["Geodetic longitude", EAST], AXIS["Geodetic latitude", NORTH]]
EPSG:4326
复制代码
1
2
3
4
5
6
7
8
9
10GEOGCS["WGS 84", DATUM["World Geodetic System 1984", SPHEROID["WGS 84", 6378137.0, 298.257223563, AUTHORITY["EPSG","7030"]], AUTHORITY["EPSG","6326"]], PRIMEM["Greenwich", 0.0, AUTHORITY["EPSG","8901"]], UNIT["degree", 0.017453292519943295], AXIS["Geodetic longitude", EAST], AXIS["Geodetic latitude", NORTH], AUTHORITY["EPSG","4326"]]
GeoServer-rest接口
coverages.xml
tiff文件上传创建
复制代码
1
2
3
4
5# 上传tiff后直接发布 http://192.168.1.96:8080/geoserver/rest/workspaces/zrzy_image/coveragestores/test/file.geotiff?configure=first&coverageName=test # 上传tiff后不发布,等待使用coverages.xml发布 http://192.168.1.96:8080/geoserver/rest/workspaces/zrzy_image/coveragestores/test1/file.geotiff?configure=none
复制代码
1
2
3# 上传coverages.xml来创建图层并设置属性 http://192.168.1.96:8080/geoserver/rest/workspaces/zrzy_image/coveragestores/test1/coverages.xml
后台Java使用jdom来操作xml文件,然后使用httpclient上传
当前使用xml
- 坐标系
- 输入透明颜色
复制代码
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31<coverage> <enabled>true</enabled> <metadata/> <keywords> <string>geoTiff</string> <string>WCS</string> </keywords> <metadataLinks/> <supportedFormats> <string>GEOTIFF</string> </supportedFormats> <name>test1</name> <title>test1</title> <srs>EPSG:4490</srs> <nativeFormat>GeoTIFF</nativeFormat> <nativeCRS>EPSG:4490</nativeCRS> <projectionPolicy>FORCE_DECLARED</projectionPolicy> <requestSRS> <string>EPSG:4490</string> </requestSRS> <responseSRS> <string>EPSG:4490</string> </responseSRS> <parameters> <entry> <string>InputTransparentColor</string> <string>#000000</string> </entry> </parameters> </coverage>
完整coverages.xml文件参考
github参考地址
复制代码
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155<coverage> <id>CoverageInfoImpl--4a9eec43:132d48aac79:-8000</id> <name>mosaic</name> <nativeName>mosaic</nativeName> <namespace> <id>NamespaceInfoImpl--570ae188:124761b8d78:-7ff8</id> </namespace> <title>mosaic</title> <description>Generated from ImageMosaic</description> <abstract>Italian sample mosaic</abstract> <keywords> <string>WCS</string> <string>ImageMosaic</string> <string>mosaic</string> </keywords> <nativeCRS>GEOGCS["WGS 84", DATUM["World Geodetic System 1984", SPHEROID["WGS 84", 6378137.0, 298.257223563, AUTHORITY["EPSG","7030"]], AUTHORITY["EPSG","6326"]], PRIMEM["Greenwich", 0.0, AUTHORITY["EPSG","8901"]], UNIT["degree", 0.017453292519943295], AXIS["Geodetic longitude", EAST], AXIS["Geodetic latitude", NORTH], AUTHORITY["EPSG","4326"]]</nativeCRS> <srs>EPSG:4326</srs> <nativeBoundingBox> <minx>6.346</minx> <maxx>20.83</maxx> <miny>36.492</miny> <maxy>46.591</maxy> <crs>EPSG:4326</crs> </nativeBoundingBox> <latLonBoundingBox> <minx>6.346</minx> <maxx>20.83</maxx> <miny>36.492</miny> <maxy>46.591</maxy> <crs>EPSG:4326</crs> </latLonBoundingBox> <projectionPolicy>REPROJECT_TO_DECLARED</projectionPolicy> <enabled>true</enabled> <metadata> <entry key="dirName">mosaic_mosaic</entry> </metadata> <store class="coverageStore"> <id>CoverageStoreInfoImpl--570ae188:124761b8d78:-7fd6</id> </store> <nativeFormat>ImageMosaic</nativeFormat> <grid dimension="2"> <range> <low>0 0</low> <high>250 250</high> </range> <transform> <scaleX>0.057934032977228433</scaleX> <scaleY>-0.04039598061277999</scaleY> <shearX>0.0</shearX> <shearY>0.0</shearY> <translateX>6.375141924963005</translateX> <translateY>46.570568984828704</translateY> </transform> <crs>EPSG:4326</crs> </grid> <supportedFormats> <string>GIF</string> <string>PNG</string> <string>JPEG</string> <string>TIFF</string> <string>ImageMosaic</string> <string>GEOTIFF</string> <string>ArcGrid</string> </supportedFormats> <interpolationMethods> <string>nearest neighbor</string> <string>bilinear</string> <string>bicubic</string> </interpolationMethods> <defaultInterpolationMethod>nearest neighbor</defaultInterpolationMethod> <dimensions> <coverageDimension> <name>RED_BAND</name> <description>GridSampleDimension[0.0,0.0]</description> <range> <min>0.0</min> <max>0.0</max> </range> <nullValues> <double>0.0</double> </nullValues> </coverageDimension> <coverageDimension> <name>GREEN_BAND</name> <description>GridSampleDimension[0.0,0.0]</description> <range> <min>0.0</min> <max>0.0</max> </range> <nullValues> <double>0.0</double> </nullValues> </coverageDimension> <coverageDimension> <name>BLUE_BAND</name> <description>GridSampleDimension[0.0,0.0]</description> <range> <min>0.0</min> <max>0.0</max> </range> <nullValues> <double>0.0</double> </nullValues> </coverageDimension> </dimensions> <requestSRS> <string>EPSG:4326</string> </requestSRS> <responseSRS> <string>EPSG:4326</string> </responseSRS> <parameters> <entry> <string>BackgroundValues</string> <null/> </entry> <entry> <string>Filter</string> <null/> </entry> <entry> <string>InputTransparentColor</string> <string>#000000</string> </entry> <entry> <string>SUGGESTED_TILE_SIZE</string> <string>512,512</string> </entry> <entry> <string>AllowMultithreading</string> <string>false</string> </entry> <entry> <string>MaxAllowedTiles</string> <string>-1</string> </entry> <entry> <string>OutputTransparentColor</string> <string>#000000</string> </entry> <entry> <string>USE_JAI_IMAGEREAD</string> <string>true</string> </entry> </parameters> </coverage>
最后
以上就是体贴万宝路最近收集整理的关于Java发布GeoServer栅格数据Java发布GeoServer栅格数据的全部内容,更多相关Java发布GeoServer栅格数据Java发布GeoServer栅格数据内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复