Hi folks,
i have the following two tables:-
GeoShapes
- GeoShapeId INT IDENTITY
- Name VARCHAR(100)
- ShapeFile GEOGRAPHY [ this is a closed Polygon of Lat/Longs ]
CrimeLocations
- CrimeLocationId INT IDENTITY
- LatLong GEOGRAPHY [ this is a Lat/Long Point ]
Now, i have around 10K GeoShape results and around 500CrimeLocations.
I'm trying to figure out which GeoShapes all 500 crime lat/long points exist inside of.
:( I just don't get it! I was trying to do an STIntersects
on a subquery but that didn't work. Any suggestions?
cheers!
EDIT 1: I cannot use any GEOMETRY
functions .. because (as stated above) these are all geography types.
EDIT 2: I know how to use STContains
and STIntersects
. Please don't provide basic examples of that. I'm more curious about to do a complex query with my table structure, above.