Aquire x/y coordinates from rectangle object

Lowell Filak lfilak at MEDINACO.ORG
Tue Sep 7 10:37:36 EDT 2004


The following message was sent by G-Net Consulting
<joelf at GNETCONSULTING.COM> on Sat, 4 Sep 2004 01:14:23 -0400.

> Hello List:
>
> I'm looking for a snippet of code to grab the X/Y coordinates
> from a point in a shape file.  I've pulled the shape data in
> from the DBF (thanks to Lowell for that).  Now I would like
> to display the data in overLib with a mouseover.
>
> So what is the best way to get the X/Y for each shape
> in the chosen extent?
>
> Thanks.
>
> Joel

Joel;

You can:

shapeObj = new shapeObj(type_point)

use the shapeindex from resultCacheMemberObj with
layer->getShape(shapeObj, 0, shapeindex)

pointObj=shapeObj->get(0)

pointObj->{x} & pointObj->{y}

The doc (at least swigmapscript) needs to be clearer on this.

Lowell



More information about the mapserver-users mailing list