Dear Johannes,
sorry for the late reply on this. GeoServer is using OGC filter to mongo
query support provided by the mongo geotools plugin. For bbox it should use
a $geoIntersects, see here
<https://github.com/geotools/geotools/blob/43446c945bf2894632b6d302a1212ebdc9f47040/modules/plugin/mongodb/src/main/java/org/geotools/data/mongodb/AbstractFilterToMongo.java#L437>.
If a simple query triggers a full coll scan, and you are willing to debug
the code to provide a fix I would start by checking if the method linked
above is ever hit.
The piece of documentation about full table scan I believe is referring to
the computation of the boxes of the collection that use an iteration over
all the element
<https://github.com/geotools/geotools/blob/main/modules/plugin/mongodb/src/main/java/org/geotools/data/mongodb/MongoFeatureSource.java#L110>s
matched by the passed filter (this is the kind of operation issued when
pressing *compute** bbox* from the GeoServer UI on the layer configuration
page). This operation should however not occur when dealing with GetMap
requests.

Regards,

Marco Volpini

==
GeoServer Professional Services from the experts!

Visit http://bit.ly/gs-services-us for more information.
==

Marco Volpini

Software Engineer

GeoSolutions Group
phone: +39 0584 962313

fax:     +39 0584 1660272

https://www.geosolutionsgroup.com/

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.




On Fri, Jun 17, 2022 at 1:45 AM Johannes Brännström via Geoserver-users <
geoserver-users@lists.sourceforge.net> wrote:

> Hi,
>
>
> In
> https://docs.geotools.org/stable/userguide/library/data/mongodb.html
> <https://docs.geotools.org/stable/userguide/library/data/mongodb.html>
> under Implementation Notes
> it says
>
>    -
>
>    Bounding box calculation makes use of a full table scan.
>
> but in
>
> https://github.com/geotools/geotools/blob/main/modules/plugin/mongodb/src/main/java/org/geotools/data/mongodb/MongoDataStore.java
> BBOX capability is added. Technically the BBOX should be a $geoWithin
> query with a 4 points polygon.
> https://www.mongodb.com/docs/manual/tutorial/query-a-2dsphere-index/
> Using the OpenLayers map preview and zooming in I can see in the MongoDB
> server logs that no filter is used and a COLLSCAN is issued!
>
> "attr":{"query":"ns: sweden.landuse query: {} sort: {} projection: {
> geometry: 1 }","planSummary":"COLLSCAN"}
> It seems that the MongoDB instance is not breaking a sweat at the collscan
> but Geoserver grinds to a halt, trying to crunch the data in-memory most
> likely.
>
> Is there a bug report or feature request tracking this? Maybe I could get
> this fixed if someone points me to where the action is (not) happening :)
>
> I also noticed
>
> https://stackoverflow.com/questions/61178776/how-to-get-geoserver-to-use-the-mongodb-geo-index-for-heatmap-transformations
> but have not found a way to verify if that's been fixed, but maybe you
> know?
>
> Happy to help out if I can get some pointers. Btw generating the schema
> seems to be an awesome feature!
>
> Best Regards,
> Johannes
>
> {
>   name     : "Johannes Brännström",
>   title    : "Senior Solutions Architect",
>   phone    : "+46(0)725109160",
>   location : "Stockholm, Sweden",
>   linkedIn : "in: johannesbrannstrom
> <https://www.linkedin.com/in/johannesbrannstrom>",
>   web      : "www.mongodb.com"
> }
> _______________________________________________
> Geoserver-users mailing list
>
> Please make sure you read the following two resources before posting to
> this list:
> - Earning your support instead of buying it, but Ian Turton:
> http://www.ianturton.com/talks/foss4g.html#/
> - The GeoServer user list posting guidelines:
> http://geoserver.org/comm/userlist-guidelines.html
>
> If you want to request a feature or an improvement, also see this:
> https://github.com/geoserver/geoserver/wiki/Successfully-requesting-and-integrating-new-features-and-improvements-in-GeoServer
>
>
> Geoserver-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/geoserver-users
>
_______________________________________________
Geoserver-users mailing list

Please make sure you read the following two resources before posting to this 
list:
- Earning your support instead of buying it, but Ian Turton: 
http://www.ianturton.com/talks/foss4g.html#/
- The GeoServer user list posting guidelines: 
http://geoserver.org/comm/userlist-guidelines.html

If you want to request a feature or an improvement, also see this: 
https://github.com/geoserver/geoserver/wiki/Successfully-requesting-and-integrating-new-features-and-improvements-in-GeoServer


Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Reply via email to