1

I am trying to find the nearest centerline segment to an address point. I was hoping that I would be able to use the ShortestLineTo method, but it is not working. I have tested with Microsoft's examples and they work. I am unable to get the method to work.

Here is Microsoft's Example:

DECLARE @Shape1 geometry = 'POLYGON ((-20 -30, -3 -26, 14 -28, 20 -40, -20 -30))'

DECLARE @Shape2 geometry = 'POLYGON ((-18 -20, 0 -10, 4 -12, 10 -20, 2 -22, -18 -20))'

SELECT @Shape1

UNION ALL

SELECT @Shape2

UNION ALL

SELECT @Shape1.ShortestLineTo(@Shape2).STBuffer(.25)

GO

My Sample:

Select l.ADDRESSPOINT_TAX.shape from l.ADDRESSPOINT_TAX where OBJECTID = '1'

union all

select l.CADCENTERLINE.SHAPE from l.CADCENTERLINE where OBJECTID = '1'

union all

select l.ADDRESSPOINT_TAX.Shape.ShortestLineTo(l.CADCENTERLINE.SHAPE)

This is the error that I am getting back.

Remote function reference 'l.ADDRESSPOINT_TAX.Shape.ShortestLineTo' is not allowed, and the column name 'l' could not be found or is ambiguous.

Msg 4121, Level 16, State 1, Line 1

Cannot find either column "ADDRESSPOINT_TAX" or the user-defined function or aggregate "ADDRESSPOINT_TAX.Shape.ShortestLineTo", or the name is ambiguous.

Thanks!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.