RE: [mapserver-users] queryByFeatures not working in 5.6.6?

2011-03-02 Thread Lime, Steve D (DNR)
queryByFeatures uses a query against one layer to select features that are used 
against other layers. For example, select a county by name and then use it to 
select lakes or whatever. It's probably a stupid name for the method but that's 
what it does. It's a two-stage query and a pretty specific use case.

As for why things would stop working, not sure without more information. With 
some of the query processing speedups added in the 5.4 and 5.6 versions we used 
the various indexes in a result object to store information necessary for fast 
access. I see you're not passing the result tileindex:

  $oShape = $oLayer_lurc_parcels->getFeature($oResult->shapeindex,-1);

That may be the source of the problem. What happens if you do:

  $oShape = $oLayer_lurc_parcels->getFeature($oResult->shapeindex, 
$oResult->tileindex);

instead?

Steve


From: mapserver-users-boun...@lists.osgeo.org 
[mapserver-users-boun...@lists.osgeo.org] On Behalf Of Bistrais, Bob 
[bob.bistr...@maine.gov]
Sent: Tuesday, March 01, 2011 2:01 PM
To: Mathieu Kouri; mapserver-users
Subject: RE: [mapserver-users] queryByFeatures not working in 5.6.6?

I think I’ve found a workaround.  I actually replaced my queryByFeatures with a 
queryByShape.  This works in my application.  But, I’m afraid I can’t explain 
why the queryByShape is not working for Mathieu.  Maybe you should try 
queryByFeatures and see if it works for you!


From: Mathieu Kouri [mailto:mko...@dbxgeomatics.com]
Sent: Tuesday, March 01, 2011 2:33 PM
To: Bistrais, Bob; mapserver-users
Subject: RE: [mapserver-users] queryByFeatures not working in 5.6.6?

Hi,
I would like to mention  that we have been also having problem in using 
queryByShape(...).
We were on 5.6.4 and everything was working fine but when updating to 5.6.6 
this is no longer seems to be working.

Thanks

From: mapserver-users-boun...@lists.osgeo.org 
[mailto:mapserver-users-boun...@lists.osgeo.org] On Behalf Of Bistrais, Bob
Sent: March-01-11 11:56 AM
To: mapserver-users
Subject: [mapserver-users] queryByFeatures not working in 5.6.6?

We are upgrading our MapServer installation to 5.6.6, and now are finding a 
problem with queries that were previously working.

I’m tracing the problem to a queryByFeatures operation.  We are taking a 
selected parcel and querying a zoning layer to see what zones are intersected 
by the parcel.  We are able to successfully select the parcel by a 
queryByAttributes.  We get the shape from the selected parcel, then attempt a 
queryByFeatures.  But no results are returned for the zoning layer.

As I mentioned earlier, this was functioning properly in the previous version 
of MapServer.  Is there a change in syntax or something else that I’m not aware 
of?

Here is some of the code to perform the query:

-At this point, a parcel has been selected…

// Loop through the results set (there should only be one), get the shape, and 
save the
// shape attributes.
for ($i=0; $i<=($oLayer_lurc_parcels->getNumResults() - 1); $i++) {
$oResult = $oLayer_lurc_parcels->getResult($i);
$oLayer_lurc_parcels->open();
$oShape = $oLayer_lurc_parcels->getFeature($oResult->shapeindex,-1);
$TPL = $oShape->getValue($oLayer_lurc_parcels,"TPL");
$_SESSION['results']['TPL'][$_SESSION['nresults']] = 
substr($TPL,0,5);
$oLayer_lurc_parcels->close();
}

// Perform the intersection; query the zones layer with the parcel feature.  
Again, should
// only be one parcel.
$oLayer_lurc_zones->queryByFeatures($oLayer_lurc_parcels->index);

___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [mapserver-users] WFS Filter Encoding and resulting DB-queries

2011-03-02 Thread Stephan Holl
Hello Assefa,

Yewondwossen Assefa , [20110223 - 22:52:33]

> On 23/02/2011 8:06 AM, Stephan Holl wrote:
> > Hello Assefa,
> >
> > Yewondwossen Assefa, [20110223 - 07:26:34]
> >
> >> Hi Stephan,
> >>
> >> On 22/02/2011 3:44 AM, Stephan Holl wrote:
> >>> Hello list,
> >>>
> >>> while playing with MapServer WFS Filter Encoding capabilities I
> >>> found some strange things when it comes to form the DB-queries
> >>> (the requested layer is PostGIS-driven).
> >>>
> >>> It seems that there will always be a full table-scan and later on
> >>> the FE will be applied. Is this done by design?
> >>>
> >>Filters that do include spatial filters end up using the
> >> mapserver experssions. 'Simple' filters should end be using
> >> traslated into the layer's filter expression and end up being used
> >> by postgis as part of the data selection. What does the filter
> >> encoding looks like?
> > It is not a spatial-filter we use currently. It is an
> > attribute-based IsLike-Filter like seen here[1], but we use it with
> > POST. So adding a BBOX-related filter as another AND-filter will
> > result in optimized SQL-Query with only the subset fetched from the
> > database? If so, this seems worth to document though.
> >
>   The filter you sent as example should use the layer's filter
> element and that  should be used when retrieving the data at the
> postgis level. When the layer is in debug mode,  MapServer 5.6.x logs
> in this case shows something like (which indicates that the filter is
> used at the postgis level)
> ...
> msPostGISLayerWhichShapes  query: select  and ( (NAME like 'Syd%' 
> escape '!') )

yes, I will get the above query-entries. But before of that there is
another query stated in the logs:

select * from "projects_with_location" where false limit 0

which pointed me to a (false) conclusion.

Thank you for clarifying thouh.

Best

Stephan

-- 
Stephan Holl  | Tel.: +49 (0)541-33 508 3663
Intevation GmbH, Neuer Graben 17, 49074 OS  |  AG Osnabrück - HR B 18998
Geschäftsführer:  Frank Koormann, Bernhard Reiter, Dr. Jan-Oliver Wagner


signature.asc
Description: PGP signature
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users