[mapserver-users] Create a file "GML" from a layer of type"annotation".

José María Michia jose.maria.michia at gmail.com
Thu Nov 20 22:27:06 PST 2008


2008/11/21 Rahkonen Jukka <Jukka.Rahkonen at mmmtike.fi>:
> Hi,
>
> I guess that annotation layers are not supported for this use and you should somehow create a point type layer that acts like the annotation layer. There needs only be two colums in the schema, geometry and name.  I don't know it could be done, but have you tried just to change the layer type to point?

You are right. The server "WFS" does not support ANNOTATION layers.

I have not tried to change the type of geometry of the layer to point.

However, the geometry type of data is polygon, so I can easily convert
to centroids.

The test that I've done it, is to change the type of geometry of the
layer to the type polygon, instead of annotation. In this way, I've
moved closer to the goal. But the GML file that I have been able to
obtain, is the product of a "REQUEST = GetFeature". Because of this,
the result contains all elements, not only those items with
generalized labels by MapServer.

I think that some scripting can be used to read de labels cache, and
write the data in a convenient way. I still have not been able to
explore this alternative.

> -Jukka Rahkonen-

Thanks Jukka!

>
>
> -----Alkuperäinen viesti-----
> Lähettäjä: mapserver-users-bounces at lists.osgeo.org puolesta: José María Michia
> Lähetetty: pe 21.11.2008 5:51
> Vastaanottaja: Pietro Giannini
> Kopio: mapserver-users at lists.osgeo.org
> Aihe: Re: [mapserver-users] Create a file "GML" from a layer of type"annotation".
>
> Hi,
>
> Maybe is useful explain more precisely my goal.
>
> The attached image is a PNG obtained by using shp2img. The layer
> displayed is an ANNOTATION LAYER. The labels are generalized by
> MapServer. I wish to get the labels displayed in this extent, in this
> scale, with this degree of generalization, in a GIS format, like GML,
> or ShapeFile. I wish to use these file in GMT, that no have
> implemented labeling algorithm.
>
> My attempts:
>
> 1. shp2img: i obtained PDF files, which can be integrated in the final
> map using something like Inkscape.
> 2. WMS: only can obtain a raster image.
> 3. WFS: I have been able to generate GML files using an WFS request,of
> type GetFeature. However, GetFeature work on all elements, without
> caring for the widespread labeling. I do not want all the labels, only
> those that have been generalized to a certain scale.
>
> In the past, I used MapScript. If I remember correctly, I could do
> this by using a script in PHP or Python. Correct?
>
> Thanks for any advice.
> José María
>
>



More information about the MapServer-users mailing list