Can LINESTRING âcontainâ POINT?
Clash Royale CLAN TAG#URR8PPP
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty margin-bottom:0;
up vote
7
down vote
favorite
According to Wikipedia,
The predicates
Contains
andWithin
have subtle aspects to their definition which are contrary to intuition. For example,[10] a line L which is completely contained in the boundary of a polygon P is not considered to be contained in P. This quirk can be expressed as "Polygons do not contain their boundary". This issue is caused by the final clause of the Contains definition above: "at least one point of the interior of B lies in the interior of A". For this case, the predicate Covers has more intuitive semantics (see definition), avoiding boundary considerations.
If Polygons do not Contain their boundaries, do linestrings ever "contain" points?
postgis dem standards
add a comment |Â
up vote
7
down vote
favorite
According to Wikipedia,
The predicates
Contains
andWithin
have subtle aspects to their definition which are contrary to intuition. For example,[10] a line L which is completely contained in the boundary of a polygon P is not considered to be contained in P. This quirk can be expressed as "Polygons do not contain their boundary". This issue is caused by the final clause of the Contains definition above: "at least one point of the interior of B lies in the interior of A". For this case, the predicate Covers has more intuitive semantics (see definition), avoiding boundary considerations.
If Polygons do not Contain their boundaries, do linestrings ever "contain" points?
postgis dem standards
add a comment |Â
up vote
7
down vote
favorite
up vote
7
down vote
favorite
According to Wikipedia,
The predicates
Contains
andWithin
have subtle aspects to their definition which are contrary to intuition. For example,[10] a line L which is completely contained in the boundary of a polygon P is not considered to be contained in P. This quirk can be expressed as "Polygons do not contain their boundary". This issue is caused by the final clause of the Contains definition above: "at least one point of the interior of B lies in the interior of A". For this case, the predicate Covers has more intuitive semantics (see definition), avoiding boundary considerations.
If Polygons do not Contain their boundaries, do linestrings ever "contain" points?
postgis dem standards
According to Wikipedia,
The predicates
Contains
andWithin
have subtle aspects to their definition which are contrary to intuition. For example,[10] a line L which is completely contained in the boundary of a polygon P is not considered to be contained in P. This quirk can be expressed as "Polygons do not contain their boundary". This issue is caused by the final clause of the Contains definition above: "at least one point of the interior of B lies in the interior of A". For this case, the predicate Covers has more intuitive semantics (see definition), avoiding boundary considerations.
If Polygons do not Contain their boundaries, do linestrings ever "contain" points?
postgis dem standards
postgis dem standards
edited Sep 15 at 10:07
PolyGeoâ¦
51.9k1777233
51.9k1777233
asked Sep 5 at 17:41
Evan Carroll
4,7871141
4,7871141
add a comment |Â
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
7
down vote
At least according to PostGIS, a LINESTRING does CONTAIN
the constituent point along the string, but it does not CONTAIN
the terminal points,
-- false
SELECT ST_Contains(
ST_MakeLine(ST_MakePoint(0,0), ST_MakePoint(1,1)),
ST_MakePoint(1,1)
);
-- true
SELECT ST_Contains(
ST_MakeLine(ST_MakePoint(0,0), ST_MakePoint(1,1)),
ST_MakePoint(0.5,0.5)
);
While ST_Intersects
will return true for both.
If you have a multipoint, with one point on the line and the other at the extremity, the line would contains the multipoint... but not if both are on the extremities (nor if one is clearly outside of the line)
â JGH
Sep 5 at 17:56
1
just adding: terminal points are considered to be the boundary of a line, and contains requires at least one point of the interior to intersect the interior of the other - not given for a point on the lines boundary. I used the DE-9IM a lot, out of personal interest and for ultimate control of what relation is to be checked...its a little intense, each time again if not fully concentrated, but it's worth to give it a good read. all relation functions are, of course, only wrappers around this model, and the relation concepts are mostly standardized, e.g. the way contains is interpreted.
â ThingumaBob
Sep 5 at 20:17
the interior of a geometry is always of the expected dimension, the boundary of one lesser. except for points, where both predicates fall on the same entity...thus, a point can contain a point...
â ThingumaBob
Sep 5 at 20:28
no, pardon me, I think that might even be true for points, where per definition there is a null-dimensional border...when I got the time, I'll back all this up with references and add an informative answer. hope I find that time...
â ThingumaBob
Sep 5 at 20:54
SELECT ST_Contains( ST_MakePoint(0,0), ST_MakePoint(0,0) );
returns true.
â Evan Carroll
Sep 5 at 20:57
 |Â
show 1 more comment
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
7
down vote
At least according to PostGIS, a LINESTRING does CONTAIN
the constituent point along the string, but it does not CONTAIN
the terminal points,
-- false
SELECT ST_Contains(
ST_MakeLine(ST_MakePoint(0,0), ST_MakePoint(1,1)),
ST_MakePoint(1,1)
);
-- true
SELECT ST_Contains(
ST_MakeLine(ST_MakePoint(0,0), ST_MakePoint(1,1)),
ST_MakePoint(0.5,0.5)
);
While ST_Intersects
will return true for both.
If you have a multipoint, with one point on the line and the other at the extremity, the line would contains the multipoint... but not if both are on the extremities (nor if one is clearly outside of the line)
â JGH
Sep 5 at 17:56
1
just adding: terminal points are considered to be the boundary of a line, and contains requires at least one point of the interior to intersect the interior of the other - not given for a point on the lines boundary. I used the DE-9IM a lot, out of personal interest and for ultimate control of what relation is to be checked...its a little intense, each time again if not fully concentrated, but it's worth to give it a good read. all relation functions are, of course, only wrappers around this model, and the relation concepts are mostly standardized, e.g. the way contains is interpreted.
â ThingumaBob
Sep 5 at 20:17
the interior of a geometry is always of the expected dimension, the boundary of one lesser. except for points, where both predicates fall on the same entity...thus, a point can contain a point...
â ThingumaBob
Sep 5 at 20:28
no, pardon me, I think that might even be true for points, where per definition there is a null-dimensional border...when I got the time, I'll back all this up with references and add an informative answer. hope I find that time...
â ThingumaBob
Sep 5 at 20:54
SELECT ST_Contains( ST_MakePoint(0,0), ST_MakePoint(0,0) );
returns true.
â Evan Carroll
Sep 5 at 20:57
 |Â
show 1 more comment
up vote
7
down vote
At least according to PostGIS, a LINESTRING does CONTAIN
the constituent point along the string, but it does not CONTAIN
the terminal points,
-- false
SELECT ST_Contains(
ST_MakeLine(ST_MakePoint(0,0), ST_MakePoint(1,1)),
ST_MakePoint(1,1)
);
-- true
SELECT ST_Contains(
ST_MakeLine(ST_MakePoint(0,0), ST_MakePoint(1,1)),
ST_MakePoint(0.5,0.5)
);
While ST_Intersects
will return true for both.
If you have a multipoint, with one point on the line and the other at the extremity, the line would contains the multipoint... but not if both are on the extremities (nor if one is clearly outside of the line)
â JGH
Sep 5 at 17:56
1
just adding: terminal points are considered to be the boundary of a line, and contains requires at least one point of the interior to intersect the interior of the other - not given for a point on the lines boundary. I used the DE-9IM a lot, out of personal interest and for ultimate control of what relation is to be checked...its a little intense, each time again if not fully concentrated, but it's worth to give it a good read. all relation functions are, of course, only wrappers around this model, and the relation concepts are mostly standardized, e.g. the way contains is interpreted.
â ThingumaBob
Sep 5 at 20:17
the interior of a geometry is always of the expected dimension, the boundary of one lesser. except for points, where both predicates fall on the same entity...thus, a point can contain a point...
â ThingumaBob
Sep 5 at 20:28
no, pardon me, I think that might even be true for points, where per definition there is a null-dimensional border...when I got the time, I'll back all this up with references and add an informative answer. hope I find that time...
â ThingumaBob
Sep 5 at 20:54
SELECT ST_Contains( ST_MakePoint(0,0), ST_MakePoint(0,0) );
returns true.
â Evan Carroll
Sep 5 at 20:57
 |Â
show 1 more comment
up vote
7
down vote
up vote
7
down vote
At least according to PostGIS, a LINESTRING does CONTAIN
the constituent point along the string, but it does not CONTAIN
the terminal points,
-- false
SELECT ST_Contains(
ST_MakeLine(ST_MakePoint(0,0), ST_MakePoint(1,1)),
ST_MakePoint(1,1)
);
-- true
SELECT ST_Contains(
ST_MakeLine(ST_MakePoint(0,0), ST_MakePoint(1,1)),
ST_MakePoint(0.5,0.5)
);
While ST_Intersects
will return true for both.
At least according to PostGIS, a LINESTRING does CONTAIN
the constituent point along the string, but it does not CONTAIN
the terminal points,
-- false
SELECT ST_Contains(
ST_MakeLine(ST_MakePoint(0,0), ST_MakePoint(1,1)),
ST_MakePoint(1,1)
);
-- true
SELECT ST_Contains(
ST_MakeLine(ST_MakePoint(0,0), ST_MakePoint(1,1)),
ST_MakePoint(0.5,0.5)
);
While ST_Intersects
will return true for both.
answered Sep 5 at 17:46
Evan Carroll
4,7871141
4,7871141
If you have a multipoint, with one point on the line and the other at the extremity, the line would contains the multipoint... but not if both are on the extremities (nor if one is clearly outside of the line)
â JGH
Sep 5 at 17:56
1
just adding: terminal points are considered to be the boundary of a line, and contains requires at least one point of the interior to intersect the interior of the other - not given for a point on the lines boundary. I used the DE-9IM a lot, out of personal interest and for ultimate control of what relation is to be checked...its a little intense, each time again if not fully concentrated, but it's worth to give it a good read. all relation functions are, of course, only wrappers around this model, and the relation concepts are mostly standardized, e.g. the way contains is interpreted.
â ThingumaBob
Sep 5 at 20:17
the interior of a geometry is always of the expected dimension, the boundary of one lesser. except for points, where both predicates fall on the same entity...thus, a point can contain a point...
â ThingumaBob
Sep 5 at 20:28
no, pardon me, I think that might even be true for points, where per definition there is a null-dimensional border...when I got the time, I'll back all this up with references and add an informative answer. hope I find that time...
â ThingumaBob
Sep 5 at 20:54
SELECT ST_Contains( ST_MakePoint(0,0), ST_MakePoint(0,0) );
returns true.
â Evan Carroll
Sep 5 at 20:57
 |Â
show 1 more comment
If you have a multipoint, with one point on the line and the other at the extremity, the line would contains the multipoint... but not if both are on the extremities (nor if one is clearly outside of the line)
â JGH
Sep 5 at 17:56
1
just adding: terminal points are considered to be the boundary of a line, and contains requires at least one point of the interior to intersect the interior of the other - not given for a point on the lines boundary. I used the DE-9IM a lot, out of personal interest and for ultimate control of what relation is to be checked...its a little intense, each time again if not fully concentrated, but it's worth to give it a good read. all relation functions are, of course, only wrappers around this model, and the relation concepts are mostly standardized, e.g. the way contains is interpreted.
â ThingumaBob
Sep 5 at 20:17
the interior of a geometry is always of the expected dimension, the boundary of one lesser. except for points, where both predicates fall on the same entity...thus, a point can contain a point...
â ThingumaBob
Sep 5 at 20:28
no, pardon me, I think that might even be true for points, where per definition there is a null-dimensional border...when I got the time, I'll back all this up with references and add an informative answer. hope I find that time...
â ThingumaBob
Sep 5 at 20:54
SELECT ST_Contains( ST_MakePoint(0,0), ST_MakePoint(0,0) );
returns true.
â Evan Carroll
Sep 5 at 20:57
If you have a multipoint, with one point on the line and the other at the extremity, the line would contains the multipoint... but not if both are on the extremities (nor if one is clearly outside of the line)
â JGH
Sep 5 at 17:56
If you have a multipoint, with one point on the line and the other at the extremity, the line would contains the multipoint... but not if both are on the extremities (nor if one is clearly outside of the line)
â JGH
Sep 5 at 17:56
1
1
just adding: terminal points are considered to be the boundary of a line, and contains requires at least one point of the interior to intersect the interior of the other - not given for a point on the lines boundary. I used the DE-9IM a lot, out of personal interest and for ultimate control of what relation is to be checked...its a little intense, each time again if not fully concentrated, but it's worth to give it a good read. all relation functions are, of course, only wrappers around this model, and the relation concepts are mostly standardized, e.g. the way contains is interpreted.
â ThingumaBob
Sep 5 at 20:17
just adding: terminal points are considered to be the boundary of a line, and contains requires at least one point of the interior to intersect the interior of the other - not given for a point on the lines boundary. I used the DE-9IM a lot, out of personal interest and for ultimate control of what relation is to be checked...its a little intense, each time again if not fully concentrated, but it's worth to give it a good read. all relation functions are, of course, only wrappers around this model, and the relation concepts are mostly standardized, e.g. the way contains is interpreted.
â ThingumaBob
Sep 5 at 20:17
the interior of a geometry is always of the expected dimension, the boundary of one lesser. except for points, where both predicates fall on the same entity...thus, a point can contain a point...
â ThingumaBob
Sep 5 at 20:28
the interior of a geometry is always of the expected dimension, the boundary of one lesser. except for points, where both predicates fall on the same entity...thus, a point can contain a point...
â ThingumaBob
Sep 5 at 20:28
no, pardon me, I think that might even be true for points, where per definition there is a null-dimensional border...when I got the time, I'll back all this up with references and add an informative answer. hope I find that time...
â ThingumaBob
Sep 5 at 20:54
no, pardon me, I think that might even be true for points, where per definition there is a null-dimensional border...when I got the time, I'll back all this up with references and add an informative answer. hope I find that time...
â ThingumaBob
Sep 5 at 20:54
SELECT ST_Contains( ST_MakePoint(0,0), ST_MakePoint(0,0) );
returns true.â Evan Carroll
Sep 5 at 20:57
SELECT ST_Contains( ST_MakePoint(0,0), ST_MakePoint(0,0) );
returns true.â Evan Carroll
Sep 5 at 20:57
 |Â
show 1 more comment
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fgis.stackexchange.com%2fquestions%2f295064%2fcan-linestring-contain-point%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password