I have two datasets that come from ArcGis, stored in SQL Server. I have a column called -
Shape which is a
geometry data type and the value looks like this:
After executing this query for my Polygon dataset:
SELECT Shape.STGeometryType() AS GeometryType FROM dbo.POLY
I have another dataset that is a
POINT dataset which also has the same column
I use this query to do an Intersect between the two datasets:
update ABC set ABC.ID = mb.ID from STG ABC join POLY mb with (index([SPIDX_POLY_Shape])) on ABC.Shape.STIntersects(mb.Shape) = 1
My question is : How can I read this data into R, specially the
Shape column, when I connect my SQL Server database.
And my second question is which function will help me execute the above spatial intersect query? I am good with R, but bad with Spatial Analysis. I am not looking for you all to write me a code, but help me understand some concepts.