Hi Sami,
The referencing of 3D models is related with styling:
http://docs.geoserver.org/latest/en/user/styling/sld-cookbook/
SLDs is a very powerful standard way of customize our output content.
We can access features properties at runtime, execute functions, etc ...
And it also provides a decoupling between the data and the rendering process
(WMS maps are render on the server side ... ).
This allow us to provide KML models for KML output, X3D models for X3D output etc ...
The inclusion of 3D models is related with Points
(does it make sense to reference a 3D model using a Line or Polygon ?).
Points are typically styled using a PointSymbolizer element:
http://docs.geoserver.org/latest/en/user/styling/sld-cookbook/points.html
One of the things that a PointSymbolizer allow us to do is to use a graphic
to represent a point. We extend this behavior to support the referencing
of a 3D model.
A quick example,
You can insert some points in you database with a TYPE attribute and based on that attribute
reference a X3D model.
Let assume that only two types are available "CONE_BLUE" and "CONE_RED".
A style for this layer can be:
<?xmlversion="1.0" encoding="utf-8"?>
<StyledLayerDescriptor>
<NamedLayer>
<Name>Point Cone</Name>
<UserStyle>
<FeatureTypeStyle>
<Rule>
<Filter>
<PropertyIsEqualTo>
<PropertyName>TYPE</PropertyName>
<Literal>CONE_BLUE</Literal>
</PropertyIsEqualTo>
</Filter>
<PointSymbolizer>
<Graphicmodel="true">
<href>http://localhost:8080/models/cone_blue.x3d <http://localhost:8080/models/cone.x3d></href>
</Graphic>
</PointSymbolizer>
</Rule>
<Rule>
<Filter>
<PropertyIsEqualTo>
<PropertyName>TYPE</PropertyName>
<Literal>CONE_RED</Literal>
</PropertyIsEqualTo>
</Filter>
<PointSymbolizer>
<Graphicmodel="true">
<href>http://localhost:8080/models/cone_red.x3d <http://localhost:8080/models/cone.x3d></href>
</Graphic>
</PointSymbolizer>
</Rule>
</FeatureTypeStyle>
</UserStyle>
</NamedLayer>
</StyledLayerDescriptor>
For points of type CONE_BLUE the x3d model available on the url http://localhost:8080/models/cone_red.x3d <http://localhost:8080/models/cone.x3d> will be inserted.
(Behind the scenes only a reference to that model is inserted the client is responsible to download the model,
i.e. the client must be able to access the given URL). For quick tests I put my 3D models on the same tomcat
of GeoServer in a models directory.
If this is not clear let me know.
(I don't have my laptop with me currently son I can't provided a complete example).
I also add geoserver-users list in CC.
Best regards,
Nuno Oliveira
On 10/01/2013 10:14 AM, Sami J wrote:
Hi Nuno,
We'd like to try referencing X3D content in practice, but we are stuck because we don't know how the data should be stored to PostGIS in order to have references to external X3D definitions. Do you have example script that how you have been made data importing to PostGIS?Br,
Sami