Re: [Geotools-gt2-users] How to transform WMSLayer
On Wed, Feb 10, 2021 at 5:25 PM Ian Turton wrote: > >> There are two possibilities - 1) axis order, your image might be there > but off screen 2) Andrea has just done some work on master to add a "label" > to the defaultCRS which was causing some issues in odd places in GeoServer. > Forget about option 2), it's just about the transformation override mechanism, has nothing to do with this use case. Axis order seems very much the culprit here, the WGS84 constant has lon/lat axis order, CRS.decode("EPSG:4326") results in a lat/lon order instead, unless that system variable Ian was talking about is set, instead. 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.* ___ GeoTools-GT2-Users mailing list GeoTools-GT2-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
Re: [Geotools-gt2-users] How to transform WMSLayer
On Wed, 10 Feb 2021 at 15:56, Jonas Schrottenbaum < jonesang...@googlemail.com> wrote: > You are right, if i change the CRS with the GUI to EPSG:4326, it works. So > i thought, what's the difference between doing it there and > programmatically, where it did not work. > And i found out that apparently DefaultGeographicCRS.WGS84 is not the same > as EPSG:4326. And it does not work with DefaultGeographicCRS.WGS84. At > least there i get an invisible layer. > But now i changed > from > mapcontent.getViewport().setCoordinateReferenceSystem(DefaultGeographicCRS.WGS84); > to > mapcontent.getViewport().setCoordinateReferenceSystem(CRS.decode("EPSG:4326")); > and now it works perfectly. > Do you know, why this would make a difference and > why DefaultGeographicCRS.WGS84 could result in an invisible layer? > > There are two possibilities - 1) axis order, your image might be there but off screen 2) Andrea has just done some work on master to add a "label" to the defaultCRS which was causing some issues in odd places in GeoServer. Ian > Greeting, Jones > > Am Mi., 10. Feb. 2021 um 09:52 Uhr schrieb Ian Turton >: > >> >> >> On Tue, 9 Feb 2021 at 18:30, Jonas Schrottenbaum via GeoTools-GT2-Users < >> geotools-gt2-users@lists.sourceforge.net> wrote: >> >>> Hello, how can i transform a WMSLayer, or Layer from a WMS into a >>> different CRS? >>> I read how to transform JTS Geometries and how to transform >>> GridCoverages, but could not find any information on how to do this with >>> WMSLayers. >>> >>> >> You shouldn't need to do anything to transform the layers, once you >> change the map/viewport crs the layer will automatically change to the new >> SRS. I've just done a quick test and that URL seems to display in all of >> the supported CRS and a few that are not on that list (3875) >> >> Ian >> >> >>> -- >> Ian Turton >> > -- Ian Turton ___ GeoTools-GT2-Users mailing list GeoTools-GT2-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
Re: [Geotools-gt2-users] How to transform WMSLayer
You are right, if i change the CRS with the GUI to EPSG:4326, it works. So i thought, what's the difference between doing it there and programmatically, where it did not work. And i found out that apparently DefaultGeographicCRS.WGS84 is not the same as EPSG:4326. And it does not work with DefaultGeographicCRS.WGS84. At least there i get an invisible layer. But now i changed from mapcontent.getViewport().setCoordinateReferenceSystem(DefaultGeographicCRS.WGS84); to mapcontent.getViewport().setCoordinateReferenceSystem(CRS.decode("EPSG:4326")); and now it works perfectly. Do you know, why this would make a difference and why DefaultGeographicCRS.WGS84 could result in an invisible layer? Greeting, Jones Am Mi., 10. Feb. 2021 um 09:52 Uhr schrieb Ian Turton : > > > On Tue, 9 Feb 2021 at 18:30, Jonas Schrottenbaum via GeoTools-GT2-Users < > geotools-gt2-users@lists.sourceforge.net> wrote: > >> Hello, how can i transform a WMSLayer, or Layer from a WMS into a >> different CRS? >> I read how to transform JTS Geometries and how to transform >> GridCoverages, but could not find any information on how to do this with >> WMSLayers. >> >> > You shouldn't need to do anything to transform the layers, once you change > the map/viewport crs the layer will automatically change to the new SRS. > I've just done a quick test and that URL seems to display in all of the > supported CRS and a few that are not on that list (3875) > > Ian > > >> -- > Ian Turton > ___ GeoTools-GT2-Users mailing list GeoTools-GT2-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
Re: [Geotools-gt2-users] How to transform WMSLayer
On Tue, 9 Feb 2021 at 18:30, Jonas Schrottenbaum via GeoTools-GT2-Users < geotools-gt2-users@lists.sourceforge.net> wrote: > Hello, how can i transform a WMSLayer, or Layer from a WMS into a > different CRS? > I read how to transform JTS Geometries and how to transform GridCoverages, > but could not find any information on how to do this with WMSLayers. > > You shouldn't need to do anything to transform the layers, once you change the map/viewport crs the layer will automatically change to the new SRS. I've just done a quick test and that URL seems to display in all of the supported CRS and a few that are not on that list (3875) Ian > -- Ian Turton ___ GeoTools-GT2-Users mailing list GeoTools-GT2-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users