I have a road network in a PostGis database (db_routing). In another database (db_environment), I have some spatial features of the surrounding environment (trees as points and water bodies as polygons for example).
I would like to assign costs to my road segments depending on the surrounding environment. I envisage two possibilities:
through a raster: I can create a raster and each cell will have a cost depending on the features from db_environment it contains (trees density and presence or no of water for example). Then, I would have to give a cost to the road segments depending on the raster cells they intersect.
through a vector layer: I could run a proximity analysis around each of my road segments, by creating a buffer around it and looking at the features from db_environment contained in this buffer.
It seems to me that it would be easier to create a raster (by using simple mathematical additions to take the different cost into account, instead of performing spatial clips with a vector).
Do you have ideas on this, or examples of similar projects ?
Thanks in advance
Update
Some thoughts on the pros and cons of each method:
Raster
- Advantages: Easy to add incrementally more and more cost factors by using simple mathematical operations
- Disadvantages: Complex to choose the right pixel size, and to find a proper way to transfer this data to the road network vector
Vector
- Advantages: Efficient to perform proximity analysis
- Disadvantages: Bad representation for continuous data