15

Sometimes a person will ask a "How to do X?" question. Then someone comments, "You could use code to implement [general approach Y]." Then the question gets closed as off-topic because they didn't provide a code attempt.

The guidelines for GIS SE make it clear that if you ask for code without making a coding attempt, you won't get an answer. But what about situations where the original poster didn't request code? Even if the best solution would use code, that doesn't make the original question off-topic. Isn't the suggestion to use code a valid answer?

For example, in Calculate viewing angle (2D) between polygons and points, the asker wants to find the locations of the two outermost, points on a polygon that are visible from a given point. After some discussion, another user suggests that this would be best implemented in code. Now this question has 3 close votes. There are some excellent suggestions in the comments, but if the question gets closed then all that work will be lost.

Wouldn't it be better post an answer that recommends a general approach (that could be implemented with code) instead of closing these questions?

2

If a question makes it quite clear that they do not wish to receive code in answers, then I would agree that closing as "needs a code attempt" would be inapplicable.

In this particular question, reviewed alongside its comments that sought various clarifications (and elicited no edits by the asker) it looks like the asker may be asking for coding assistance because they comment that:

The real question is, how do I get the coordinates of the vertices.

From that I think the asker has started looking for coding help, and the close votes only began when the asker had commented to make clear that they were comfortable with the (non-coding) algorithms involved.

Dealing with trigonometry is not a problem

Since what is being asked is unclear, when reading only the question body, and since the asker has not yet taken the Tour, I think the appropriate action is to vote to place the question on hold for being unclear. However, I think a vote to close it for having no code attempt is not unreasonable because deciding how to close/re-open vote is far from an exact science that gets muddied when a comment trail is involved.

Once the asker has a better understanding of our focused Q&A format I think this question could become one (probably more) good focused questions.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .