problem with query on postgis polygon layer

Florian Goessmann florian.goessmann at MAC.COM
Wed May 9 01:41:30 EDT 2007


hi all
i have a problem querying a postgis polygon layer with php/mapscript.  
the layer is displayed correctly, but whenever i want to query it,  
queryByPoint returns MS_FAILURE.

here is the layer definition:

LAYER
     NAME fuel_age
     TYPE polygon
     CONNECTIONTYPE POSTGIS
     CONNECTION "host=127.0.0.1 dbname=GEO_DATA user=florian"
     DATA "the_geom from (select gid,the_geom,descript, fuel_colou,  
yslb from fuel_age) as data_table using unique gid using SRID=4326"
     status off
     TOLERANCE -1
     CLASS
         name "Fuel Age 1 Year"
         TEMPLATE "dummy"
         expression ('[fuel_colou]'eq'1 Year')
         status on
         style
             color 108 81 0
             outlinecolor 108 81 0
         end
     END
     CLASS
         name "Fuel Age 2 Years"
         TEMPLATE "dummy"
         expression ('[fuel_colou]'eq'2 Years')
         status on
         style
             color 81 93 0
             outlinecolor 81 93 0
         end
     END
     CLASS
         name "Fuel Age 3 Years"
         TEMPLATE "dummy"
         expression ('[fuel_colou]'eq'3 Years')
         status on
         style
             color 52 117 0
             outlinecolor 52 117 0
         end
     END
     CLASS
         name "Fuel Age 4 Years"
         TEMPLATE "dummy"
         expression ('[fuel_colou]'eq'4 Years')
         status on
         style
             color 54 105 0
             outlinecolor 54 105 0
         end
     END
     CLASS
         name "Fuel Age 5 Years"
         TEMPLATE "dummy"
         expression ('[fuel_colou]'eq'5 Years')
         status on
         style
             color 27 116 0
             outlinecolor 27 116 0
         end
     END
     CLASS
         name "Fuel Age >= 6 Years"
         TEMPLATE "dummy"
         expression ('[fuel_colou]'eq'>= 6 Years')
         status on
         style
             color 0 128 0
             outlinecolor 0 128 0
         end
     END
end

and the php code to query it:

$layer_fuel_age = $map->getLayerByName('fuel_age');
$retActiveQuery = $layer_fuel_age->queryByPoint($my_point, MS_SINGLE,  
0);

there is one more query before this one that uses the same map and  
the same my_point on a postgis point layer. this query works. i just  
can't get this polygon layer to work.

any ideas?

thanks
florian



More information about the mapserver-users mailing list