Problem plotting Age column on a dbf database

Tyler Mitchell tylermitchell at SHAW.CA
Mon Jul 3 22:44:46 EDT 2006


On 3-Jul-06, at 4:54 PM, Willian Rampazzo wrote:
>  I'm implementing a new project and i'm having some problems  
> plotting an Age column from a dbf
> database like a label.
>  First problem is: The column have a lot of zeros values and these  
> values don't need to be plotted. Is
> there a way to specify it at the map file ?

Hi William,
I'd create a second layer that is only for the annotation.  Then you  
can add a WHERE clause in your CONNECTIONSTRING to only include  
values > 0.

>  Second problem is: When i plot the values, it is ploted on  
> scientific notation. Is there a way to specify
> it to plot values like %3.2f notation ?

You could try to find what the postgresql function you need to do the  
conversion, then explicitly request that field, with that function in  
your CONNECTIONSTRING as well.  Casting/converting the field using  
the NUMERIC function allows you to specify scale and precision like % 
3.2f does.

For example,
"the_geom, age::numeric(3,2) as AGE FROM mypoints where age >0;

Probably a better way, but I thought I'd through a quick idea out to  
you.

Good luck,
Tyler



More information about the mapserver-users mailing list