This project is read-only.

Returning dataset as points

Topics: User Forum
Mar 1, 2007 at 10:42 AM
Edited Mar 1, 2007 at 10: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 10: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.