On Sat, Oct 6, 2012 at 7:58 PM, Erek Dyskant <[email protected]> wrote:
> Geoserver Users,
> I'm using the REST API to create layers from within my application's
> user interface. One issue that I'm running into is that a lot of my styles
> require specific columns to be passed in from the dataset (i.e. color,
> shape). It appears that even for the default layer, geoserver doesn't
> validate that a layer contains the correct attributes for a style until
> rendertime.
> Is there an easy way to parse SLD and get back the list of required
> attributes for a given style? If so, I could prevent the user from ever
> creating a layer with styles that won't render. This would be a helpful
> endpoint to bake into the REST API.
>
>
You can use the same class that GeoServer uses to determine the attributes
used by a style when
rendering, it's called StyleAttributeExtractor:
http://docs.geotools.org/latest/javadocs/org/geotools/styling/StyleAttributeExtractor.html
Cheers
Andrea
--
==
Our support, Your Success! Visit http://opensdi.geo-solutions.it for more
information.
==
Ing. Andrea Aime
@geowolf
Technical Lead
GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549
http://www.geo-solutions.it
http://twitter.com/geosolutions_it
-------------------------------------------------------
------------------------------------------------------------------------------
Don't let slow site performance ruin your business. Deploy New Relic APM
Deploy New Relic app performance management and know exactly
what is happening inside your Ruby, Python, PHP, Java, and .NET app
Try New Relic at no cost today and get our sweet Data Nerd shirt too!
http://p.sf.net/sfu/newrelic-dev2dev
_______________________________________________
Geoserver-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-users