Thank you, I created this bug: https://osgeo-org.atlassian.net/browse/GEOT-5908 Christophe
-----Original Message----- From: Nuno Oliveira [mailto:nuno.olive...@geo-solutions.it] Sent: Tuesday, November 28, 2017 11:52 AM To: geotools-gt2-users@lists.sourceforge.net Subject: Re: [Geotools-gt2-users] [MongoDB plugin] MongoDB error "longitude/latitude is out of bounds" Hi, As far as I know there is no workaround for this, so this should be considered a bug of the MongoDB plugin. Adding some clipping to BBOX queries in MongoDB looks like the way to go. It looks to me that the best place to this will be when the plugin converts filters to MongoSB queries (just an idea): https://github.com/nmco/geotools/blob/2d7f9d149dc588713a754d9e98f711137a0639d5/modules/unsupported/mongodb/src/main/java/org/geotools/data/mongodb/FilterToMongo.java#L414-L429 Hope it helps, Nuno Oliveira On 10/20/2017 04:55 PM, christophe.lagard...@thomsonreuters.com wrote: > Hi all, > > I am using GeoServer with the MongoDB plugin and I am experiencing issues > with WMS and WMTS where no images are returned on low zoom levels. > The response contains the following error from MongoDB: "longitude/latitude > is out of bounds" > > I discovered that by design MongoDB does not allow intersect queries with > geometries having coordinates out of the bounding box -180,-90,180,90. > (See the "Important" section from their doc on geoIntersects: > https://docs.mongodb.com/manual/reference/operator/query/geoIntersects/) > > In GeoServer, this becomes problematic in multiple scenarios, where the BBox > becomes "out of bounds": > * When the clients app requests so. For instance when zooming out the map in > the "Layer Preview" section of GeoServer, the BBox can become > -270,-135,270,135. > The generated request looks like: > geoserver/wms?VERSION=1.1.1&REQUEST=GetMap&SRS=EPSG:4326&BBOX=-270,-135,270,135&... > * Also, when using WMTS with meta tiling enabled. > (http://geowebcache.org/docs/1.11.0/concepts/metatiles.html). This enlarges > the queried BBox of tiles. Which will get "out of bounds" with tiles at the > edge. This is directly visible at zoom 0 where all tiles are at the edge. > * Again with WMS, GeoServer sometimes enlarges the BBox to fit the height and > width requested. > For instance a request with a BBox of -180,-90,180,90 with an image size > of 768x384 will end up in a BBox of -181.875,-91.875, 181.875, 91.875. > The sent request looks like: > geoserver/wms?VERSION=1.1.1&REQUEST=GetMap&SRS=EPSG:4326&WIDTH=768&HEIGHT=384&BBOX=-180,-90,180,90&... > > The associated failing MongoDB query, generated by GeoServer: > { > <location field>: { > $geoIntersects: { > $geometry: { > type: "Polygon", > coordinates: [ > [ > [ -181.875, -91.875 ], > [ -181.875, 91.875 ], > [ 181.875, 91.875 ], > [ 181.875, -91.875 ], > [ -181.875, -91.875 ] > ] > ] > } > } > } > } > > The corresponding MongoDB error: > { > "waitedMS" : NumberLong(0), > "ok" : 0, > "errmsg" : "longitude/latitude is out of bounds, lng: -181.875 lat: > -91.875", > "code" : 2 > } > > Other Store kinds do not mind about an "out of bounds" BBox. > Do you know if I am missing something, or if there is some configuration to > work around this? > Or should I add some clipping of the BBox in the MongoDB plugin? At least > this would allow to retrieve the features in the valid part of the BBox. > > GeoServer version: 2.12.0 > GeoTools version: 18 > MongoDB driver version: 3.3.0 > MongoDB verison : 3.2.6 > OS: OEL > > Thank you. > > Regards, > Christophe > > ________________________________ > > This e-mail is for the sole use of the intended recipient and contains > information that may be privileged and/or confidential. If you are not > an intended recipient, please notify the sender by return e-mail and > delete this e-mail and any attachments. Certain required legal entity > disclosures can be accessed on our > website.<http://site.thomsonreuters.com/site/disclosures/> > > ---------------------------------------------------------------------- > -------- Check out the vibrant tech community on one of the world's > most engaging tech sites, Slashdot.org! > http://sdm.link/slashdot > _______________________________________________ > GeoTools-GT2-Users mailing list > GeoTools-GT2-Users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users > -- Regards, Nuno Oliveira == GeoServer Professional Services from the experts! Visit http://goo.gl/it488V for more information. == Nuno Miguel Carvalho Oliveira @nmcoliveira Software Engineer GeoSolutions S.A.S. Via di Montramito 3/A 55054 Massarosa (LU) Italy phone: +39 0584 962313 fax: +39 0584 1660272 http://www.geo-solutions.it http://twitter.com/geosolutions_it ------------------------------------------------------- AVVERTENZE AI SENSI DEL D.Lgs. 196/2003 Le informazioni contenute in questo messaggio di posta elettronica e/o nel/i file/s allegato/i sono da considerarsi strettamente riservate. Il loro utilizzo è consentito esclusivamente al destinatario del messaggio, per le finalità indicate nel messaggio stesso. Qualora riceviate questo messaggio senza esserne il destinatario, Vi preghiamo cortesemente di darcene notizia via e-mail e di procedere alla distruzione del messaggio stesso, cancellandolo dal Vostro sistema. Conservare il messaggio stesso, divulgarlo anche in parte, distribuirlo ad altri soggetti, copiarlo, od utilizzarlo per finalità diverse, costituisce comportamento contrario ai principi dettati dal D.Lgs. 196/2003. The information in this message and/or attachments, is intended solely for the attention and use of the named addressee(s) and may be confidential or proprietary in nature or covered by the provisions of privacy act (Legislative Decree June, 30 2003, no.196 - Italy's New Data Protection Code).Any use not in accord with its purpose, any disclosure, reproduction, copying, distribution, or either dissemination, either whole or partial, is strictly forbidden except previous formal approval of the named addressee(s). If you are not the intended recipient, please contact immediately the sender by telephone, fax or e-mail and delete the information in this message that has been received in error. The sender does not give any warranty or accept liability as the content, accuracy or completeness of sent messages and accepts no responsibility for changes made after they were sent or for other risks which arise as a result of e-mail transmission, viruses, etc. ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot _______________________________________________ GeoTools-GT2-Users mailing list GeoTools-GT2-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot _______________________________________________ GeoTools-GT2-Users mailing list GeoTools-GT2-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users