I am developing a Rendering Transformation which takes a point featuretype as input, and output a new transformed point featuretype. The new featuretype has an attribute named “count”. I want to have a LabelSymbolizer in the SLD to display this count value on each point. The problem is, the SLD fails during rendering because the “count” attribute is not in the input featuretype (presumably due to some sanity checks in the pipeline).
Any suggestions for hacking around this?
–
Martin Davis
OpenGeo - http://opengeo.org
Expert service straight from the developers.
On Thu, Mar 22, 2012 at 1:06 AM, Martin Davis <mdavis@anonymised.com> wrote:
I am developing a Rendering Transformation which takes a point featuretype as input, and output a new transformed point featuretype. The new featuretype has an attribute named “count”. I want to have a LabelSymbolizer in the SLD to display this count value on each point. The problem is, the SLD fails during rendering because the “count” attribute is not in the input featuretype (presumably due to some sanity checks in the pipeline).
Any suggestions for hacking around this?
Hmm… moving the attribute checks after the transformation is done, against the
resulting feature type, seems the only option
Cheers
Andrea
–
Ing. Andrea Aime
GeoSolutions S.A.S.
Tech lead
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 962313
mob: +39 339 8844549
http://www.geo-solutions.it
http://geo-solutions.blogspot.com/
http://www.youtube.com/user/GeoSolutionsIT
http://www.linkedin.com/in/andreaaime
http://twitter.com/geowolf
That make sense.
I assume that these checks are in order to provide a friendlier error message rather than an NPE or similar during actual SLD evaluation? In that case there may be some leeway there… up to the point of disabling checks if the SLD contains an RT (not that this is ideal, but it’s a fallback).
I did hack around this by creating a SQLView with a dummy column named “count”, but obviously (a) this is painful and (b) won’t work for non-DB layers.
If I get a chance I’ll have a look at the code to see what it would take. I’ll file a ticket as well.
On Wed, Mar 21, 2012 at 11:59 PM, Andrea Aime <andrea.aime@anonymised.com> wrote:
On Thu, Mar 22, 2012 at 1:06 AM, Martin Davis <mdavis@anonymised.com> wrote:
I am developing a Rendering Transformation which takes a point featuretype as input, and output a new transformed point featuretype. The new featuretype has an attribute named “count”. I want to have a LabelSymbolizer in the SLD to display this count value on each point. The problem is, the SLD fails during rendering because the “count” attribute is not in the input featuretype (presumably due to some sanity checks in the pipeline).
Any suggestions for hacking around this?
Hmm… moving the attribute checks after the transformation is done, against the
resulting feature type, seems the only option
Cheers
Andrea
–
Ing. Andrea Aime
GeoSolutions S.A.S.
Tech lead
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 962313
mob: +39 339 8844549
http://www.geo-solutions.it
http://geo-solutions.blogspot.com/
http://www.youtube.com/user/GeoSolutionsIT
http://www.linkedin.com/in/andreaaime
http://twitter.com/geowolf
–
Martin Davis
OpenGeo - http://opengeo.org
Expert service straight from the developers.
On Thu, Mar 22, 2012 at 5:03 PM, Martin Davis <mdavis@anonymised.com> wrote:
That make sense.
I assume that these checks are in order to provide a friendlier error message rather than an NPE or similar during actual SLD evaluation? In that case there may be some leeway there… up to the point of disabling checks if the SLD contains an RT (not that this is ideal, but it’s a fallback).
The checks have been put there years ago to save us from the countless user reports
of un-explicable errors that ended up being typos in the property names.
I definitely don’t want to start again going down that path with rendering transformations
Cheers
Andrea
–
Ing. Andrea Aime
GeoSolutions S.A.S.
Tech lead
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 962313
mob: +39 339 8844549
http://www.geo-solutions.it
http://geo-solutions.blogspot.com/
http://www.youtube.com/user/GeoSolutionsIT
http://www.linkedin.com/in/andreaaime
http://twitter.com/geowolf