[Mapserver-users] inline shapes

Sean Gillies sgillies@frii.com
Fri, 19 Mar 2004 13:13:44 -0700


On Mar 19, 2004, at 12:38 PM, Matt Doggett wrote:

> Anyone know how to get/set inline shape features via Mapscript?
>
> I have the following layer in my mapfile:
>
>   LAYER
> 	  NAME copyright
> 	  TYPE ANNOTATION
> 	  STATUS DEFAULT
> 	  TRANSFORM OFF
> 	  FEATURE
>   		POINTS
>   		  0 256
>   		END
>   		TEXT "Copyright (C) 2003. Spatial Climate Analysis
> Service"
> 	  END
> 	  CLASS
> 		***stuff***
> 	  END
>   END
>
> And I am trying to change the location of the point (0,256) to 
> something
> else, ie. Move it. But in my Mapscript when I try to get this feature,
> the following error is reported:
>
> [MapServer Error]: msLayerGetShape(): Cannot retrieve inline shapes
> randomly.
>
> -Matt
>

Matt,

This is only possible in the CVS MapServer.  See

http://mapserver.gis.umn.edu/bugs/show_bug.cgi?id=562

I'm not sure if it's fully implemented in the PHP Mapscript, but with
the Perl/Python/Ruby mapscript you'd do something like

     layer = mapobj.getLayerByName('copyright')
     layer.open()
     shape = layer.getShape(0)
     layer.close()

One solution you can try is to not define any inline features in your
map file, and then add the inline feature when needed.  This eliminates
the need to access an existing feature.

cheers,
Sean

--
Sean Gillies
sgillies at frii dot com
http://users.frii.com/sgillies

_______________________________________________
Mapserver-users mailing list
Mapserver-users@lists.gis.umn.edu
http://lists.gis.umn.edu/mailman/listinfo/mapserver-users