This is a migrated thread and some comments may be shown as answers.

There is a method to convert and insert geospatialdata directly into LocationCollection as a collection of points?

1 Answer 10 Views
Map
This is a migrated thread and some comments may be shown as answers.
Yan Moura
Top achievements
Rank 1
Veteran
Iron
Yan Moura asked on 16 Nov 2011, 06:51 PM
Hi,

So I have a LocationCollection object and would like to load directly into that a geospatial polygon such as:

POLYGON ((-94.264725 45.562850,-94.264735 45.562850,-94.264735 45.562860,-94.264725 45.562860,-94.264725 45.562850))

The question is: there is a method to do that automatically or will I have to write a function to parse the polygon string and insert points one by one into the LocationCollection object through the Add method?

Thanks!

1 Answer, 1 is accepted

Sort by
0
Andrey
Telerik team
answered on 21 Nov 2011, 08:52 AM
Hi Yan Moura,

The LocationCollection class contains the static Parse method. You can use it to get the LocationCollection from a string.
The sample code is below.
LocationCollection collection = LocationCollection.Parse("-94.264725 45.562850,-94.264735 45.562850,-94.264735 45.562860,-94.264725 45.562860,-94.264725 45.562850", true);

Best wishes,
Andrey Murzov
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Tags
Map
Asked by
Yan Moura
Top achievements
Rank 1
Veteran
Iron
Answers by
Andrey
Telerik team
Share this question
or