Skip to main content
Version: v2.x

MS SQL Server: Filter Using Geospatial Data

Introduction

The _st_contains, _st_crosses, _st_equals, _st_intersects, _st_overlaps, _st_touches, _st_within operators are used to filter based on geometry like columns.

_st_intersects usage

_st_intersects can be used on geography columns also.

Use JSON representation (see GeoJSON) of geometry and geography values in variables as shown in the following examples:

_st_contains

Fetch a list of geometry values that are contained within the given polygon value:

GraphiQL
Query Variables
Request Headers
Documentation Explorer
No Schema Available

_st_crosses

Fetch a list of geometry values which cross the given line value:

GraphiQL
Query Variables
Request Headers
Documentation Explorer
No Schema Available

_st_equals

Fetch a list of geometry values which are equal to the given polygon value:

GraphiQL
Query Variables
Request Headers
Documentation Explorer
No Schema Available

_st_intersects

Fetch a list of geometry values which intersect the given polygon value:

GraphiQL
Query Variables
Request Headers
Documentation Explorer
No Schema Available

_st_overlaps

Fetch a list of geometry values which overlap with the given polygon value:

GraphiQL
Query Variables
Request Headers
Documentation Explorer
No Schema Available

_st_touches

Fetch a list of geometry values which touch the given polygon value:

GraphiQL
Query Variables
Request Headers
Documentation Explorer
No Schema Available

_st_within

Fetch a list of geometry values which are within the given polygon value:

GraphiQL
Query Variables
Request Headers
Documentation Explorer
No Schema Available