A Spatial View that spatially joins buildings to parcels

02-12-2016 02:13 AM
Occasional Contributor II

I have a parcel layer, on top of it the buildings layer lies, each parcel contains a building, I want to create a spatial view that automatically spatially join the building with parcels (using intersect) in order to append the Parcel_Number attribute to the buildings features. Is there a way to do this?

The two layers are in enterprise geodatabase in SQL Server 2014

Any help is highly appreciated!



0 Kudos
2 Replies
by Anonymous User
Not applicable

Hey Hani - you could use the SQL Server STIntersects function for this if your data uses Geometry data storage. For example, you could create a view in SQL Server using something like this:

CREATE VIEW buildingsparcels AS
select a.ObjectID, a.BuildingID, a.SHAPE, b.ParcelID from
DBO.Buildings a, DBO.Parcels b
WHERE a.SHAPE.STIntersects(b.SHAPE) = 1

Esri Regular Contributor

Hi Hani,

Also in the above spatial view Julia proposed, try to create the building centroid and use this point layer to intersect with Parcels, in case you face any performance issue.

The performance may vary according to the polygon complexity.

0 Kudos