-
-
Notifications
You must be signed in to change notification settings - Fork 323
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
v.to.rast: Add points without segfault with densification flag (-d) #3440
base: main
Are you sure you want to change the base?
v.to.rast: Add points without segfault with densification flag (-d) #3440
Conversation
01b0516
to
d868f5c
Compare
/* point plotting, alternative to G_plot_point() | ||
* x, y are col, row numbers */ | ||
void plot_point(double east, double north) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it is an alternative, does that mean that if changes to the G_plot_point() are made, they may need to be kept in sync/compatible with the function here? If so, should we add a note in the comments of G_plot_point() to refer back here (to not forget in the future)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a good idea.
x = ifloor(X(G_adjust_easting(east, &st->window)) + 0.5); | ||
y = ifloor(Y(north) + 0.5); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reason why not to use G_plot_where_xy
here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
st
in G_plot_where_xy()
is static and internal to libgis. dense_line.c
has its own st
.
This PR addresses #3105. It implements a new
plot_point()
function that uses the internalstate
indense_line.c
. CallingG_plot_point()
with-d
flag causes a segfault because the staticstate
inlibgis
is not shared with any modules.