Hello,
I’ve come across some behavior from GeoServer that I would consider a bug, but wanted to post it to this list for feedback before posting to JIRA.
I have been using GeoServer’s WMS to produce maps in EPSG:2163 based on Natural Earth country and province boundaries that are stored in PostGIS in EPSG:4326.
I noticed that GeoServer is simplifying the geometries when it fetches them from the database, using ST_Simplify. Simplifying with any tolerance causes removal of vertices along parallels and meridians. Removal of these vertices before reprojection causes severe misalignment between country and province layers in the resulting map. An example (US-Canada border) is shown below:
To avoid this, it seems like GeoServer should either:
a) use PostGIS to perform the transformation, before doing on-the-fly simplification ( SELECT ST_Simplify(ST_Transform(geom, 4326, 2163), 0.123456) )
Possible with some coding and configuration, but unadvisable imho, a GeoServer installation might be pulling data from different data sources, each having a different reprojection library. Best to have a single one,
but if someone using a single data source wants to sponsor configuration and machinery to pass down reprojection options to data sources, I would not complain
b) or, avoid doing on-the-fly simplification when data is being fetched from a CRS with a data store
This would also require some configuration, possibly at the layer level, as all dataset would get a slowdown, and only the ones with straight long lines after simplification would see a behavioral benefit.
Anyhow, same as above.
Personally I don’t like either of the options, they are based on the notion that the data is pre-densified, which is not always the case, and the pre-densification amount will
either be too much for some projections, or not enough for others.
I’d prefer to see an implementation that densifies dynamically long lines before reprojection instead, based on the local deformation
of the projection and the length of the line. It’s not trivial to do, I have started implementing it once on a flight but after a few hours of work we landed and I was
nowhere near done… probably too big for spare time, but how knows, maybe one of the future christmas breaks I’ll sit down and try again… or someone will beat me
to the punch with an implementation, or funding to do it in working hours
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.