[postgis] postgis/mapserver

Paul Ramsey pramsey at refractions.net
Mon Oct 8 21:27:01 PDT 2001


gispmpf at yahoo.com.br wrote:
> 
> Hello!
> 
> I have some questions about postgis/mapserver interface...
> I have created the following script:
> 
> # Definição das Camadas (Layers)
>  LAYER
>   NAME lotes
>   TYPE  POLYGON
>  STATUS DEFAULT
>  DATA teste
>    CLASSITEM 'mapkey'
>  CLASS
>  EXPRESSION '2c'
>     OUTLINECOLOR 128 128 90
>   COLOR 225 225 185
>  END
>   CLASS
>     EXPRESSION /./
>    OUTLINECOLOR 128 128 128
>    COLOR 255 255 255
>   END
> END
>  LAYER
>  CONNECTIONTYPE postgis
>  NAME 'Roads'
>  CONNECTION "user=postgres dbname=teste host=localhost"
>   DATA "linha from teste"
>   STATUS ON
>   TYPE LINE
>   CLASS
>   EXPRESSION (id=1)
>    COLOR 255 22 22
>    SYMBOL 'line'
>   SIZE 2
>    END
>  CLASS
>     EXPRESSION (id=1)
>      COLOR 205 92 82
>    END
> END
> 
> END # Fim do MapFile
> 
> i want to draw lines in the first layer and get it from postgis
> tables created like this:
> CREATE TABLE teste (id int4, linha geometry , nome varchar(25));
> INSERT INTO
> teste (id,linha,nome) VALUES (1, 'LINESTRING(1 1,50 50)','PRIM');
> 1) my question is : can i do it?

Absolutely. Keep reading and learning.

> 2) the second layer is referencing correctly the postgis table?

Yes, it seems to be. You should be better about indenting your map
files, it makes it easier to read what is referencing what.

> 3) how can i define a symbol file for this lines?

That is more of a mapserver question. Make sure you read the version 3.5
map file reference for the correct answer, because the syntax changed
between versions 3.4 and 3.5.

> 4) What is the use of the EXPRESSION for postgis?

It is exactly the same use as documented in the mapserver documentation.
Use the same conventions as normal, the expression parsing is done
internally in mapserver, it is not passed off to postgres.
 
> Thanks
> João
> GIS/Analyst
> 
> 
> To unsubscribe from this group, send an email to:
> postgis-unsubscribe at yahoogroups.com
> 
> 
> 
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/

------------------------ Yahoo! Groups Sponsor ---------------------~-->
Pinpoint the right security solution for your company- Learn how to add 128- bit encryption and to authenticate your web site with VeriSign's FREE guide!
http://us.click.yahoo.com/yQix2C/33_CAA/yigFAA/PhFolB/TM
---------------------------------------------------------------------~->

To unsubscribe from this group, send an email to:
postgis-unsubscribe at yahoogroups.com

 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 





More information about the postgis-users mailing list