05-13-2019 01:59 PM
Until recently some of my customers reguarly set Feature Type to 'GeometryCollection' when the source geometry type was 'CompoundGeometry'.
It was recently explained to me that Feature Type 'GeometryCollection' is not for use with 'CompoundGeometry' but is instead a mechanism for ensuring symbolizers are strictly applied based on source geometry type - an sort of filter.
Setting type to 'GeometryCollection' has an impact on the rendering process because if this type is enabled, then the expected behaviour is that:
- Points will be rendered by PointSymbolizers
- Lines by LineSymbolizers
- Polygons by PolygonSymbolizers
- and Text by TextSymbolizers
For example, text label will only display if the geometry type is actually text. Point, line and area geometries therefore can't have a label added in that situation.
So my understanding is roughly
(Looks like geometrymath is excluded - appears can apply geometry math and you can then still symboloize points for area or lines geometries).
Anyway, I then started looking at which Type should be used for 'CompoundGeometry'. i.e. a feature class where geometry has points, lines and polygons. The documentation indicated that the Feature Type chosen should correspond to the geometry type, if I read it correctly.
I then discovered that it didn't mater which type I set it to (Point, Line, Area), it behaved the same in the map.
I then took a point feature and changed the type to Area and it behaved the same in the map.
So I'm wondering
Solved! Go to Solution.
01-08-2020 12:10 PM
I'm facing the same kind of questions described.
I have a compound table, with points and polygons, and I was using a database field to display labels for all the records, using a text simbolizer.
In version 2015 it was working. In v. 2018 it doesn't.
So, in this case, and considering that my compound table has points and polygons, what should be the symbology configuration to be able to show the labels from a database field?
Using a ‘GeometryCollection’ it doesn’t work.
I’ve tried to use a new symbology, of ‘area’ type, to see if the elements that correspond to polygons would show the labels, but it didn’t work either (the labels are not showed neither for points, as expected, nor for polygons).
Or is this kind of use case not supported anymore by the new versions?
Thanks in Advance,
01-08-2020 02:58 PM
Solution: Change the GMSC Feature type from GeometryCollection to Area.
It does not matter if your source feature geometry type is actually compound, it should still work.
You should be able to leave the existing style definition unchanged.
It turns out that GMSC version 2015 had a bug that was fixed in GMSC version 2016.
The bug was that labels should not have been displaying when feature type was set to GeometryCollection and the underlying geometry type being rendered was not text.
i.e. From 2016 onward, when feature type is GeometryCollection then for the symbology definition the text renderer ignores 'Label text:' - it will only retrieve and display text from the actual Geometry.
Don't you love it when fixing a bug has side effects
When GeometryCollection is assigned as feature type, then style symbolizers will only render their corresponding geometry type.
- Point geometries will only be rendered by PointSymbolizers
- Lines geometries will only be rendered by LineSymbolizers
- Polygons geometries will only be rendered by PolygonSymbolizers
- and Text geometries will only be rendered by TextSymbolizers
i.e. an TextSymbolizer will only render text if the geometry is an GeoMedia text type.
So when feature type = GeometryColection, If the geometry type is a point, line or area then the TextSymbolizer will not be applied, even if you define content for ‘Label text:’
If the GMSC feature type is set to point, line or area then the TextSymboloizer will use the 'Label text:' field.
I observe that if I have a GeoMedia ‘Compound’ feature type, I can set feature type to Area, Line or Point and behaviour appears to be the same.