GeoServer中使用SLD表现伪3D建筑

[url=http://mapping-malaysia.blogspot.com/2010/07/pseudo-3d-buildings-in-geoserver.html]原文链接:pseudo-3D buildings in Geoserver[/url]
[color=green]Pseudo-3D or 2.5D or 3/4 perspective can be done in Geoserver using isometric function. [/color]
[img]http://dl.iteye.com/upload/attachment/0073/0073/00ad3652-4d8c-3624-bdf0-933d6f8519c7.png[/img]

<FeatureTypeStyle>
<Rule>
<PolygonSymbolizer>
<Geometry>
<ogc:Function name="isometric">
<ogc:PropertyName>geom</ogc:PropertyName>
<ogc:Literal>7</ogc:Literal>
</ogc:Function>
</Geometry>
<Fill>
<CssParameter name="fill">#dddddd</CssParameter>
</Fill>
<Stroke>
<CssParameter name="stroke">#999999</CssParameter>
</Stroke>
</PolygonSymbolizer>
</Rule>
</FeatureTypeStyle>

[color=green]房顶的样式[/color]


<FeatureTypeStyle>
<Rule>
<PolygonSymbolizer>
<Geometry>
<ogc:Function name="offset">
<ogc:PropertyName>geom</ogc:PropertyName>
<ogc:Literal>0</ogc:Literal>
<ogc:Literal>7</ogc:Literal>
</ogc:Function>
</Geometry>
<Fill>
<CssParameter name="fill">#FFDCC7</CssParameter>
</Fill>
<Stroke>
<CssParameter name="stroke">#999999</CssParameter>
</Stroke>
</PolygonSymbolizer>
</Rule>
</FeatureTypeStyle>

[color=green]完整的例子[/color]

<?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">
<!-- a Named Layer is the basic building block of an SLD document -->
<NamedLayer>
<Name>default_polygon</Name>
<UserStyle>
<!-- Styles can have names, titles and abstracts -->
<Title>Default Polygon</Title>
<Abstract>A sample style that draws a polygon</Abstract>
<!-- FeatureTypeStyles describe how to render different features -->
<!-- A FeatureTypeStyle for rendering polygons -->
<FeatureTypeStyle>
<Rule>
<PolygonSymbolizer>
<Geometry>
<ogc:Function name="isometric">
<ogc:PropertyName>the_geom</ogc:PropertyName>
<ogc:Literal>5</ogc:Literal>
</ogc:Function>
</Geometry>
<Fill>
<CssParameter name="fill">#dddddd</CssParameter>
</Fill>
<Stroke>
<CssParameter name="stroke">#999999</CssParameter>
<CssParameter name="stroke-width">0.1</CssParameter>
</Stroke>
</PolygonSymbolizer>
</Rule>
</FeatureTypeStyle>
<FeatureTypeStyle>
<Rule>
<PolygonSymbolizer>
<Geometry>
<ogc:Function name="offset">
<ogc:PropertyName>the_geom</ogc:PropertyName>
<ogc:Literal>0</ogc:Literal>
<ogc:Literal>5</ogc:Literal>
</ogc:Function>
</Geometry>
<Fill>
<CssParameter name="fill">#cccccc</CssParameter>
</Fill>
<Stroke>
<CssParameter name="stroke">#999999</CssParameter>
<CssParameter name="stroke-width">0.1</CssParameter>
</Stroke>
</PolygonSymbolizer>
</Rule>
</FeatureTypeStyle>
</UserStyle>
</NamedLayer>
</StyledLayerDescriptor>

转载自:https://blog.csdn.net/iteye_15538/article/details/82405002

You may also like...