[prev in list] [next in list] [prev in thread] [next in thread] 

List:       mapserver-dev
Subject:    [mapserver-dev] OGR single-pass query issues (was Ready for 5.6.2)
From:       Tamas Szekeres <szekerest () gmail ! com>
Date:       2010-03-17 23:55:43
Message-ID: f3b73b7d1003171655g58c5323au2fc130ccdcf79f8d () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


2010/3/17 Frank Warmerdam <warmerdam@pobox.com>

>
> I wrote a small test script (msautotest/mspython/ogr_query.py) and I
> did not observe any problems with resultsGetShape() and queryByRect().
> What problem were you expecting?
>
>
Frank,

I've looked into the problem in a bit more detail and it seems I have the
problem with the following test case.

1. Use queryByRect in a layer to retrieve some shapes into the result set.
2. Use drawQuery (MS_HILITE) in a larger area (covering a larger set of the
features from the layer) and notice that different features are highlighed
not the features matching with the previous query.


Actually we use the following code in msDrawQueryLayer to draw the
background before the selected features are drawn:

if(map->querymap.style == MS_NORMAL || map->querymap.style == MS_HILITE) {
    layerObj tmp_layer;

    if(initLayer(&tmp_layer, map) == -1)
        return(MS_FAILURE);

    if (msCopyLayer(&tmp_layer, layer) != MS_SUCCESS)
        return(MS_FAILURE);

    status = msDrawLayer(map, &tmp_layer, image);

    freeLayer(&tmp_layer);

    if(map->querymap.style == MS_NORMAL || status != MS_SUCCESS)
return(status);
  }


It appears that however we use a different layer instance for the drawing,
we reuse the previous connection and the same OGR layer reference is used
for drawing the background features and then the query results. In this
regard, drawing the the background will cause the feature indexes in the
result set go out of sync with the underlying layer.

Best regards,

Tamas

[Attachment #5 (text/html)]

<br><div style="visibility: hidden; display: inline;" \
id="avg_ls_inline_popup"></div><style type="text/css">#avg_ls_inline_popup {  \
position:absolute;  z-index:9999;  padding: 0px 0px;  margin-left: 0px;  margin-top: \
0px;  width: 240px;  overflow: hidden;  word-wrap: break-word;  color: black;  \
font-size: 10px;  text-align: left;  line-height: 13px;}</style><br> <div \
class="gmail_quote">2010/3/17 Frank Warmerdam <span dir="ltr">&lt;<a \
href="mailto:warmerdam@pobox.com">warmerdam@pobox.com</a>&gt;</span><br><blockquote \
class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt \
0pt 0.8ex; padding-left: 1ex;"> <br>
I wrote a small test script (msautotest/mspython/ogr_query.py) and I<br>
did not observe any problems with resultsGetShape() and queryByRect().<br>
What problem were you expecting?<div \
class="im"><br></div></blockquote><div><br>Frank,<br><br>I&#39;ve looked into the \
problem in a bit more detail and it seems I have the problem with the following test \
case.<br><br>1. Use queryByRect in a layer to retrieve some shapes into the result \
set.<br> 2. Use drawQuery (MS_HILITE) in a larger area (covering a larger set of the \
features from the layer) and notice that different features are highlighed not the \
features matching with the previous query.<br><br><br>Actually we use the following \
code in msDrawQueryLayer to draw the background before the selected features are \
drawn:<br> <br>if(map-&gt;querymap.style == MS_NORMAL || map-&gt;querymap.style == \
MS_HILITE) {<br>    layerObj tmp_layer;<br><br>    if(initLayer(&amp;tmp_layer, map) \
== -1) <br>        return(MS_FAILURE);<br><br>    if (msCopyLayer(&amp;tmp_layer, \
layer) != MS_SUCCESS)<br>  return(MS_FAILURE);<br><br>    status = msDrawLayer(map, \
&amp;tmp_layer, image);<br><br>    freeLayer(&amp;tmp_layer);<br><br>    \
if(map-&gt;querymap.style == MS_NORMAL || status != MS_SUCCESS) return(status);<br>  \
}<br><br><br>It appears that however we use a different layer instance for the \
drawing, we reuse the previous connection and the same OGR layer reference is used \
for drawing the background features and then the query results. In this regard, \
drawing the  the background will cause the feature indexes in the result set go out \
of sync with the underlying layer.<br> <br>Best \
regards,<br><br>Tamas<br><br><br><br></div></div><br>



_______________________________________________
mapserver-dev mailing list
mapserver-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-dev


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic