Name

st_within — Returns true if all points of a given geometry g1 are in another geometry g2.

Synopsis

st_within ( in g1 any ,
in g2 any ,
in prec double precision );

Description

Returns true if all points of g1 are in g2. If prec is supplied, this is a tolerance for the matching in units of linear distance appropriate to the srid. Both geometries should have the same srid.

Parameters

g1

The first geometry.

g2

The second geometry.

prec

A tolerance for the matching in units of linear distance appropriate to the srid. Default is 0.

Return Types

Returns int.

Examples

Example24.146.Simple Use

SQL>SPARQL
SELECT ?c ?geo
WHERE
  {
    ?m geo:geometry ?geo .
    ?m a ?c .
    FILTER (bif:st_within(?geo, bif:st_point (0, 52), 100))
  }
LIMIT 10;
c                                                geo
ANY                                              ANY
_______________________________
http://linkedgeodata.org/vocabulary#node         POINT(0.0197 51.1005)
http://linkedgeodata.org/vocabulary#node         POINT(0.0207 51.1006)
http://linkedgeodata.org/vocabulary#node         POINT(0.0148 51.1006)
http://linkedgeodata.org/vocabulary#node         POINT(0.0217 51.1006)
http://linkedgeodata.org/vocabulary#node         POINT(0.0021 51.1008)
http://linkedgeodata.org/vocabulary#node         POINT(0.0029 51.1008)
http://linkedgeodata.org/vocabulary#node         POINT(0.0467 51.1007)
http://linkedgeodata.org/vocabulary#node         POINT(0.0217 51.1007)
http://linkedgeodata.org/vocabulary#node         POINT(0.0148 51.1007)
http://linkedgeodata.org/vocabulary#node         POINT(0.0217 51.1008)
No. of rows in result: 10