2

I've been trying the GeoServer Rendering Transformations - Point Stacker. According to this docs there's an optional cellSize parameter for setting the "Size of the cells in which to aggregate points, in pixels, default = 1".

I made the SLD based on the SLD example in the above OpenGeo docs.

I tried 2 cellSize (30 and 150). Here are the results:

Figure 1. GeoServer cluster (using Point Stacker) : there's displacement enter image description here

Blue squares are points (exact, not clustered). Orange circles are clusters. Both layers (blue squares & orange circles) are WMS.

There are 41 points in the island.

The Graphic circles (defined in SLD as <PointSymbolizer>) seems to be positioned incorrectly. The above pictures show that displacement grow with cellSize parameter.

Why does this happen?

I saw PointStacker - Random locations at different zoom level asking about random position of Point Stacker, but no solid answer so far.


The below picture shows the same points (of another area). Again the blue squares are points (exact, not clustered) & orange circles are clusters.

Figure 2. GeoServer cluster (using Point Stacker) : there's displacement enter image description here

Now because the zoom level is very high (more zoom-in than previous picture), the 4 points are not clustered. Ideally the orange points should be rendered in exact position as the blue point layer. But apparently GeoServer renders the orange points with some displacement. This is also asked in this question.

This picture also shows that displacement grow with cellSize parameter. Interesting enough that the displacements seem to be random.


Now let us see OpenLayers cluster. In contrast with GeoServer Point Stacker cluster (shown in Figure 1 above), OpenLayers cluster doesn't seem to have displacement. Here it is:

Figure 3. OpenLayers Cluster: no displacement enter image description here

In the above figure, OpenLayers clusters GeoJSON vector points coming from GeoServer WFS. The right-side column is just the same with the left-side, only disabling the blue square for increasing visibility of the number label in OpenLayers clusters.

In the OpenLayers Cluster layer there's a circle with label "1" that is rendered in exact position as the blue square point, which I think is very make sense. To me, OpenLayers cluster is not perfect, but much-much better than GeoServer Point Stacker cluster (WMS).

Did I do anything wrong in my GeoServer Point Stacker cluster (WMS)?

  • The reason I am pursuing GeoServer Point Stacker cluster (WMS) over OpenLayers Cluster (WFS) is because I feel insecure with WFS. Serving my map as WFS means that I am distributing it in the raw format (text) that can easily be stored and reconstructed into vector map by (smart) user.

I'm using:

  • GeoServer 2.7.0 on Apache Tomcat 7.0.61 on Windows Server 2008 R2 Datacenter 64-bit on VMWare
  • JVM: Oracle Corporation: 1.7.0_80 (Java HotSpot(TM) 64-Bit Server VM)
  • OpenLayers 2.12
  • PostGIS - PostgreSQL 9.4.1 (on Windows Server 2008 R2 Datacenter 64-bit on VMWare)

closed as off-topic by PolyGeo Aug 5 '17 at 21:11

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "This problem cannot or can no longer be reproduced. Changes to the system or to the asker's circumstances may have rendered the question obsolete, or the question does not include a procedure to enable potential answerers to reproduce the same symptoms. Such questions are off-topic as they are unlikely to help future readers, but editing them to include more details can lead to re-opening." – PolyGeo
If this question can be reworded to fit the rules in the help center, please edit the question.

  • try using a smaller cell size - those images are probably 256x256 with a cell size of 150 you only get two full cells, so your clusters are along way off – Ian Turton Jul 23 '15 at 8:56
  • @iant thanks again for your comment. I reckon that cellSize does matter. But the real problem remains: GeoServer Rendering Transformations - Point Stacker renders cluster strangely. Any ideas? – Rino Jul 23 '15 at 10:43
  • If you check the code, you'll see that the cell center is weighted along with the point own positions, this is probably why you get displacements, and they are there by design, to avoid clusters to overlap with each other too much – Andrea Aime Jul 23 '15 at 15:52
  • 2
    You probably did not add the parameter that I was talking about, which makes the point appear in the their original position if they are alone in the cell. preserveLocation=true. It could also be that your GeoServer is too old and does not have that feature, I believe it should be available since the 2.6.x series, but not sure – Andrea Aime Jul 29 '15 at 8:45
  • 1
    @Andrea Aime. Yaay! Now it gets better! The github you cited has a PreserveLocation but I did not catch that. I added that in my SLD: <ogc:Function name="parameter"> <ogc:Literal>preserveLocation</ogc:Literal> <ogc:Literal>Superimposed</ogc:Literal> </ogc:Function>. Where possible parameter are: Single, Superimposed, and Never. Now the rendered WMS cluster map is -not perfect- but much better. – Rino Jul 30 '15 at 9:20