[postgis-users] View Question

chodgson at refractions.net chodgson at refractions.net
Thu Nov 28 09:04:50 PST 2002


I can finally say that the answer to this question is in the docs:

http://postgis.refractions.net/docs/x549.html#AEN607

but the short answer is to use the following DATA definition:

DATA "geometry_field from table_view USING UNIQUE <uniqecol> USING SRID=<srid>

and fill in the <> with appropriate values. USING UNIQUE allows you to use the 
specified column as the unique identifier for map queries, and USING SRID 
allows you to specify the SRID for "tables" which are not in the 
geometry_columns table.

Chris

Quoting Joao Brezolin <gispmpf at yahoo.com.br>:

>  Hello to all
> 
> I'm using PostGIS and Mapserver  versions 0.7.3 and
> 3.6.3.
> 
> I'm tried to create a view  from the main table and
> call it in the mapfile, but it doesn't work....
> 
> The code is this:
> 
> LAYER
>  CONNECTIONTYPE postgis
>  NAME Roads
>  CONNECTION "user=postgres dbname=dbase"
>  DATA "geometry_field  from table_view"
>  FILTER "id_sec=1"
>  STATUS  ON
>  TYPE LINE
> #  LABELITEM "tile_name"
>  CLASS
>   NAME "Road 1"
>   TEMPLATE "Road_1.html"
>   EXPRESSION ([tipo_log]=2)
>   COLOR 85 85 85
>   SYMBOL 'line'
>   SIZE 10
>   MINSIZE 3
>   MAXSIZE 15
>   OVERLAYCOLOR 168 168 0
>   OVERLAYSYMBOL 0
>   OVERLAYSIZE 3
>   OVERLAYMINSIZE 1
>   OVERLAYMAXSIZE 2
>   SIZE 15
>  # LABEL
>  #  TYPE truetype
>  #  FONT arial-bold
>  #  SIZE 14
>  #  ANTIALIAS
>  #  COLOR 0 0 0
>  #  OUTLINECOLOR 255 255 255
>  #  PARTIALS OFF
>  END
>  CLASS
>    NAME "Road"
>    TEMPLATE "Road_2"
>    EXPRESSION ([tipo_log]=1)
>    COLOR 85 85 85
>    SYMBOL 'line'
>    SIZE 5
>    MINSIZE 3
>    MAXSIZE 15
>    OVERLAYCOLOR 255 255 255
>    OVERLAYSYMBOL 0
>    OVERLAYSIZE 3
>    OVERLAYMINSIZE 1
>    OVERLAYMAXSIZE 2
>    SIZE 15
>  END
> END
> 
> when i execute the following error apears:
> 
> msPOSTGISLayerWhichShapes(): Query error.
> prep_DB:Error executing POSTGIS DECLARE statement (0.6
> failed - retried 0.5 and it failed too). DECLARE
> mycursor BINARY CURSOR FOR SELECT
> tipo_log::text,asbinary(force_collection(force_2d
(geometry_field)),'NDR'),OID::text
> from table_view WHERE (id_sec=1) and (geometry_field
> && setSRID( 'BOX3D(1430.3002 760.3,1730.1002
> 1120.3)'::BOX3D,find_srid('','table_view','geometry_field')
> ))
> 
> How can i add OID and SRID comlumns on this view ?
> 
> 
> Thanks
> 
> João
> 
> _______________________________________________________________________
> Yahoo! Acesso Grátis
> Internet rápida, grátis e fácil. Faça o download do discador agora mesmo.
> http://br.acesso.yahoo.com/
> 
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
> 







More information about the postgis-users mailing list