Possible to sort in a QueryByAttributes?

5 messages Options
Embed this post
Permalink
Bistrais, Bob

Possible to sort in a QueryByAttributes?

Reply Threaded More More options
Print post
Permalink
Some javascript/style in this post has been disabled (why?)
Possible to sort in a QueryByAttributes?

I'm working on a PHP script which will populate an HTML select list with the results of an attribute query.  The intent is to populate the select list with the values of an item in a data layer.  I sort of have it working.  But I'd like to sort my query results in ascending order, so they appear alphabetically in the select list.  Is there a way to do this in Mapscript?


_______________________________________________
mapserver-users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/mapserver-users
Steve Lime

Re: Possible to sort in a QueryByAttributes?

Reply Threaded More More options
Print post
Permalink
You'd need to store the results in a intermediate data structure and then sort that within
PHP. If you're using a database backend you can do the sort right in the DATA statement.

Steve

>>> On 11/5/2009 at 4:22 PM, in message
<[hidden email]>,
"Bistrais, Bob" <[hidden email]> wrote:
> I'm working on a PHP script which will populate an HTML select list with
> the results of an attribute query.  The intent is to populate the select
> list with the values of an item in a data layer.  I sort of have it
> working.  But I'd like to sort my query results in ascending order, so
> they appear alphabetically in the select list.  Is there a way to do
> this in Mapscript?

_______________________________________________
mapserver-users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/mapserver-users
Bistrais, Bob

RE: Possible to sort in a QueryByAttributes?

Reply Threaded More More options
Print post
Permalink
I tried using the DATA statement, but I don't have it quite right.  I
get an error.  I'm using SDE data with the SDE_92.dll plugin.  Here is
my data line:
DATA "MEGISIMS.TownPlys,SHAPE,SDE.DEFAULT, ORDER BY TOWN"
-where TOWN is the item I'd like to sort on.

Does that look right to anyone?

I'm also trying to store the results in an array and sort that, but so
far getting out of memory errors when working with the array (over 900
individual towns).  
 

-----Original Message-----
From: Steve Lime [mailto:[hidden email]]
Sent: Friday, November 06, 2009 11:48 AM
To: mapserver-users; Bistrais, Bob
Subject: Re: [mapserver-users] Possible to sort in a QueryByAttributes?

You'd need to store the results in a intermediate data structure and
then sort that within PHP. If you're using a database backend you can do
the sort right in the DATA statement.

Steve

>>> On 11/5/2009 at 4:22 PM, in message
<[hidden email].
me.us>,
"Bistrais, Bob" <[hidden email]> wrote:
> I'm working on a PHP script which will populate an HTML select list
> with the results of an attribute query.  The intent is to populate the

> select list with the values of an item in a data layer.  I sort of
> have it working.  But I'd like to sort my query results in ascending
> order, so they appear alphabetically in the select list.  Is there a
> way to do this in Mapscript?


_______________________________________________
mapserver-users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/mapserver-users
P Kishor

Re: Possible to sort in a QueryByAttributes?

Reply Threaded More More options
Print post
Permalink
On Thu, Nov 12, 2009 at 4:46 PM, Bistrais, Bob <[hidden email]> wrote:
> I tried using the DATA statement, but I don't have it quite right.  I
> get an error.  I'm using SDE data with the SDE_92.dll plugin.  Here is
> my data line:
> DATA "MEGISIMS.TownPlys,SHAPE,SDE.DEFAULT, ORDER BY TOWN"

Remove the ","  between SDE.DEFAULT and ORDER BY TOWN


> -where TOWN is the item I'd like to sort on.
>
> Does that look right to anyone?
>
> I'm also trying to store the results in an array and sort that, but so
> far getting out of memory errors when working with the array (over 900
> individual towns).
>
>
> -----Original Message-----
> From: Steve Lime [mailto:[hidden email]]
> Sent: Friday, November 06, 2009 11:48 AM
> To: mapserver-users; Bistrais, Bob
> Subject: Re: [mapserver-users] Possible to sort in a QueryByAttributes?
>
> You'd need to store the results in a intermediate data structure and
> then sort that within PHP. If you're using a database backend you can do
> the sort right in the DATA statement.
>
> Steve
>
>>>> On 11/5/2009 at 4:22 PM, in message
> <[hidden email].
> me.us>,
> "Bistrais, Bob" <[hidden email]> wrote:
>> I'm working on a PHP script which will populate an HTML select list
>> with the results of an attribute query.  The intent is to populate the
>
>> select list with the values of an item in a data layer.  I sort of
>> have it working.  But I'd like to sort my query results in ascending
>> order, so they appear alphabetically in the select list.  Is there a
>> way to do this in Mapscript?
>
>




--
Puneet Kishor
_______________________________________________
mapserver-users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/mapserver-users
Bistrais, Bob

RE: Possible to sort in a QueryByAttributes?

Reply Threaded More More options
Print post
Permalink
I just tried this.  In Firebug, I get the following error message:

<b>Warning</b>:  [MapServer Error]: msSDELayerOpen(): SE_version_get_info(): Version not found. (-126)
 

-----Original Message-----
From: P Kishor [mailto:[hidden email]]
Sent: Thursday, November 12, 2009 5:50 PM
To: mapserver-users
Subject: Re: [mapserver-users] Possible to sort in a QueryByAttributes?

On Thu, Nov 12, 2009 at 4:46 PM, Bistrais, Bob <[hidden email]> wrote:
> I tried using the DATA statement, but I don't have it quite right.  I
> get an error.  I'm using SDE data with the SDE_92.dll plugin.  Here is
> my data line:
> DATA "MEGISIMS.TownPlys,SHAPE,SDE.DEFAULT, ORDER BY TOWN"

Remove the ","  between SDE.DEFAULT and ORDER BY TOWN


> -where TOWN is the item I'd like to sort on.
>
> Does that look right to anyone?
>
> I'm also trying to store the results in an array and sort that, but so
> far getting out of memory errors when working with the array (over 900
> individual towns).
>
>
> -----Original Message-----
> From: Steve Lime [mailto:[hidden email]]
> Sent: Friday, November 06, 2009 11:48 AM
> To: mapserver-users; Bistrais, Bob
> Subject: Re: [mapserver-users] Possible to sort in a QueryByAttributes?
>
> You'd need to store the results in a intermediate data structure and
> then sort that within PHP. If you're using a database backend you can
> do the sort right in the DATA statement.
>
> Steve
>
>>>> On 11/5/2009 at 4:22 PM, in message
> <[hidden email].
> me.us>,
> "Bistrais, Bob" <[hidden email]> wrote:
>> I'm working on a PHP script which will populate an HTML select list
>> with the results of an attribute query.  The intent is to populate
>> the
>
>> select list with the values of an item in a data layer.  I sort of
>> have it working.  But I'd like to sort my query results in ascending
>> order, so they appear alphabetically in the select list.  Is there a
>> way to do this in Mapscript?
>
>




--
Puneet Kishor

_______________________________________________
mapserver-users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/mapserver-users