[Geoserver-users] Size of a Mark in metre units seems to be different between projections

Hi list,

I’ve come across with something which I an not sure is a bug or not:

In a nut shell it relates to the size of a Mark in metre units and how this seems to differ between projections.

For example: when the srs is EPSG 27700, the Marks are correctly sized, whereas with EPSG 3587 they are smaller. This is evident by how far they reach towards neighbouring point features.

Please find below the sld that I am using to style a point based feature.

Any advice is much appreciated.

Kind regards,

Corina

<?xml version="1.0" encoding="UTF-8"?>

sld:NamedLayer

sld:NameDefault Styler</sld:Name>

sld:UserStyle

sld:NameDefault Styler</sld:Name>

sld:FeatureTypeStyle

sld:NameErrorCircle</sld:Name>

sld:Rule

<sld:PointSymbolizer uom=“http://www.opengeospatial.org/se/units/metre”>

sld:Graphic

sld:Mark

sld:WellKnownNamecircle</sld:WellKnownName>

sld:Fill

<sld:CssParameter name=“fill”>

ogc:Literal#FF0000</ogc:Literal>

</sld:CssParameter>

<sld:CssParameter name=“fill-opacity”>0.5</sld:CssParameter>

</sld:Fill>

</sld:Mark>

sld:Size

ogc:Mul

ogc:PropertyNameerror</ogc:PropertyName>

ogc:Literal2</ogc:Literal>

</ogc:Mul>

</sld:Size>

</sld:Graphic>

</sld:PointSymbolizer>

</sld:Rule>

sld:Rule

sld:NamePoint</sld:Name>

sld:PointSymbolizer

sld:Graphic

circle

ogc:Literal#7F7F7F</ogc:Literal>

ogc:Literal#D9D9D9</ogc:Literal>

1

sld:Size16</sld:Size>

</sld:Graphic>

</sld:PointSymbolizer>

</sld:Rule>

</sld:FeatureTypeStyle>

</sld:UserStyle>

</sld:NamedLayer>

</sld:StyledLayerDescriptor>

I assume you are comparing at the same scale? It is hard to discuss styling without a screen snap or web service to reference.

Different projects describe a vastly different shape of the world and have different distortions of scale (often as you move north south). It looks like the two projections you describe cover the UK and and a large section of the northern hemisphere respectfully.

···


Jody Garnett

As far as I know, metres used in "uom" parameter do not describe metres on a
sphere but on a plane. And metres on the EPSG:3857 plane (here I assume you
meant 3857, not 3587) are not 1:1 equivalent to 27700.

For example, 18 meters on the 3857 plane will make ~9.2 meters on a sphere.

--
Sent from: http://osgeo-org.1560.x6.nabble.com/GeoServer-User-f3786390.html

The rescaling is done based on the OGC scale denominator, which has simplified formulas, in particular, not taking into account the projection local deformation.
On the other side, it can be computed anywhere and it’s mandatory for interoperability (see the SLD specification for the method).

On the other side, the geometries get the full deformation of the projection, which for the case of 3857 in UK, is already pretty severe (UK area is
I believe 3 times bigger than it actually is on web mercator*).

The WMS has an option to force a “true scale” computation, see https://docs.geoserver.org/latest/en/user/services/wms/vendor.html#scalemethod
You can add it to your requests and see if it fixes the problem, but I’m not sure if it affects the scale denominator used for rule activation, or it gets
used all the way through

Cheers
Andrea

*: you can play with https://thetruesize.com/#?borders=1~!MTcyMDU3MzE.NzEyNjY1MwMzIzMTM4Nzc(MzA0NjI5OQ~!CONTIGUOUS_USMTAwMjQwNzU.MjUwMjM1MTc(MTc1)MA~!INNTI2NDA1MQ.Nzg2MzQyMQ)MQ~!CNOTkyMTY5Nw.NzMxNDcwNQ(MjI1)Mg~!GB*NjI4OTc.MTYwMTYwOTQ)MwMw) , try dragging UK to the equator, where there is almost no deformation

···

GeoServer Professional Services from the experts! Visit http://goo.gl/it488V for more information. == Ing. Andrea Aime @geowolf Technical Lead GeoSolutions S.A.S. Via di Montramito 3/A 55054 Massarosa (LU) phone: +39 0584 962313 fax: +39 0584 1660272 mob: +39 339 8844549 http://www.geo-solutions.it http://twitter.com/geosolutions_it ------------------------------------------------------- Con riferimento alla normativa sul trattamento dei dati personali (Reg. UE 2016/679 - Regolamento generale sulla protezione dei dati “GDPR”), si precisa che ogni circostanza inerente alla presente email (il suo contenuto, gli eventuali allegati, etc.) è un dato la cui conoscenza è riservata al/i solo/i destinatario/i indicati dallo scrivente. Se il messaggio Le è giunto per errore, è tenuta/o a cancellarlo, ogni altra operazione è illecita. Le sarei comunque grato se potesse darmene notizia. This email is intended only for the person or entity to which it is addressed and may contain information that is privileged, confidential or otherwise protected from disclosure. We remind that - as provided by European Regulation 2016/679 “GDPR” - copying, dissemination or use of this e-mail or the information herein by anyone other than the intended recipient is prohibited. If you have received this email by mistake, please notify us immediately by telephone or e-mail.

Hi Andrea,

Thank you very much for your reply, using scaleMethod definitely gets us closer to the what we need, but there is still a small difference.

What we found to work, is using this approach:

ogc:Div

ogc:PropertyNameerror</ogc:PropertyName>
<ogc:Function name=“cos”>
<ogc:Function name=“toRadians”>
ogc:PropertyNameLat</ogc:PropertyName>
</ogc:Function>
</ogc:Function>
</ogc:Div>
But this means we would need to have the values of latitude and longitude defined in the shapefile, and we would like to use directly the geometry field instead.

I can share a few screen shots if needed.

Cheers,

Corina

On Friday, 22 November 2019, 09:10:46 GMT, Andrea Aime andrea.aime@anonymised.com wrote:

On Thu, Nov 21, 2019 at 8:06 PM Jody Garnett <jody.garnett@anonymised.com> wrote:

Different projects describe a vastly different shape of the world and have different distortions of scale (often as you move north south). It looks like the two projections you describe cover the UK and and a large section of the northern hemisphere respectfully.

The rescaling is done based on the OGC scale denominator, which has simplified formulas, in particular, not taking into account the projection local deformation.
On the other side, it can be computed anywhere and it’s mandatory for interoperability (see the SLD specification for the method).

On the other side, the geometries get the full deformation of the projection, which for the case of 3857 in UK, is already pretty severe (UK area is
I believe 3 times bigger than it actually is on web mercator*).

The WMS has an option to force a “true scale” computation, see https://docs.geoserver.org/latest/en/user/services/wms/vendor.html#scalemethod
You can add it to your requests and see if it fixes the problem, but I’m not sure if it affects the scale denominator used for rule activation, or it gets
used all the way through

Cheers
Andrea

*: you can play with https://thetruesize.com/#?borders=1~!MTcyMDU3MzE.NzEyNjY1MwMzIzMTM4Nzc(MzA0NjI5OQ~!CONTIGUOUS_USMTAwMjQwNzU.MjUwMjM1MTc(MTc1)MA~!INNTI2NDA1MQ.Nzg2MzQyMQ)MQ~!CNOTkyMTY5Nw.NzMxNDcwNQ(MjI1)Mg~!GB*NjI4OTc.MTYwMTYwOTQ)MwMw) , try dragging UK to the equator, where there is almost no deformation

==

GeoServer Professional Services from the experts! Visit http://goo.gl/it488V for more information. == Ing. Andrea Aime @geowolf Technical Lead GeoSolutions S.A.S. Via di Montramito 3/A 55054 Massarosa (LU) phone: +39 0584 962313 fax: +39 0584 1660272 mob: +39 339 8844549 http://www.geo-solutions.it http://twitter.com/geosolutions_it ------------------------------------------------------- Con riferimento alla normativa sul trattamento dei dati personali (Reg. UE 2016/679 - Regolamento generale sulla protezione dei dati “GDPR”), si precisa che ogni circostanza inerente alla presente email (il suo contenuto, gli eventuali allegati, etc.) è un dato la cui conoscenza è riservata al/i solo/i destinatario/i indicati dallo scrivente. Se il messaggio Le è giunto per errore, è tenuta/o a cancellarlo, ogni altra operazione è illecita. Le sarei comunque grato se potesse darmene notizia. This email is intended only for the person or entity to which it is addressed and may contain information that is privileged, confidential or otherwise protected from disclosure. We remind that - as provided by European Regulation 2016/679 “GDPR” - copying, dissemination or use of this e-mail or the information herein by anyone other than the intended recipient is prohibited. If you have received this email by mistake, please notify us immediately by telephone or e-mail.

Hi Corina,
you can also open a bug report in the ticket tracker too, so that we don’t forget about it.

Cheers
Andrea

···

Regards, Andrea Aime == GeoServer Professional Services from the experts! Visit http://goo.gl/it488V for more information. == Ing. Andrea Aime @geowolf Technical Lead GeoSolutions S.A.S. Via di Montramito 3/A 55054 Massarosa (LU) phone: +39 0584 962313 fax: +39 0584 1660272 mob: +39 339 8844549 http://www.geo-solutions.it http://twitter.com/geosolutions_it ------------------------------------------------------- Con riferimento alla normativa sul trattamento dei dati personali (Reg. UE 2016/679 - Regolamento generale sulla protezione dei dati “GDPR”), si precisa che ogni circostanza inerente alla presente email (il suo contenuto, gli eventuali allegati, etc.) è un dato la cui conoscenza è riservata al/i solo/i destinatario/i indicati dallo scrivente. Se il messaggio Le è giunto per errore, è tenuta/o a cancellarlo, ogni altra operazione è illecita. Le sarei comunque grato se potesse darmene notizia. This email is intended only for the person or entity to which it is addressed and may contain information that is privileged, confidential or otherwise protected from disclosure. We remind that - as provided by European Regulation 2016/679 “GDPR” - copying, dissemination or use of this e-mail or the information herein by anyone other than the intended recipient is prohibited. If you have received this email by mistake, please notify us immediately by telephone or e-mail.

Hi Andrea,

You were actually right, I was testing against 4326 and not 3857 where the problem first manifest. Just to confirm that using “&scaleMethod=accurate” in the wms request does indeed solve the problem.

Many thanks,
Corina

On Friday, 22 November 2019, 10:19:58 GMT, Andrea Aime andrea.aime@anonymised.com wrote:

Hi Corina,
you can also open a bug report in the ticket tracker too, so that we don’t forget about it.

Cheers
Andrea

On Fri, Nov 22, 2019 at 11:15 AM Corina Tudorache <corina_ww@anonymised.com…> wrote:

Hi Andrea,

Thank you very much for your reply, using scaleMethod definitely gets us closer to the what we need, but there is still a small difference.

What we found to work, is using this approach:

ogc:Div

ogc:PropertyNameerror</ogc:PropertyName>
<ogc:Function name=“cos”>
<ogc:Function name=“toRadians”>
ogc:PropertyNameLat</ogc:PropertyName>
</ogc:Function>
</ogc:Function>
</ogc:Div>
But this means we would need to have the values of latitude and longitude defined in the shapefile, and we would like to use directly the geometry field instead.

I can share a few screen shots if needed.

Cheers,

Corina

On Friday, 22 November 2019, 09:10:46 GMT, Andrea Aime <andrea.aime@anonymised.com> wrote:

On Thu, Nov 21, 2019 at 8:06 PM Jody Garnett <jody.garnett@anonymised.com> wrote:

Different projects describe a vastly different shape of the world and have different distortions of scale (often as you move north south). It looks like the two projections you describe cover the UK and and a large section of the northern hemisphere respectfully.

The rescaling is done based on the OGC scale denominator, which has simplified formulas, in particular, not taking into account the projection local deformation.
On the other side, it can be computed anywhere and it’s mandatory for interoperability (see the SLD specification for the method).

On the other side, the geometries get the full deformation of the projection, which for the case of 3857 in UK, is already pretty severe (UK area is
I believe 3 times bigger than it actually is on web mercator*).

The WMS has an option to force a “true scale” computation, see https://docs.geoserver.org/latest/en/user/services/wms/vendor.html#scalemethod
You can add it to your requests and see if it fixes the problem, but I’m not sure if it affects the scale denominator used for rule activation, or it gets
used all the way through

Cheers
Andrea

*: you can play with https://thetruesize.com/#?borders=1~!MTcyMDU3MzE.NzEyNjY1MwMzIzMTM4Nzc(MzA0NjI5OQ~!CONTIGUOUS_USMTAwMjQwNzU.MjUwMjM1MTc(MTc1)MA~!INNTI2NDA1MQ.Nzg2MzQyMQ)MQ~!CNOTkyMTY5Nw.NzMxNDcwNQ(MjI1)Mg~!GB*NjI4OTc.MTYwMTYwOTQ)MwMw) , try dragging UK to the equator, where there is almost no deformation

==

GeoServer Professional Services from the experts! Visit http://goo.gl/it488V for more information. == Ing. Andrea Aime @geowolf Technical Lead GeoSolutions S.A.S. Via di Montramito 3/A 55054 Massarosa (LU) phone: +39 0584 962313 fax: +39 0584 1660272 mob: +39 339 8844549 http://www.geo-solutions.it http://twitter.com/geosolutions_it ------------------------------------------------------- Con riferimento alla normativa sul trattamento dei dati personali (Reg. UE 2016/679 - Regolamento generale sulla protezione dei dati “GDPR”), si precisa che ogni circostanza inerente alla presente email (il suo contenuto, gli eventuali allegati, etc.) è un dato la cui conoscenza è riservata al/i solo/i destinatario/i indicati dallo scrivente. Se il messaggio Le è giunto per errore, è tenuta/o a cancellarlo, ogni altra operazione è illecita. Le sarei comunque grato se potesse darmene notizia. This email is intended only for the person or entity to which it is addressed and may contain information that is privileged, confidential or otherwise protected from disclosure. We remind that - as provided by European Regulation 2016/679 “GDPR” - copying, dissemination or use of this e-mail or the information herein by anyone other than the intended recipient is prohibited. If you have received this email by mistake, please notify us immediately by telephone or e-mail.

Regards, Andrea Aime == GeoServer Professional Services from the experts! Visit http://goo.gl/it488V for more information. == Ing. Andrea Aime @geowolf Technical Lead GeoSolutions S.A.S. Via di Montramito 3/A 55054 Massarosa (LU) phone: +39 0584 962313 fax: +39 0584 1660272 mob: +39 339 8844549 http://www.geo-solutions.it http://twitter.com/geosolutions_it ------------------------------------------------------- Con riferimento alla normativa sul trattamento dei dati personali (Reg. UE 2016/679 - Regolamento generale sulla protezione dei dati “GDPR”), si precisa che ogni circostanza inerente alla presente email (il suo contenuto, gli eventuali allegati, etc.) è un dato la cui conoscenza è riservata al/i solo/i destinatario/i indicati dallo scrivente. Se il messaggio Le è giunto per errore, è tenuta/o a cancellarlo, ogni altra operazione è illecita. Le sarei comunque grato se potesse darmene notizia. This email is intended only for the person or entity to which it is addressed and may contain information that is privileged, confidential or otherwise protected from disclosure. We remind that - as provided by European Regulation 2016/679 “GDPR” - copying, dissemination or use of this e-mail or the information herein by anyone other than the intended recipient is prohibited. If you have received this email by mistake, please notify us immediately by telephone or e-mail.

Oh cool, I want’s sure it would have worked. Maybe the code should try to use an accurate scale denominator for the rescaling,
and only do the OGC one if the accurate one fails to compute (which can happen a lot, once outside of the valid area of a projection… and yes, people will use it anyways unfortunately)
Could you add this comment to the ticket?

Cheers
Andrea

···

GeoServer Professional Services from the experts! Visit http://goo.gl/it488V for more information. == Ing. Andrea Aime @geowolf Technical Lead GeoSolutions S.A.S. Via di Montramito 3/A 55054 Massarosa (LU) phone: +39 0584 962313 fax: +39 0584 1660272 mob: +39 339 8844549 http://www.geo-solutions.it http://twitter.com/geosolutions_it ------------------------------------------------------- Con riferimento alla normativa sul trattamento dei dati personali (Reg. UE 2016/679 - Regolamento generale sulla protezione dei dati “GDPR”), si precisa che ogni circostanza inerente alla presente email (il suo contenuto, gli eventuali allegati, etc.) è un dato la cui conoscenza è riservata al/i solo/i destinatario/i indicati dallo scrivente. Se il messaggio Le è giunto per errore, è tenuta/o a cancellarlo, ogni altra operazione è illecita. Le sarei comunque grato se potesse darmene notizia. This email is intended only for the person or entity to which it is addressed and may contain information that is privileged, confidential or otherwise protected from disclosure. We remind that - as provided by European Regulation 2016/679 “GDPR” - copying, dissemination or use of this e-mail or the information herein by anyone other than the intended recipient is prohibited. If you have received this email by mistake, please notify us immediately by telephone or e-mail.