[mapserver-users] WFS Layer running OGR Query Multiple times per request

joncoign jncoign at Knology.net
Tue Mar 31 20:25:21 EDT 2009


I have a WFS layer that is querying the database via an OGR ODBC connection once per point included in the result set plus one additional query. I was under the impression that this should only execute once. Am I misunderstanding or do I have something misconfigured? Map file and SQL Profiler output below.


Map File
--------------------------------------------------
NAME "DevWFS"
CONFIG "PROJ_LIB" "F:\MapServer\Maps\Proj"

#CONFIG  "MS_ERRORFILE" "F:\MapServer\Logs\MapServerLog.txt"
#DEBUG 5

PROJECTION
    "init=EPSG:4326"
END

WEB
    METADATA
        wfs_title "UAI WFS Server"
        wfs_onlineresource "http://localhost/cgi-bin/mapserv.exe?"
        wfs_srs "EPSG:4326"
    END
END

LAYER
    NAME "SQL"
    CONNECTIONTYPE OGR
    CONNECTION "<OGRVRTDataSource>
                    <OGRVRTLayer name='SQL'>
                         <SrcDataSource>ODBC:Maps,JNCTest</SrcDataSource>
                        <SrcSQL>  
                            EXEC dbo.MappingGetJNCTest %BBOX%
                        </SrcSQL>
                        <FID>ID</FID>
                        <GeometryType>wkbPoint</GeometryType>
                        <GeometryField encoding='WKB' field='the_geom' />
                    </OGRVRTLayer>
                </OGRVRTDataSource>"
    DATA "SQL"
    DUMP TRUE
	STATUS ON
    #PROCESSING "CLOSE_CONNECTION=DEFER"
    TYPE point
    METADATA
		wfs_extent "-180 -90 180 90"
        gml_featureid "ID"
        gml_include_items "all"
        gml_exclude_items "the_geom"
    END
END
--------------------------------------------------

SQL Profiler Output (3 Points match query)
--------------------------------------------------
exec [sys].sp_pkeys N'JNCTest',N'',N''
go
exec [sys].sp_pkeys N' ',N'',NULL
go
exec [sys].sp_columns_100 N'JNCTest',NULL,NULL,NULL, at fUsePattern=1
go
EXEC dbo.MappingGetJNCTest -67.64596191401315,17.434709503474547,-65.17403808598685,18.99999999999999
                        
go
exec [sys].sp_pkeys N'JNCTest',N'',N''
go
exec [sys].sp_pkeys N' ',N'',NULL
go
exec [sys].sp_columns_100 N'JNCTest',NULL,NULL,NULL, at fUsePattern=1
go
EXEC dbo.MappingGetJNCTest -67.64596191401315,17.434709503474547,-65.17403808598685,18.99999999999999
                        
go
EXEC dbo.MappingGetJNCTest -67.64596191401315,17.434709503474547,-65.17403808598685,18.99999999999999
                        
go
EXEC dbo.MappingGetJNCTest -67.64596191401315,17.434709503474547,-65.17403808598685,18.99999999999999
                        
go

--------------------------------------------------
-- 
View this message in context: http://n2.nabble.com/WFS-Layer-running-OGR-Query-Multiple-times-per-request-tp2566330p2566330.html
Sent from the Mapserver - User mailing list archive at Nabble.com.



More information about the mapserver-users mailing list