That is a tricky question, I am not sure we have addressed that case yet. It may be worth making a function that returns *only* the points from a collection (as a MultiPoint), and then only the lines, and then only the polygons.
slice( geometryCollection, dimension ) So: slice( collection, 0 ) = slice( collection, 1 ) = MultiLineString slice( collection, 2 ) = MultiPolygon Or because there are only three perhaps, points(collection), lines( collection), polygons(collection) With those functions you could construct a more appropriate generic style for your data. -- Jody Garnett On Mon, 6 Apr 2020 at 17:30, Artem Groznykh <[email protected]> wrote: > Hi there. > > I created an YSLD style for Polygons, LineStrings and Points > > feature-styles: >> - name: name >> x-ruleEvaluation: first >> rules: >> - filter: ${dimension(geometry()) = 2} >> symbolizers: >> - polygon: >> fill-color: 'yellow' >> stroke-color: 'red' >> >> - filter: ${dimension(geometry()) = 1} >> symbolizers: >> - line: >> stroke-color: 'blue' >> >> - else: true >> symbolizers: >> - point: >> symbols: >> - mark: >> shape: circle >> stroke-width: 1 > > > It works fine with Polygon and Linestring geometries. > > But when geometry is a GeometryCollection with Polygon and LineString > inside then all child geometries have style of polygone (dimension of > Collection is 2). If only Linestrings and Points are > indise GeometryCollection then all children have style of lineString > (dimension of Collection is 1). > > How to apply different styles for geometries of different types inside > GeometryCollection? > _______________________________________________ > Geoserver-users mailing list > > Please make sure you read the following two resources before posting to > this list: > - Earning your support instead of buying it, but Ian Turton: > http://www.ianturton.com/talks/foss4g.html#/ > - The GeoServer user list posting guidelines: > http://geoserver.org/comm/userlist-guidelines.html > > If you want to request a feature or an improvement, also see this: > https://github.com/geoserver/geoserver/wiki/Successfully-requesting-and-integrating-new-features-and-improvements-in-GeoServer > > > [email protected] > https://lists.sourceforge.net/lists/listinfo/geoserver-users >
_______________________________________________ Geoserver-users mailing list Please make sure you read the following two resources before posting to this list: - Earning your support instead of buying it, but Ian Turton: http://www.ianturton.com/talks/foss4g.html#/ - The GeoServer user list posting guidelines: http://geoserver.org/comm/userlist-guidelines.html If you want to request a feature or an improvement, also see this: https://github.com/geoserver/geoserver/wiki/Successfully-requesting-and-integrating-new-features-and-improvements-in-GeoServer [email protected] https://lists.sourceforge.net/lists/listinfo/geoserver-users
