Filtering on oracle layers using mapserver 4.6

Fernando Simon fsimon at UNIVALI.BR
Thu Sep 1 11:15:07 EDT 2005


Hi Robert,
    In Mapserver exist two ways how to use Oracle Spatial. One is using 
the native support that exist in Mapserver, and the second is using OGR.
    When you use the native support you can use spatial functions and 
operators without problems. About the problem number 1 when you use the 
native support the intenal SQL uses the extent to query the database, 
this feature will improve the performance how you describe. With native 
support you can change the spatial operatior that Mapserver will use, 
with a little parameter you can choose: SDO_FILTER, SDO_RELATE or none.
    About the problem number 2 with native support you can use complex 
query as DATA parameter. You can use complex query as the source of 
data, you can use as source any statment that return a SDO geometry 
object. You can add or change the layer data parameter using Mapscript 
or CGI, using this way you don't need to define a filter parameter, you 
can change dynamically the query.
    An example (using Oracle Spatial Guide):
            "geom from (SELECT SDO_GEOM.SDO_BUFFER(cshape, m.diminfo, 1) 
AS geom FROM cola_markets c, user_sdo_geom_metadata m WHERE m.table_name 
= 'COLA_MARKETS' AND m.column_name = 'SHAPE' AND c.name = 'cola_a')"
    You can choose, native support or OGR support.
    For OGR support I believe that Frank is the better to reply you doubt.
    Thanks.


------------------------------------------------------------------------
Fernando Simon
Mapserver and Oracle Spatial developer
G10 - Laboratorio de Computacao Aplicada - Brazil
http://www.univali.br/g10 - UNIVALI/CTTMAR
------------------------------------------------------------------------
   

Robert oude Lohuis wrote:

>Hi,
>
>Currently we are trying to use different datasets through a single layer
>definition in a mapfile. Mapserver runs on a Linux platform against a oracle
>spatial database using OGR. The layer always accesses the same table, but we
>want to use a filter. But then we got problems. The following two scenario's
>are possible:
>
>1. Use a complete Oracle select statement for the DATA clause
>Advantage:    Oracles query power is used to get the specific dataset.
>Disadvantage: No spatial queries are used by Mapserver when zooming in, so
>all data from that set is transferred from database to mapserver. When
>Zooming in the application does not get faster.
>
>2. Use the full table for the DATA clause and use FILTER and FILTERITEM
>clauses (this is also the proposed option by the mapserver documentation)
>Advantage:    perfect spatial where clauses are produced by Mapserver, so
>when zooming in performance is getting better because less objects are selected
>Disadvantage: Filtering is NOT performed in the Oracle query. We assume it
>is carried out in OGR/Mapserver, so too much data is transferred from
>database to mapserver. With each dataset added to the database, the
>performance gets worse in a lineair way.
>
>We very much like to use option 2, is there any other suggestion/option for
>our problem ?
>
>greetz and thanks in advance.
>
>  
>



More information about the mapserver-users mailing list