entity framework - DbGeography polygon get points -


i have polygon persisted on sql server 2012 database sys.geography type. how can obtain points polygon?

i'm thinking use astext() method , parse string, maybe there better choice?

found way, here extension method:

public static ienumerable<myentitywithlatandlng> getpointsfrompolygon(this system.data.entity.spatial.dbgeography geo) {    (int = 1; < geo.pointcount; i++)    {      var p = geo.pointat(i);      yield return new myentitywithlatandlng(){ latitude = p.latitude.value, longitude = p.longitude.value };   } } 

Comments

Popular posts from this blog

java - How to specify maven bin in eclipse maven plugin? -

single sign on - Logging into Plone site with credentials passed through HTTP -

php - Why does AJAX not process login form? -