Need help: Annotation layer from Postgis using php

Paul Ramsey pramsey at REFRACTIONS.NET
Tue Jul 12 14:07:10 EDT 2005


Best to ask the users list, Sergey, one-on-one support wears out half  
the partners pretty quick :) Oh, and read the mapfile reference. :)
Paul

On 12-Jul-05, at 11:07 AM, Sergey Miltchakov wrote:

> Hello! I fixed all the problems and cleared just about everything out.
> I managed to define and draw a point on the map and to highlight  
> the shape
> which contains that point. (Querybypoint helped me).
>
> Now  I added the date field to my 'vydely' table and want to color the
> shapes depending on the year of this date. Here is my expression
> $tmpclass2[$i]->setexpression("(date_part('year',data_rubki) as  
> [foo] =
> 2004)");
> But it returns blank image.
> When instead I use
> $tmpclass2[$i]->setexpression("([id] = 23)");
> Everything works fine.
>
> Where do I read on using EXPRESSION? Could you please help me or  
> give me a
> hint?
>
> Regards,
> Sergey
>
>
>
>> Why is your data statement set to "id from vydely"? Even though it is
>> an annotation layer, the data statement should still point at the
>> geometry column (the_geom in your case).
>> On a related note: why have an annotation layer, if you are already
>> drawing the polygons? Just add a label object to your polygon layer.
>> On a related, related note: if you want to label using a  
>> combination of
>> two columns for the label, a SQL based data statement could be  
>> useful.
>> For example:
>> DATA "the_geom from (select gid,the_geom,kvartal || ' ' || id as  
>> label
>> from vydely) as foo using unique gid"
>>
>
>
>



More information about the mapserver-users mailing list