試用 GeoServer - 加入香港海拔數據
先匯入到存儲,再加入到圖層區,再利用 SLD 將 Raster 數據轉換成等高線數據,在圖層區輸出,要注意的是此功能需要比較多記憶體容量,在啟動 Java 前先將相關的設定調高:
SLD 內容:
<?xml version="1.0" encoding="ISO-8859-1"?> <StyledLayerDescriptor version="1.0.0" xsi:schemaLocation="http://www.opengis.net/sld StyledLayerDescriptor.xsd" xmlns="http://www.opengis.net/sld" xmlns:ogc="http://www.opengis.net/ogc" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <NamedLayer> <Name>contour_dem</Name> <UserStyle> <Title>Contour DEM</Title> <Abstract>Extracts contours from DEM</Abstract> <FeatureTypeStyle> <Transformation> <ogc:Function name="gs:Contour"> <ogc:Function name="parameter"> <ogc:Literal>data</ogc:Literal> </ogc:Function> <ogc:Function name="parameter"> <ogc:Literal>levels</ogc:Literal> <ogc:Literal>50</ogc:Literal> <ogc:Literal>100</ogc:Literal> <ogc:Literal>150</ogc:Literal> <ogc:Literal>200</ogc:Literal> <ogc:Literal>250</ogc:Literal> <ogc:Literal>300</ogc:Literal> <ogc:Literal>350</ogc:Literal> <ogc:Literal>400</ogc:Literal> <ogc:Literal>450</ogc:Literal> <ogc:Literal>500</ogc:Literal> <ogc:Literal>550</ogc:Literal> <ogc:Literal>600</ogc:Literal> <ogc:Literal>650</ogc:Literal> <ogc:Literal>700</ogc:Literal> <ogc:Literal>750</ogc:Literal> <ogc:Literal>800</ogc:Literal> <ogc:Literal>850</ogc:Literal> <ogc:Literal>950</ogc:Literal> <ogc:Literal>1000</ogc:Literal> </ogc:Function> <ogc:Function name="parameter"> <ogc:Literal>interval</ogc:Literal> <ogc:Literal>50</ogc:Literal> </ogc:Function> </ogc:Function> </Transformation> <Rule> <Name>rule1</Name> <Title>Contour Line</Title> <LineSymbolizer> <Stroke> <CssParameter name="stroke">#000000</CssParameter> <CssParameter name="stroke-width">1</CssParameter> </Stroke> </LineSymbolizer> <TextSymbolizer> <Label> <ogc:PropertyName>value</ogc:PropertyName> </Label> <Font> <CssParameter name="font-family">Arial</CssParameter> <CssParameter name="font-style">Normal</CssParameter> <CssParameter name="font-size">10</CssParameter> </Font> <LabelPlacement> <LinePlacement/> </LabelPlacement> <Halo> <Radius> <ogc:Literal>2</ogc:Literal> </Radius> <Fill> <CssParameter name="fill">#FFFFFF</CssParameter> <CssParameter name="fill-opacity">0.6</CssParameter> </Fill> </Halo> <Fill> <CssParameter name="fill">#000000</CssParameter> </Fill> <Priority>2000</Priority> <VendorOption name="followLine">true</VendorOption> <VendorOption name="repeat">100</VendorOption> <VendorOption name="maxDisplacement">50</VendorOption> <VendorOption name="maxAngleDelta">30</VendorOption> </TextSymbolizer> </Rule> </FeatureTypeStyle> </UserStyle> </NamedLayer> </StyledLayerDescriptor>
結果如下:
參考連結:
GeoServer Docs - Rendering Transformations
OpenGeo Suite Library - Creating a contour map with a WPS process
內部連結:
【目錄】地理/地理資訊系統/空間資料庫/大地測量內部連結
本文連結