[Mapserver-users] bug postgis query alias

strk strk at keybit.net
Tue Jun 1 03:12:20 PDT 2004


On Mon, May 31, 2004 at 03:29:45PM -0500, Vladimir Guzmán wrote:
> Hello.
> I'm implementing a gps tracking system.
> I want to show the car's orientation like this:
> http://maintask.com/test.png
> The layer's data is something like this:
> -----------------------------
> gps_geom from (select gid,sentido,tiempo,360-rumbo+90 as 
> rumbo,velocidad,gps_geom,oid from gps_vehi where tiempo>='2004-05-29 
> 05:00:00' and tiempo<='2004-05-30 04:59:59') as foo using unique gid 
> using srid=1
> -----------------------------
> The field 'sentido' contains '>'.
> 
> The problem is that if I use something like this:
> -----------------------------
> gps_geom from (select gid,'>' as sentido,tiempo,360-rumbo+90 as 
> rumbo,velocidad,gps_geom,oid from gps_vehi where tiempo>='2004-05-29 
> 05:00:00' and tiempo<='2004-05-30 04:59:59') as foo using unique gid 
> using srid=1
> -----------------------------
> The query doesn't work.
> 
> So I had to create a column in potgres called 'sentido' and all the rows 
> containing '>'.
> 
> Is this a bug?

What's the error message ?
Can you run the query from the pgsql monitor ?
--strk;

> 
> The rest of the layer:
> 
> LAYER
>  NAME "puntosgps"
>  CONNECTIONTYPE postgis
>  CONNECTION "user=gps password=gps dbname=gps host=localhost"
>  DATA "gps_geom from (select gid,sentido,tiempo,360-rumbo+90 as 
> rumbo,velocidad,gps_geom,oid from gps_vehi where tiempo>='2004-05-29 
> 05:00:00' and tiempo<='2004-05-30 04:59:59') as foo using unique gid 
> using srid=1"
>  TYPE POINT
> PROJECTION
>  "proj=latlong"
>  "datum=WGS84"
> END
>  LABELANGLEITEM 'rumbo'
>  LABELITEM 'sentido'
>  CLASS
>    NAME 'Parado'
>    EXPRESSION ([velocidad] = 0)
>    SIZE 14
>    SYMBOL 'circle'
>    COLOR 0 0 215
>    OUTLINECOLOR 204 204 204
>  END
>  CLASS
>    NAME '0-10'
>    EXPRESSION ([velocidad] > 0 AND[velocidad] <= 10)
>    SIZE 14
>    SYMBOL 'circle'
>    COLOR 255 255 204
>    OUTLINECOLOR 204 204 204
>    LABEL
>      TYPE TRUETYPE
>      FORCE TRUE
>      FONT arial
>      ANTIALIAS TRUE
>      COLOR 0 0 0
>      OUTLINECOLOR 255 255 255
>      SIZE 8
>    END
>  END
> ...
> ...
> 
> Thanks a lot.
> 
> -- 
> Vladimir Ilich Guzmán R.
> ------------------------
> http://maintask.com 
> 
> 
> _______________________________________________
> Mapserver-users mailing list
> Mapserver-users at lists.gis.umn.edu
> http://lists.gis.umn.edu/mailman/listinfo/mapserver-users



More information about the MapServer-users mailing list