Hey Lingbo, I am a geotools lead (like Andrea) and I would be happy to
help.
The reason to catch it there (other than it being the right thing to do) is
that it will fix more than just the WMS GetMap case. WMS GetFeatureInfo and
WFS GetFeatures would also be affected after all.
The GeoTools project is built with maven (much like GeoServer), the classes
you are looking for are in JDBCDataStore:
* https://github.com/geotools/geotools/tree/master/modules/library/jdbc
In particular there is an OracleDialect
<https://github.com/geotools/geotools/blob/master/modules/plugin/jdbc/jdbc-oracle/src/main/java/org/geotools/data/oracle/OracleDialect.java>
and OracleFilterToSQL
<https://github.com/geotools/geotools/blob/master/modules/plugin/jdbc/jdbc-oracle/src/main/java/org/geotools/data/oracle/OracleFilterToSQL.java>
where we construct all the oracle specific SQL queries:
*
https://github.com/geotools/geotools/tree/master/modules/plugin/jdbc/jdbc-oracle
The code of interest in OracleFilterToSQL goes like this:
if(filter instanceof Beyond || filter instanceof DWithin)
doSDODistance(filter, e1, e2, extraData);
else if(filter instanceof BBOX && looseBBOXEnabled) {
doSDOFilter(filter, e1, e2, extraData);
} else
doSDORelate(filter, e1, e2, swapped, extraData);
So you will want to look carefully at the doSDORelate and doSDOFilter
methods.
I notice there is already a method here that does something like what you
want, perhaps you just have a bug to fix in the following code.
Expression clipToWorld(BinarySpatialOperator filter, Expression e) {
if (e instanceof Literal) {
Geometry eval = e.evaluate(filter, Geometry.class);
// Oracle cannot deal with filters using geometries that span
beyond the whole world
// in case the
if (dialect != null && isCurrentGeometryGeodetic() &&
!WORLD.contains(eval.getEnvelopeInternal())) {
Geometry result = eval.intersection(JTS.toGeometry(WORLD));
if (result != null && !result.isEmpty()) {
if(result instanceof GeometryCollection) {
result =
distillSameTypeGeometries((GeometryCollection) result, eval);
}
FilterFactory2 ff =
CommonFactoryFinder.getFilterFactory2();
e = ff.literal( result );
}
}
}
return e;
}
You may need to change this code to clip against your index bounds rather
than "WORLD".
I agree with you that we could do it on oracle datastore level in geotools
> providing other DB has no need at all. It could fix our oracle problem
> only without affecting others . with your expertise, could you help to
> pinpoint
> where we may have good access with dataset BBOX and query BBOX together
> in Geotools .
>
>
>
> Lingbo
>
>
>
> *From:* [email protected] [mailto:[email protected]
> <[email protected]>] *On Behalf Of *Andrea Aime
> *Sent:* Thursday, 12 March 2015 8:12 AM
> *To:* Tey, Victor (Mineral Resources, Kensington)
> *Cc:* Geoserver-devel; Jiang, Lingbo (Digital, Marsfield)
> *Subject:* Re: [Geoserver-devel] Propose to add an option for
> latLongBoundingBox range checking before database query.
>
>
>
> On Wed, Mar 11, 2015 at 6:11 AM, <[email protected]> wrote:
>
> Hi Andrea,
>
>
>
> It seem like there might be some confusion with the different oracle
> issues floating around. The oracle version(
> https://jira.codehaus.org/browse/GEOT-4912 ) issue has nothing to do with
> the patch Lingbo is suggesting on implementing. However to clear up the
> confusion, I have advised Lingbo to create appropriate Jira task and submit
> a proposal instead so that the issue can be discussed accordingly around
> the proposal instead.
>
>
>
> Yes, indeed that ticket has nothing to do with it (actually I don't
> understand why you're bringing it up? Maybe you wanted to link a different
> ticket?)
>
> But earlier in this thread you said (copying and pasting):
>
>
>
>
>
> ---------
>
>
>
> What one of our developer have found with oracle enterprise edition is
> that the database actually optimize the query when a query is made outside
> the bounds of the dataset. However when we ran the same query on a oracle
> standard edition, the query crashed the database. We have logged a ticket
> with Oracle as part of our contract with them and its currently under
> investigation.
>
>
>
> ---------
>
>
>
> So, this statement makes me (and Jody) think your bbox problem problem is
> Oracle version specific.
>
> In other words, can you show us how this new configuration would provide a
> _significant_ benefit with a non
>
> broken database query optimizer? (yes, a theoretical general benefit is
> evident, you don't even access the data,
>
> it has to be faster, but if we get only 0.1% speedup on the overall
> WMS/WFS request it's not worth the effort and the maintenance of that code).
>
>
>
> Cheers
>
> Andrea
>
>
>
> --
>
> ==
>
> GeoServer Professional Services from the experts! Visit
>
> http://goo.gl/NWWaa2 for more information.
>
> ==
>
>
>
> Ing. Andrea Aime
>
> @geowolf
>
> Technical Lead
>
>
>
> GeoSolutions S.A.S.
>
> Via Poggio alle Viti 1187
>
> 55054 Massarosa (LU)
>
> Italy
>
> phone: +39 0584 962313
>
> fax: +39 0584 1660272
>
> mob: +39 339 8844549
>
>
>
> 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.
>
>
>
> -------------------------------------------------------
>
------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Geoserver-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-devel