Returning dataset as points

Topics: User Forum
Mar 1, 2007 at 9:42 AM
Edited Mar 1, 2007 at 9:43 AM

I'm using MsSqlSpatial alongside SharpMap, and I want to create a label layer from a dataset within my database. The dataset is comprised of lines, but I would like to create labels based on the centre of the line as a point.

So this brings me to my question: can I get MsSqlSpatial to return my dataset as point data where each point is the centre of the line held within the database?


Mar 1, 2007 at 9:59 AM
Ah, never mind. The code I was looking for is:

DataSource.GeometryExpression = "ST.Centroid(the_geom)";

Which returns the centroids of the line data as points instead of the actual line data.