Showing some text in a layer

Julien-Samuel Lacroix jlacroix at DMSOLUTIONS.CA
Tue Jan 25 09:18:01 EST 2005


Hi,

I'm far from a PostGIS expert, but I notice 2 problems in your layer.
1. Your layer type is LINE, but in your table you seem to have a POINT
layer. Am I right? So if you want to show points you should use
TYPE POINT
or if you only want to show the labels, you should use:
TYPE ANNOTATION

2. You don't have any style in your class. For LINE and POINT types, you
should have a STYLE in your class.

Thanks
Julien

Aaron Craig wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> In my mapfile, I've defined a layer:
>
> LAYER
>        TYPE LINE
>        STATUS DEFAULT
>        NAME "museum_label"
>
>        CONNECTION 'user=postgres dbname=postgis_sardegna'
>        CONNECTIONTYPE POSTGIS
>        DATA 'point_geom from museum'
>
>        LABELITEM "name"
>        CLASS
> ~               LABEL
> ~                       COLOR 0 0 0
> ~                       TYPE TRUETYPE
> ~                       FONT arial
> ~                       SIZE 10
> ~                       ANTIALIAS TRUE
> ~                       POSITION CC
> ~                       PARTIALS FALSE
> ~                       MINDISTANCE 10
> ~                       BUFFER 1
>                END # end of label
>        END
> END
>
> The museum table looks like:
> postgis_sardegna=# \d museum
> ~              Table "public.museum"
> ~   Column   |          Type          | Modifiers
> - ------------+------------------------+-----------
> ~ id         | integer                |
> ~ name       | character varying(255) |
> ~ xdb_id     | integer                |
> ~ point_geom | geometry               |
> Check constraints:
> ~    "enforce_srid_point_geom" CHECK (srid(point_geom) = -1)
> ~    "enforce_geotype_point_geom" CHECK (geometrytype(point_geom) =
> 'POINT'::text OR point_geom IS NULL)
>
> But the layer does not display.  In the mapfile, it is the last layer to
> be declared, so it should be rendered last (on top), correct?
>
> Another layer that shows labels does work.  The syntax for the layer is
> the same, leading me to believe that my mapfile syntax is ok.  The
> working layer's underlying table's geometry column is MULTIPOLYGON
> instead of POINT.  Could that be the problem?
>
> Thanks.
>
> - --
> Aaron Craig
> mercutio at pobox.com
>
> ===========================================================
> Get Firefox!
> http://www.spreadfirefox.com/?q=affiliates&id=0&t=1
> ===========================================================
>
>
> - -=-=-
> I am but mad north-northwest: when the wind is southerly I know a hawk
> from a handsaw. --Hamlet, II:2
> - -=-=-
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.2.4 (GNU/Linux)
> Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
>
> iD8DBQFB9iS7oyEQRcU83p4RAjIaAKCHW/NKMTrRueEz3NGBBBxSTqqX/ACcCGYi
> z4jh9xXhwvQyLvbPB4AC2gQ=
> =DhU0
> -----END PGP SIGNATURE-----
>

--
------------------------------------------------------------
Julien-Samuel Lacroix            jlacroix at dmsolutions.ca
DM Solutions Group               http://www.dmsolutions.ca/
------------------------------------------------------------



More information about the mapserver-users mailing list