SWIG Mapscript
Ryan, Adam
ARyan at CO.LINN.OR.US
Wed Sep 29 13:50:23 PDT 2004
> -----Original Message-----
> From: Lowell Filak [mailto:lfilak at medinaco.org]
> Sent: Wednesday, September 29, 2004 1:38 PM
> To: Ryan, Adam; Lowell Filak
> Subject: RE: [UMN_MAPSERVER-USERS] SWIG Mapscript
>
>
> The following message was sent by "Ryan, Adam"
> <ARyan at co.linn.or.us> on Wed, 29 Sep 2004 13:25:52 -0700.
>
> >
> > > -----Original Message-----
> > > From: Lowell Filak [mailto:lfilak at medinaco.org]
> > > Sent: Wednesday, September 29, 2004 12:42 PM
> > > To: Ryan, Adam; MAPSERVER-USERS at LISTS.UMN.EDU
> > > Subject: Re: [UMN_MAPSERVER-USERS] SWIG Mapscript
> > >
> > >
> > > The following message was sent by "Ryan, Adam"
> > > <ARyan at CO.LINN.OR.US> on Wed, 29 Sep 2004 11:54:34 -0700.
> > >
> > > > Mapservers,
> > > >
> > > > Two methods I use in php mapscript don't seem to be in the SWIG
> > > > version.
> > > >
> > > > Layer->queryByIndex - this is non-critical since I can use
> > > queryByAttribute
> > > > with an FID
> > > >
> > > > Map->loadQuery - this is critical. There is a saveQuery
> > > method, but
> > > > Map->no
> > > > loadQuery?
> > > >
> > > > Thanks for any insight.
> > > >
> > > > Adam
> > >
> > > Adam,
> > >
> > > If I understand saveQuery correctly, you can do something
> > > similar to this by using the shapeindex for each result to
> > > pull the shapes out of the original layer (if it's a
> > > shapefile) and writing each shape to a new shapefile. This
> > > doesn't combine all result layers into a single file however,
> > > it means one shapefile for each layer with a result(s). No
> > > wonder there isn't a loadQuery, parsing all the particulars
> > > back out of a single file would be interesting if you change
> > > layer ordering at any point.
> > >
> > > Lowell
> > >
> >
> > Hey, thanks for the reply.
> >
> > I think saveQuery and loadQuery are terrific methods. Building
> > shapefiles does not allow for dynamic queries using AND, OR, or XOR
> > with previous queries, and it's too slow. The layer index
> problem is
> > easily handled by changing the layer index value in the saved query
> > file itself prior to loading. As long as only one layer is
> queried at
> > a time, this works well.
> >
> > I'm trying to re-write an application using Python and without this
> > functionality it's a no go. I can't even emulate a
> saveQuery because
> there
> > is no queryByIndex method. I'm at a loss.
> >
> > Adam
>
> Adam,
>
> So it sounds like your already down to a single layer being
> saved. I guess I am missing what you mean by "AND, OR, or
> XOR" queries as we use queryByFeatures to perform a second
> query based on the results of a previous query.
>
> Lowell
>
As far as I understand, queryByFeatures works in the same session. Using
query files, I'm able to allow the user to AND, OR, and XOR a previous query
in another session by loading the previously saved .qy query file. It's a
round-about way of reading the previous file into an array, running the new
query, getting that as an array, relating the arrays, and saving the array
to yet another qy file. It's not pretty, but it works. And with saveQuery
& loadQuery, it's pretty fast.
Adam
More information about the MapServer-users
mailing list