Computing an event offset using NetTopologySuite?












0















Does NetTopologySuite have the tools necessary to compute a point a given distance along and away from a polyline offset in a perpendicular direction?



This would be for placing signs on a map that are described as 3.1 miles along route 242, 50 feet from the centerline. I've discovered NetTopologySuite.Geometries.Triangle.PerpendicularBisector, but it's not making much sense to me (seems to return a formula for the perpendicular line).










share|improve this question



























    0















    Does NetTopologySuite have the tools necessary to compute a point a given distance along and away from a polyline offset in a perpendicular direction?



    This would be for placing signs on a map that are described as 3.1 miles along route 242, 50 feet from the centerline. I've discovered NetTopologySuite.Geometries.Triangle.PerpendicularBisector, but it's not making much sense to me (seems to return a formula for the perpendicular line).










    share|improve this question

























      0












      0








      0








      Does NetTopologySuite have the tools necessary to compute a point a given distance along and away from a polyline offset in a perpendicular direction?



      This would be for placing signs on a map that are described as 3.1 miles along route 242, 50 feet from the centerline. I've discovered NetTopologySuite.Geometries.Triangle.PerpendicularBisector, but it's not making much sense to me (seems to return a formula for the perpendicular line).










      share|improve this question














      Does NetTopologySuite have the tools necessary to compute a point a given distance along and away from a polyline offset in a perpendicular direction?



      This would be for placing signs on a map that are described as 3.1 miles along route 242, 50 feet from the centerline. I've discovered NetTopologySuite.Geometries.Triangle.PerpendicularBisector, but it's not making much sense to me (seems to return a formula for the perpendicular line).







      nettopologysuite






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 14 '18 at 17:27









      Corey AlixCorey Alix

      1,38921431




      1,38921431
























          2 Answers
          2






          active

          oldest

          votes


















          1














          To get a single point offset off a lineal geometry you should use LocationIndexedLine:



          var gf = new NetTopologySuite.Geometries.GeometryFactory();
          var l = gf.CreateLineString(new GeoAPI.Geometries.Coordinate
          {
          new GeoAPI.Geometries.Coordinate(10, 10),
          new GeoAPI.Geometries.Coordinate(1000, 10),
          });

          var lid = new NetTopologySuite.LinearReferencing.LocationIndexedLine(l);
          var p = lid.ExtractPoint(500, 10);


          p is at (510, 20)






          share|improve this answer
























          • public Coordinate extractPoint(LinearLocation index, double offsetDistance) index - the index of the desired point offsetDistance - the distance the point is offset from the segment (positive is to the left, negative is to the right)

            – Corey Alix
            Dec 8 '18 at 23:05



















          1














          Yes, probably several ways. One way you could do it is to use a buffer from the center line (look into NetTopologySuite.Operation.Buffer.BufferOp.Buffer), then just find a point 'x' distance along the buffered geometry (NetTopologySuite.Operation.Distance.DistanceOp.Distance)






          share|improve this answer
























          • I see -- or I could buffer the line itself and then look for the closest point from a point on the centerline to the buffered geometry. It seems computationally heavy-handed but it should work.

            – Corey Alix
            Nov 17 '18 at 11:58











          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          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',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53305727%2fcomputing-an-event-offset-using-nettopologysuite%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          2 Answers
          2






          active

          oldest

          votes








          2 Answers
          2






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          1














          To get a single point offset off a lineal geometry you should use LocationIndexedLine:



          var gf = new NetTopologySuite.Geometries.GeometryFactory();
          var l = gf.CreateLineString(new GeoAPI.Geometries.Coordinate
          {
          new GeoAPI.Geometries.Coordinate(10, 10),
          new GeoAPI.Geometries.Coordinate(1000, 10),
          });

          var lid = new NetTopologySuite.LinearReferencing.LocationIndexedLine(l);
          var p = lid.ExtractPoint(500, 10);


          p is at (510, 20)






          share|improve this answer
























          • public Coordinate extractPoint(LinearLocation index, double offsetDistance) index - the index of the desired point offsetDistance - the distance the point is offset from the segment (positive is to the left, negative is to the right)

            – Corey Alix
            Dec 8 '18 at 23:05
















          1














          To get a single point offset off a lineal geometry you should use LocationIndexedLine:



          var gf = new NetTopologySuite.Geometries.GeometryFactory();
          var l = gf.CreateLineString(new GeoAPI.Geometries.Coordinate
          {
          new GeoAPI.Geometries.Coordinate(10, 10),
          new GeoAPI.Geometries.Coordinate(1000, 10),
          });

          var lid = new NetTopologySuite.LinearReferencing.LocationIndexedLine(l);
          var p = lid.ExtractPoint(500, 10);


          p is at (510, 20)






          share|improve this answer
























          • public Coordinate extractPoint(LinearLocation index, double offsetDistance) index - the index of the desired point offsetDistance - the distance the point is offset from the segment (positive is to the left, negative is to the right)

            – Corey Alix
            Dec 8 '18 at 23:05














          1












          1








          1







          To get a single point offset off a lineal geometry you should use LocationIndexedLine:



          var gf = new NetTopologySuite.Geometries.GeometryFactory();
          var l = gf.CreateLineString(new GeoAPI.Geometries.Coordinate
          {
          new GeoAPI.Geometries.Coordinate(10, 10),
          new GeoAPI.Geometries.Coordinate(1000, 10),
          });

          var lid = new NetTopologySuite.LinearReferencing.LocationIndexedLine(l);
          var p = lid.ExtractPoint(500, 10);


          p is at (510, 20)






          share|improve this answer













          To get a single point offset off a lineal geometry you should use LocationIndexedLine:



          var gf = new NetTopologySuite.Geometries.GeometryFactory();
          var l = gf.CreateLineString(new GeoAPI.Geometries.Coordinate
          {
          new GeoAPI.Geometries.Coordinate(10, 10),
          new GeoAPI.Geometries.Coordinate(1000, 10),
          });

          var lid = new NetTopologySuite.LinearReferencing.LocationIndexedLine(l);
          var p = lid.ExtractPoint(500, 10);


          p is at (510, 20)







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Dec 8 '18 at 20:52









          FObermaierFObermaier

          1876




          1876













          • public Coordinate extractPoint(LinearLocation index, double offsetDistance) index - the index of the desired point offsetDistance - the distance the point is offset from the segment (positive is to the left, negative is to the right)

            – Corey Alix
            Dec 8 '18 at 23:05



















          • public Coordinate extractPoint(LinearLocation index, double offsetDistance) index - the index of the desired point offsetDistance - the distance the point is offset from the segment (positive is to the left, negative is to the right)

            – Corey Alix
            Dec 8 '18 at 23:05

















          public Coordinate extractPoint(LinearLocation index, double offsetDistance) index - the index of the desired point offsetDistance - the distance the point is offset from the segment (positive is to the left, negative is to the right)

          – Corey Alix
          Dec 8 '18 at 23:05





          public Coordinate extractPoint(LinearLocation index, double offsetDistance) index - the index of the desired point offsetDistance - the distance the point is offset from the segment (positive is to the left, negative is to the right)

          – Corey Alix
          Dec 8 '18 at 23:05













          1














          Yes, probably several ways. One way you could do it is to use a buffer from the center line (look into NetTopologySuite.Operation.Buffer.BufferOp.Buffer), then just find a point 'x' distance along the buffered geometry (NetTopologySuite.Operation.Distance.DistanceOp.Distance)






          share|improve this answer
























          • I see -- or I could buffer the line itself and then look for the closest point from a point on the centerline to the buffered geometry. It seems computationally heavy-handed but it should work.

            – Corey Alix
            Nov 17 '18 at 11:58
















          1














          Yes, probably several ways. One way you could do it is to use a buffer from the center line (look into NetTopologySuite.Operation.Buffer.BufferOp.Buffer), then just find a point 'x' distance along the buffered geometry (NetTopologySuite.Operation.Distance.DistanceOp.Distance)






          share|improve this answer
























          • I see -- or I could buffer the line itself and then look for the closest point from a point on the centerline to the buffered geometry. It seems computationally heavy-handed but it should work.

            – Corey Alix
            Nov 17 '18 at 11:58














          1












          1








          1







          Yes, probably several ways. One way you could do it is to use a buffer from the center line (look into NetTopologySuite.Operation.Buffer.BufferOp.Buffer), then just find a point 'x' distance along the buffered geometry (NetTopologySuite.Operation.Distance.DistanceOp.Distance)






          share|improve this answer













          Yes, probably several ways. One way you could do it is to use a buffer from the center line (look into NetTopologySuite.Operation.Buffer.BufferOp.Buffer), then just find a point 'x' distance along the buffered geometry (NetTopologySuite.Operation.Distance.DistanceOp.Distance)







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Nov 17 '18 at 0:25









          tvaltval

          1027




          1027













          • I see -- or I could buffer the line itself and then look for the closest point from a point on the centerline to the buffered geometry. It seems computationally heavy-handed but it should work.

            – Corey Alix
            Nov 17 '18 at 11:58



















          • I see -- or I could buffer the line itself and then look for the closest point from a point on the centerline to the buffered geometry. It seems computationally heavy-handed but it should work.

            – Corey Alix
            Nov 17 '18 at 11:58

















          I see -- or I could buffer the line itself and then look for the closest point from a point on the centerline to the buffered geometry. It seems computationally heavy-handed but it should work.

          – Corey Alix
          Nov 17 '18 at 11:58





          I see -- or I could buffer the line itself and then look for the closest point from a point on the centerline to the buffered geometry. It seems computationally heavy-handed but it should work.

          – Corey Alix
          Nov 17 '18 at 11:58


















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53305727%2fcomputing-an-event-offset-using-nettopologysuite%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Bressuire

          Vorschmack

          Quarantine