Computing an event offset using NetTopologySuite?
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
add a comment |
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
add a comment |
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
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
nettopologysuite
asked Nov 14 '18 at 17:27
Corey AlixCorey Alix
1,38921431
1,38921431
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
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)
public Coordinate extractPoint(LinearLocation index, double offsetDistance)
index
- the index of the desired pointoffsetDistance
- 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
add a comment |
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)
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
add a comment |
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
});
}
});
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
Required, but never shown
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
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)
public Coordinate extractPoint(LinearLocation index, double offsetDistance)
index
- the index of the desired pointoffsetDistance
- 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
add a comment |
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)
public Coordinate extractPoint(LinearLocation index, double offsetDistance)
index
- the index of the desired pointoffsetDistance
- 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
add a comment |
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)
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)
answered Dec 8 '18 at 20:52
FObermaierFObermaier
1876
1876
public Coordinate extractPoint(LinearLocation index, double offsetDistance)
index
- the index of the desired pointoffsetDistance
- 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
add a comment |
public Coordinate extractPoint(LinearLocation index, double offsetDistance)
index
- the index of the desired pointoffsetDistance
- 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
add a comment |
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)
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
add a comment |
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)
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
add a comment |
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)
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)
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
add a comment |
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
add a comment |
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.
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
Required, but never shown
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
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
Required, but never shown
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
Required, but never shown
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
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