0

I am trying to assign an id to a set of that that is within a line buffered (0.000054) ,I notice that at the end of a buffered line, it's round in shape.

attached is my data sample where i have yellow indicating the original line.. and the yellow indicating the buffered line - polygon.

this is a set of continuous data. by my method of buffering the line, i end up with a rounded polygon that is generated on the next side of line...

this causes my "green" dot of data being wrongly related..

i would like to achieve a high accuracy if possible.(mark by red line)

where the green dot should stop at the end of the yellow line..

I notice that i can do a reduce on the buffered line by [SP_GEOMETRY].Reduce(0.0001) before intersecting it but the stopping line still not that accurate...

sql executed

SELECT   ptSample.SP_Geometry
       , lineSample.main_id as 'lineid'
       , ptSample.main_id   as 'pointid' 
FROM lineReference_buffered lineSample inner join sample_Reference ptSample 
on lineSample.[SP_GEOMETRY].STIntersects(ptSample.SP_Geometry)=1

scenario

SiGaban
  • 91
  • 1
  • 14

1 Answers1

0

It is natural to assume that the STBuffer() method would produce this result, after all you're essentially saying "return me a polygon whose sides are always 0.000054 distance from my line". At the end of your line, you essentially have a Point, and therefore it is natural to assume you end up with a semi-circle (and hence your curve).

The real question is, why buffer at all? Assuming your lines are separate (which your diagram depicts) and your points are all available to you as individual items (which is again inferred from your question / diagram) then just assign them using the closest line (without buffer) using the geog1.STDistance(geog2) method. You will of course want to then group and take the minimum distance for each point to get the correct assignment.

Jon Bellamy
  • 3,333
  • 20
  • 23