I have run into a little problem when using MapServer to render complex data statements. To keep this post short and simple, I think the output of shp2img is the best place to start. When I use shp2img with a simple DATA statement (ex: GEOMETRY FROM FOO_TABLE USING SRID 4326) AND the -all_debug 5 flag set - an msOracleSpatialLayerNextShape line is written to the console for every single row.
When I use a more complex DATA statement (see below) - shp2img writes out about a dozen of the msOracleSpatialLayerNextShape line - AND THEN the last line is "Fetched 1234 more rows".... It does not loop through every row like above. When I run the sql that shp2img uses to retrieve the data - it is right on the money. Both shp2img and SQLDeveloper report the same # results.
Is there some reason why shp2img doesn't loop all the results?
Also, this only seems to be an issue with LINE geometry type. The same type of data statements work as expected with POINT.
Complex Data Statement:
DATA "GEOMETRY FROM (SELECT CASE WHEN F.ch_v_avg_a_min IS NULL THEN 0 WHEN F.ch_v_avg_a_min > 242 THEN 1 WHEN F.ch_v_avg_a_min < 242 THEN 2 ELSE 0 END as THRESHOLDCLASS, N.SHAPE AS GEOMETRY FROM CHN_DIS_NODE_MONTH_FACT F INNER JOIN GIS_NETWORK_FEATURE N ON N.OBJECTGUID = F.NODE_FEATUREID WHERE N.NETWORKELEMENTID = 2 and F.MONTHID = TO_DATE('2014-05-01', 'YYYY-MM-DD') AND N.SHAPE IS NOT NULL) USING NONE"