[Mapserver-users] inline shapes

Sean Gillies sgillies at frii.com
Fri Mar 19 15:13:44 EST 2004


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




More information about the mapserver-users mailing list