[Geomoose-users] query.php and pgdb

Reynolds, Michael J. (DOT) Mike.Reynolds at state.mn.us
Tue Nov 15 14:53:15 EST 2011


I resolved this...  

The SYSTEM_ID field was a number data type so there were issues trying to do a wildcard LIKE operations against it.

Also, while Geomoose 2.4 query.php categorized this as a MS_OGR (which it is) and $SQL_LAYER_TYPES (which it should be)... the resulting $filter_string was not compatible with MS_ACCESS.

It wanted to use ->     SYSTEM_ID = 39312          which did not work.

When I forced query.php to consider the my MS_OGR layer as $NOT_SUPPORTED (not sql) then let it build a $filter_string ...it generated this  ---> ([SYSTEM_ID] == 39312)        which works!

But the query.php must use the $filter_string in the next section of the code as if the layer IS an $SQL_LAYER_TYPES.  

Short version...   need query.php to generate a non sql/mapserver filter_string and then continue processing as if the layer is sql/non mapserver.



-----Original Message-----
From: geomoose-users-bounces at lists.osgeo.org [mailto:geomoose-users-bounces at lists.osgeo.org] On Behalf Of Eli Adam
Sent: Tuesday, November 15, 2011 10:16 AM
To: Brent Fraser
Cc: Reynolds, Michael J. (DOT); geomoose-users at lists.osgeo.org
Subject: Re: [Geomoose-users] query.php and pgdb

Michael,

     I'm not sure about pgeo but to query PostGIS with MapServer you need to specify "using unique".  You can check out PostGIS details here,  http://www.mapserver.org/input/vector/postgis.html#data-access-connection-method

You can also ogrinfo the datasource to see which fields are being recognized.


HTH, Eli


On Tue, Nov 15, 2011 at 6:57 AM, Brent Fraser <bfraser at geoanalytic.com> wrote:
> Michael,
>
>   It sounds like Mapserver (or OGR?) can't find the SYSTEM_ID field.  
> How are you specifying which table in the database to use (what's your 
> DATA object in the mapfile look like?
>
> Best Regards,
> Brent Fraser
>
> On 11/15/2011 6:32 AM, Reynolds, Michael J. (DOT) wrote:
>
> I'm having trouble with the Geomoose 2.4 query.php, ms4w 3.0.3 
> (mapserver
> 6.0.1) and a personal geodatabase (pgdb ms access mdb esri).
>
>
>
> I think I have it narrowed down to an issue with the setFilter or the 
> $filter_string.
>
>
>
> If I comment out $queryLayer->setFilter($filter_string); at about line 
> 300 then the Search By runs and returns ALL features using the 
> template.  Proves template is good, map file is good, connection is 
> possible to the data (mapserver ogr mapscript pgdb working together ok).
>
>
>
> My map file is very simple for testing purposes:
>
> CONNECTIONTYPE OGR
>
>             CONNECTION 'mte_systems.mdb'
>
>        DATA "SIGNAL_SYSTEMS"
>
> No class items or expressions.
>
>
>
> The filter query.php builds is $filter_string = upper(SYSTEM_ID) like 
> '%'||upper('27')||'%'
>
>
>
> The field SYSTEM_ID is all capital in the database (matters?).  The 
> SYSTEM_ID field is a number data type.
>
>
>
> MS debug is active and reports the following when the setFilter line 
> is
> active:
>
>
>
> [Tue Nov 15 07:25:17 2011].25000 getSymbol(): Symbol definition error.
> Parsing error near (upper):(line 228)
>
> [Tue Nov 15 07:25:17 2011].695000 msEvalExpression(): General error message.
> Cannot evaluate expression, no item index defined.
>
> . repeat above line equal number of times to the number of all 
> features in the feature class .
>
> [Tue Nov 15 07:25:17 2011].788000 msQueryByRect(): Search returned no 
> results. No matching record(s) found.
>
> [Tue Nov 15 07:25:18 2011].116000 msFreeMap(): freeing map at 036B6A18.
>
>
>
> Not sure what Item Index might be referring too.  The PGDB has an 
> OBJECTID field.
>
>
>
> Any suggestions on what to fiddle with next?
>
> _______________________________________________
> Geomoose-users mailing list
> Geomoose-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/geomoose-users
>
> _______________________________________________
> Geomoose-users mailing list
> Geomoose-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/geomoose-users
>
>
_______________________________________________
Geomoose-users mailing list
Geomoose-users at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/geomoose-users




More information about the Geomoose-users mailing list