TransWikia.com

Using SQL intersect query?

Geographic Information Systems Asked by T Kelly on June 21, 2021

I am trying to find the length of a polyline inside a polygon using this query:

DECLARE @p geometry, @l geometry;

SELECT @l = SHAPE FROM [Vz_DSM_Stationing].[dbo].[Route_Sections] WHERE OBJECTID = 3;
SELECT @p = SHAPE FROM [Vz_DSM_Extra].[dbo].[PERMIT_BOUNDARIES] WHERE OBJECTID = 8;

SELECT @p.STIntersection(@l).STLength();

This query retrieves the shapes correctly, but selects NULL at the final statement.

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP