How can I use line vectors to alter my DEM?
up vote
1
down vote
favorite
I'm trying to use vector lines to change the height of the areas of my DEM that they overlay. They trace rivers, and i'm hoping to assign arbitrarily high values to the rivers so that my least-cost path analyses using r.walk don't constantly try to follow the riverbeds.
What's the best way to do this?
qgis dem
add a comment |
up vote
1
down vote
favorite
I'm trying to use vector lines to change the height of the areas of my DEM that they overlay. They trace rivers, and i'm hoping to assign arbitrarily high values to the rivers so that my least-cost path analyses using r.walk don't constantly try to follow the riverbeds.
What's the best way to do this?
qgis dem
1
GDAL_Rasterize will create a raster from your lines.. are they 3d lines? If not how is your arbitrarily high value stored?
– Michael Stimson
4 hours ago
They aren't 3d lines. I just added an attribute to the table named "elevation" and set it to 9999. <br> I rasterized the line vectors, but now can't seem to merge it with the existing DEM successfully. What should I be doing to make this happen?
– BogBody
4 hours ago
You could try GDAL_Merge but it's not immediately clear which raster takes precedence where two or more overlap or use the raster calculator docs.qgis.org/2.8/en/docs/user_manual/working_with_raster/… with an expression that selects where your rivers is nodata docs.qgis.org/2.8/en/docs/training_manual/processing/… then use the DEM otherwise use the rivers.
– Michael Stimson
4 hours ago
add a comment |
up vote
1
down vote
favorite
up vote
1
down vote
favorite
I'm trying to use vector lines to change the height of the areas of my DEM that they overlay. They trace rivers, and i'm hoping to assign arbitrarily high values to the rivers so that my least-cost path analyses using r.walk don't constantly try to follow the riverbeds.
What's the best way to do this?
qgis dem
I'm trying to use vector lines to change the height of the areas of my DEM that they overlay. They trace rivers, and i'm hoping to assign arbitrarily high values to the rivers so that my least-cost path analyses using r.walk don't constantly try to follow the riverbeds.
What's the best way to do this?
qgis dem
qgis dem
asked 4 hours ago
BogBody
617
617
1
GDAL_Rasterize will create a raster from your lines.. are they 3d lines? If not how is your arbitrarily high value stored?
– Michael Stimson
4 hours ago
They aren't 3d lines. I just added an attribute to the table named "elevation" and set it to 9999. <br> I rasterized the line vectors, but now can't seem to merge it with the existing DEM successfully. What should I be doing to make this happen?
– BogBody
4 hours ago
You could try GDAL_Merge but it's not immediately clear which raster takes precedence where two or more overlap or use the raster calculator docs.qgis.org/2.8/en/docs/user_manual/working_with_raster/… with an expression that selects where your rivers is nodata docs.qgis.org/2.8/en/docs/training_manual/processing/… then use the DEM otherwise use the rivers.
– Michael Stimson
4 hours ago
add a comment |
1
GDAL_Rasterize will create a raster from your lines.. are they 3d lines? If not how is your arbitrarily high value stored?
– Michael Stimson
4 hours ago
They aren't 3d lines. I just added an attribute to the table named "elevation" and set it to 9999. <br> I rasterized the line vectors, but now can't seem to merge it with the existing DEM successfully. What should I be doing to make this happen?
– BogBody
4 hours ago
You could try GDAL_Merge but it's not immediately clear which raster takes precedence where two or more overlap or use the raster calculator docs.qgis.org/2.8/en/docs/user_manual/working_with_raster/… with an expression that selects where your rivers is nodata docs.qgis.org/2.8/en/docs/training_manual/processing/… then use the DEM otherwise use the rivers.
– Michael Stimson
4 hours ago
1
1
GDAL_Rasterize will create a raster from your lines.. are they 3d lines? If not how is your arbitrarily high value stored?
– Michael Stimson
4 hours ago
GDAL_Rasterize will create a raster from your lines.. are they 3d lines? If not how is your arbitrarily high value stored?
– Michael Stimson
4 hours ago
They aren't 3d lines. I just added an attribute to the table named "elevation" and set it to 9999. <br> I rasterized the line vectors, but now can't seem to merge it with the existing DEM successfully. What should I be doing to make this happen?
– BogBody
4 hours ago
They aren't 3d lines. I just added an attribute to the table named "elevation" and set it to 9999. <br> I rasterized the line vectors, but now can't seem to merge it with the existing DEM successfully. What should I be doing to make this happen?
– BogBody
4 hours ago
You could try GDAL_Merge but it's not immediately clear which raster takes precedence where two or more overlap or use the raster calculator docs.qgis.org/2.8/en/docs/user_manual/working_with_raster/… with an expression that selects where your rivers is nodata docs.qgis.org/2.8/en/docs/training_manual/processing/… then use the DEM otherwise use the rivers.
– Michael Stimson
4 hours ago
You could try GDAL_Merge but it's not immediately clear which raster takes precedence where two or more overlap or use the raster calculator docs.qgis.org/2.8/en/docs/user_manual/working_with_raster/… with an expression that selects where your rivers is nodata docs.qgis.org/2.8/en/docs/training_manual/processing/… then use the DEM otherwise use the rivers.
– Michael Stimson
4 hours ago
add a comment |
1 Answer
1
active
oldest
votes
up vote
2
down vote
First of all, it is quite logic that r.walk guide you along the riverbed. This is usually the path to walk along. If you change the rivers values to 9999, you will create artificial cliff that will be difficult to cross, and if you climb on it you will try to stay on it. Otherwise, you will just follow the riverbed with one pixel shift. I would instead suggest to use the rasterized river as a friction layer or to play with some parameters of r.walk
That being said, you can achieve what you want to do by combining the two comments to your question.
1) use gdal_rasterize to convert your lines to raster based on your attribute field that contains the 9999 values.
2) use the raster calculator to update your DEM with the new raster value
("yourrivers@1" < 9999) * "yourdem@1" + ("yourrivers@1" >= 9999) * 9999
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
2
down vote
First of all, it is quite logic that r.walk guide you along the riverbed. This is usually the path to walk along. If you change the rivers values to 9999, you will create artificial cliff that will be difficult to cross, and if you climb on it you will try to stay on it. Otherwise, you will just follow the riverbed with one pixel shift. I would instead suggest to use the rasterized river as a friction layer or to play with some parameters of r.walk
That being said, you can achieve what you want to do by combining the two comments to your question.
1) use gdal_rasterize to convert your lines to raster based on your attribute field that contains the 9999 values.
2) use the raster calculator to update your DEM with the new raster value
("yourrivers@1" < 9999) * "yourdem@1" + ("yourrivers@1" >= 9999) * 9999
add a comment |
up vote
2
down vote
First of all, it is quite logic that r.walk guide you along the riverbed. This is usually the path to walk along. If you change the rivers values to 9999, you will create artificial cliff that will be difficult to cross, and if you climb on it you will try to stay on it. Otherwise, you will just follow the riverbed with one pixel shift. I would instead suggest to use the rasterized river as a friction layer or to play with some parameters of r.walk
That being said, you can achieve what you want to do by combining the two comments to your question.
1) use gdal_rasterize to convert your lines to raster based on your attribute field that contains the 9999 values.
2) use the raster calculator to update your DEM with the new raster value
("yourrivers@1" < 9999) * "yourdem@1" + ("yourrivers@1" >= 9999) * 9999
add a comment |
up vote
2
down vote
up vote
2
down vote
First of all, it is quite logic that r.walk guide you along the riverbed. This is usually the path to walk along. If you change the rivers values to 9999, you will create artificial cliff that will be difficult to cross, and if you climb on it you will try to stay on it. Otherwise, you will just follow the riverbed with one pixel shift. I would instead suggest to use the rasterized river as a friction layer or to play with some parameters of r.walk
That being said, you can achieve what you want to do by combining the two comments to your question.
1) use gdal_rasterize to convert your lines to raster based on your attribute field that contains the 9999 values.
2) use the raster calculator to update your DEM with the new raster value
("yourrivers@1" < 9999) * "yourdem@1" + ("yourrivers@1" >= 9999) * 9999
First of all, it is quite logic that r.walk guide you along the riverbed. This is usually the path to walk along. If you change the rivers values to 9999, you will create artificial cliff that will be difficult to cross, and if you climb on it you will try to stay on it. Otherwise, you will just follow the riverbed with one pixel shift. I would instead suggest to use the rasterized river as a friction layer or to play with some parameters of r.walk
That being said, you can achieve what you want to do by combining the two comments to your question.
1) use gdal_rasterize to convert your lines to raster based on your attribute field that contains the 9999 values.
2) use the raster calculator to update your DEM with the new raster value
("yourrivers@1" < 9999) * "yourdem@1" + ("yourrivers@1" >= 9999) * 9999
edited 3 hours ago
answered 3 hours ago
radouxju
39.4k140112
39.4k140112
add a comment |
add a comment |
Thanks for contributing an answer to Geographic Information Systems Stack Exchange!
- 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.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- 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%2fgis.stackexchange.com%2fquestions%2f305513%2fhow-can-i-use-line-vectors-to-alter-my-dem%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
1
GDAL_Rasterize will create a raster from your lines.. are they 3d lines? If not how is your arbitrarily high value stored?
– Michael Stimson
4 hours ago
They aren't 3d lines. I just added an attribute to the table named "elevation" and set it to 9999. <br> I rasterized the line vectors, but now can't seem to merge it with the existing DEM successfully. What should I be doing to make this happen?
– BogBody
4 hours ago
You could try GDAL_Merge but it's not immediately clear which raster takes precedence where two or more overlap or use the raster calculator docs.qgis.org/2.8/en/docs/user_manual/working_with_raster/… with an expression that selects where your rivers is nodata docs.qgis.org/2.8/en/docs/training_manual/processing/… then use the DEM otherwise use the rivers.
– Michael Stimson
4 hours ago