EcoGIS / CAPS-Scenario-Builder

The CAPS Scenario Builder will allow government officials, conservation groups and others to submit "scenarios" for proposed changes to land cover and infrastructure so that these changes can be assessed for their impact on ecological integrity.
http://www.umass.edu/landeco/research/caps/caps.html
3 stars 0 forks source link

Issue: snapping roads #13

Closed ghost closed 12 years ago

ghost commented 12 years ago

Win 7 SP 1 - We'd talked about snapping new roads to existing (grid) roads, as well as to other new (line) roads. Looks like it's not there.

bobenglish commented 12 years ago

The app currently snaps new terrestrial passage structures (points) to new roads (lines), which was the only snapping I understood needed to be included after the last meeting. If I am understanding the issue correctly, you would like to snap new roads to existing roads. It also sounds like you would like to snap new roads to new roads when a new road is drawn near a previously saved new road. Since the snapping code is already written, it may not be very difficult to include this in the next version, and I will look into it. Please let me know if I am misunderstanding the issue.

ghost commented 12 years ago

Yup, you've got it. I thought this was something we'd discussed before. I think we'll want it, because it will be easy to leave a slight gap between roads when digitizing them in, and gaps in roads have serious implications for CAPS.

bobenglish commented 12 years ago

OK. Will do when I do the debugging.

bobenglish commented 12 years ago

New roads now have the constraint that the first point must be on an existing road. If the first point clicked for a new road is near a previously saved new road, then it will snap to the previously saved new road and meet constraints. I also threw in snapping culverts to new roads. The app will check if the culvert is near a new road, if it is, it will snap to the new road and then check that the snapped point is also on a stream. I also added code to the pastedFeatures method to check that lines pasted from a user's layer must have a first point that starts on an existing road or new road.

Issue closed

bobenglish commented 12 years ago

Correction on the above. Lines (new roads) pasted from users' vector layers are only checked to see if the beginning or end of the pasted line starts on a road that exists in base_traffic.tif. There is no easy way to check if a vector line intersects another vector line, other than snapping one line to another. If I snapped a user's pasted line to a "new" road in the scenario, I would have to change the user's pasted data, which I think is unacceptable. Let me know if you can think of any problems with this behavior, like what if a user's pasted line crosses a "new" road in the scenario? What if a user's pasted line starts on an existing road but crosses another existing road? Are the constraints I've described above sufficient? Let me know if the app behavior described presents any problems. Thanks.

ghost commented 12 years ago

My leaning would be to snap new roads to other new roads (within a distance of maybe 50 m or so). When I'm digitizing linework, I always have snapping on--otherwise you get breaks in the linework, often too small to notice, but large enough to cause trouble. Why do you think this would be unacceptable?

bobenglish commented 12 years ago

Hi Brad,

Hope you doing well. I'm liking that the days are getting longer, but I'm freaked out that the winter has been so warm. Anyway, info on the "new" roads stuff below:

New roads do snap to new roads when adding new roads with the line tool, or they must start on an existing road if they don't snap to a new road. You can draw and save as many line segments as you want, and each one will snap to the previous one if you start it nearby.

However, when a user copies lines from a layer of their own and then pastes the lines into an editing layer, I only check to see if each line that was pasted begins or ends on an existing road. If any of them don't then the user can't paste any of them.

The only reasonably doable way I can make sure a "pasted" road begins or ends on a "new" road that the user has previously added to the "edit_scenario (lines)" layer would be to "snap" the pasted road if it is near the new road on the editing layer. This would require substituting the "snapped" point for a point in the user's pasted data, so we would be changing the user's data, which they may or may not want us to do. Also, it's difficult to alter the pasted data in that way, especially if multiple lines are being pasted. Finally, we would have to prompt them to ask them about it, and then be able to roll it back if they don't like it. Very complicated.

The way it is now. New roads must begin on a new or existing road whether they are pasted or drawn, so there can't be any gaps. The only disadvantage is that users can't "paste" roads meant to begin on "new" roads they have previously added to the scenario. They would have to draw them. I think this probably works for you. Let me know if it doesn't

Hope this is clear, ...Bob

On Thu, Feb 9, 2012 at 9:57 AM, BradCompton reply@reply.github.com wrote:

My leaning would be to snap new roads to other new roads (within a distance of maybe 50 m or so).  When I'm digitizing linework, I always have snapping on--otherwise you get breaks in the linework, often too small to notice, but large enough to cause trouble.  Why do you think this would be unacceptable?


Reply to this email directly or view it on GitHub: https://github.com/EcoGIS/CAPS-Scenario-Builder/issues/13#issuecomment-3888562

Daystar ...computing and research services 367 Four Mile Brook Rd. Northfield, MA 01360 Phone: (413)834-2076 Fax: (978)882-0243 bobengl@gmail.com Check out the updated CV/Resume: http://edaystar.com

ghost commented 12 years ago

Hi Bob,

I'm sorry--I didn't realize that only applied to pasted roads. Yeah, I agree that we don't want to muck with pasted roads. I think the way you've got it is right.

I have mixed feelings about this non-winter. It's mostly kind of creepy, but it feels like we've been perched on the edge of spring for weeks now, and the edge of spring is my favorite time of year....but it's strange to be stalled in March.

Brad

On 9 Feb 2012 4:47 PM, Bob English wrote:

Hi Brad,

Hope you doing well. I'm liking that the days are getting longer, but I'm freaked out that the winter has been so warm. Anyway, info on the "new" roads stuff below:

New roads do snap to new roads when adding new roads with the line tool, or they must start on an existing road if they don't snap to a new road. You can draw and save as many line segments as you want, and each one will snap to the previous one if you start it nearby.

However, when a user copies lines from a layer of their own and then pastes the lines into an editing layer, I only check to see if each line that was pasted begins or ends on an existing road. If any of them don't then the user can't paste any of them.

The only reasonably doable way I can make sure a "pasted" road begins or ends on a "new" road that the user has previously added to the "edit_scenario (lines)" layer would be to "snap" the pasted road if it is near the new road on the editing layer. This would require substituting the "snapped" point for a point in the user's pasted data, so we would be changing the user's data, which they may or may not want us to do. Also, it's difficult to alter the pasted data in that way, especially if multiple lines are being pasted. Finally, we would have to prompt them to ask them about it, and then be able to roll it back if they don't like it. Very complicated.

The way it is now. New roads must begin on a new or existing road whether they are pasted or drawn, so there can't be any gaps. The only disadvantage is that users can't "paste" roads meant to begin on "new" roads they have previously added to the scenario. They would have to draw them. I think this probably works for you. Let me know if it doesn't

Hope this is clear, ...Bob

On Thu, Feb 9, 2012 at 9:57 AM, BradCompton reply@reply.github.com wrote:

My leaning would be to snap new roads to other new roads (within a distance of maybe 50 m or so). When I'm digitizing linework, I always have snapping on--otherwise you get breaks in the linework, often too small to notice, but large enough to cause trouble. Why do you think this would be unacceptable?


Reply to this email directly or view it on GitHub: https://github.com/EcoGIS/CAPS-Scenario-Builder/issues/13#issuecomment-3888562

Bradley W. Compton Research Associate Department of Environmental Conservation Holdsworth Natural Resources Center University of Massachusetts Amherst, MA 01003 (413) 577-2179 Fax: (413) 545-4358 bcompton@eco.umass.edu

bobenglish commented 12 years ago

On Thu, Feb 9, 2012 at 5:08 PM, BradCompton reply@reply.github.com wrote:

Hi Bob,

I'm sorry--I didn't realize that only applied to pasted roads.  Yeah, I agree that we don't want to muck with pasted roads.  I think the way you've got it is right.

No problem. By the way, once a user has copied and pasted a new road into the editing layer, they can draw new roads that will snap to the pasted road.

I have mixed feelings about this non-winter.  It's mostly kind of creepy, but it feels like we've been perched on the edge of spring for weeks now, and the edge of spring is my favorite time of year....but it's strange to be stalled in March.

I know what you mean by the "mixed feelings." I've liked that I didn't have to plow too much and have been able to get outside and enjoy warm sunny days. On the other hand, the weather changes that have happened over the last 25 years seem to me to be dramatic, and changes will probably happen faster over the next 25 years. Scary thought if you have kids, which I don't. My girlfriend Stephanie has 3 daughters in their 20's, and she just doesn't want to think about it.

...Bob