Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

For Example I have simple linestring 'LINESTRING(25 50, 100 125, 150 190)' and I need to divide it to segments of length 10. In postgis i know there is a function ST_Segmentize but what about MS SQL Server?

share|improve this question
add comment

1 Answer

up vote 3 down vote accepted

You are after the SQL Server Spatial Tools extras for SQL Server 2008. Find them and the descriptions at

http://sqlspatialtools.codeplex.com/wikipage?title=Current%20Contents&referringTitle=Home

Be aware that after you install, you have to trust the assembly as well.

Once you have these installed, then it given you a few more options. One of which is to LocateAlongGeom, which will give you a point a given distance in whatever the units are of the geometry along the line.

select dbo.LocateAlongGeom(geometry::STGeomFromText('LINESTRING(25 50, 100 125, 150 190)',0),10)

share|improve this answer
    
thank you and I forgot to ask whether it will be capable of ms sql server express 2008? –  HacketyHack Mar 6 '12 at 5:56
    
Yes you can use it in SQL SERVER 2008 Express, I just checked my local install and it works fine. –  Kelso Mar 6 '12 at 6:00
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.