There are applications in which the user may wish to have an individual icon
(e.g. a photo) for each feature of the layer. Another example is SVG image,
the individual elements of which visually represent the values of some
attributes of the object. 
The obvious way to meet this requirement is to create a service that
provides access to the database that stores these images and to include into
the ExternalGraphic element of SLD a URL that references this service. 
The disadvantage of this solution is that for each image the service will
have to perform a separate query to the database, which is usually
significantly slower than the execution of a single query that retrieves all
the images at once. 
It would be convenient to store the images together with other attributes of
the object, to obtain a single query to the data source and use in SLD the
same way as are other attributes that affect the visual representation of
the object. 
It is clear that retrieving from a database a lot of images at the same
time, we can face the problem of transferring large amounts of data over the
network. However, the developer should have the opportunity of choosing the
way of access to images, depending on the nature of the data and
characteristics of the network. 
Currently, however, it seems that the developer using geotools, has no
alternative, because current implementation of SLD has no means for
acquiring images from the attributes of the feature.
However, in order to obtain images from the attributes we can use the
inlineContent parameter of the ExternalGraphic element. We only need to
implement the possibility to use expressions as values for this parameter.
Applying the expression PropertyName we received exactly what we need.
I have already implemented this approach for raster images in my fork of
geotools:
https://github.com/geotools/geotools/compare/master...igorvolk:inlineContent_expresssion
The necessary tests have been prepared. 
I have also a solution for SVG images. After I will prepare a comprehensive
test that includes both raster and SVG images, I'm going to propose a pull
request.



--
View this message in context: 
http://osgeo-org.1560.x6.nabble.com/InlineContent-expression-tp5220487.html
Sent from the geotools-devel mailing list archive at Nabble.com.

------------------------------------------------------------------------------
_______________________________________________
GeoTools-Devel mailing list
GeoTools-Devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to