Can LINESTRING “contain” POINT?

The name of the pictureThe name of the pictureThe name of the pictureClash 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 and Within 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?










share|improve this question





























    up vote
    7
    down vote

    favorite












    According to Wikipedia,




    The predicates Contains and Within 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?










    share|improve this question

























      up vote
      7
      down vote

      favorite









      up vote
      7
      down vote

      favorite











      According to Wikipedia,




      The predicates Contains and Within 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?










      share|improve this question















      According to Wikipedia,




      The predicates Contains and Within 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






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Sep 15 at 10:07









      PolyGeo♦

      51.9k1777233




      51.9k1777233










      asked Sep 5 at 17:41









      Evan Carroll

      4,7871141




      4,7871141




















          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.






          share|improve this answer




















          • 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










          Your Answer







          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "79"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          convertImagesToLinks: false,
          noModals: false,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













           

          draft saved


          draft discarded


















          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






























          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.






          share|improve this answer




















          • 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














          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.






          share|improve this answer




















          • 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












          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.






          share|improve this answer












          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.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          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
















          • 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

















           

          draft saved


          draft discarded















































           


          draft saved


          draft discarded














          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













































































          Popular posts from this blog

          How to check contact read email or not when send email to Individual?

          Displaying single band from multi-band raster using QGIS

          How many registers does an x86_64 CPU actually have?