Get Shape data from ShapeLayer

View: New views
3 Messages — Rating Filter:   Alert me  

Get Shape data from ShapeLayer

by Adam Brightwell :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I am currently using ShapeLayer to display shapefiles.  However, I need to access the data (coordinates) that make up a given shape within that layer.  Any suggestions on how this might be accomplished?

Thanks,
Adam


Re: Get Shape data from ShapeLayer

by Don Dietrick :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Adam,

You can ask the ShapeLayer for its OMGraphicList, using getList().  
The OMGraphics contain the coordinates.  They will be in the  
OMGraphicList in the order they were retrieved from the Shape file.

For OMPoly objects, you can call getLatLonArray().  Beware!  When you  
get those coordinates, they will be in radians.  If you want to  
inspect them as lat/lon decimal degrees, you should make a copy of  
them before sending them to ProjMath.arrayRadToDeg(), which will do  
the conversion in place.  If you don't make the copy, you mess up the  
OMPoly.

Hope this helps,

Don

On Oct 29, 2009, at 2:06 PM, Adam Brightwell wrote:

> I am currently using ShapeLayer to display shapefiles.  However, I  
> need to access the data (coordinates) that make up a given shape  
> within that layer.  Any suggestions on how this might be accomplished?
>
> Thanks,
> Adam

--
[To unsubscribe to this list send an email to "majdart@..."
with the following text in the BODY of the message "unsubscribe openmap-users"]

Re: Get Shape data from ShapeLayer

by William Brightwell :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Excellent, I think this will work for me.

Thanks Don!

-Adam


On 10/29/09 2:12 PM, "Don Dietrick" <dietrick@...> wrote:

> Hi Adam,
>
> You can ask the ShapeLayer for its OMGraphicList, using getList().
> The OMGraphics contain the coordinates.  They will be in the
> OMGraphicList in the order they were retrieved from the Shape file.
>
> For OMPoly objects, you can call getLatLonArray().  Beware!  When you
> get those coordinates, they will be in radians.  If you want to
> inspect them as lat/lon decimal degrees, you should make a copy of
> them before sending them to ProjMath.arrayRadToDeg(), which will do
> the conversion in place.  If you don't make the copy, you mess up the
> OMPoly.
>
> Hope this helps,
>
> Don
>
> On Oct 29, 2009, at 2:06 PM, Adam Brightwell wrote:
>
>> I am currently using ShapeLayer to display shapefiles.  However, I
>> need to access the data (coordinates) that make up a given shape
>> within that layer.  Any suggestions on how this might be accomplished?
>>
>> Thanks,
>> Adam
>
> --
> [To unsubscribe to this list send an email to "majdart@..."
> with the following text in the BODY of the message "unsubscribe
> openmap-users"]

--
W. Adam Brightwell
Software Engineer, MTCSC

Email: wbrightwell@...
DCO:   william.brightwell@...
Desk:  843-218-3583
Cell:  843-810-8701


--
[To unsubscribe to this list send an email to "majdart@..."
with the following text in the BODY of the message "unsubscribe openmap-users"]