6

Background

I'm trying to make contour/isoline/isochrone maps to show what areas are within walking distance to schools for my pet project to help with the Safe Routes to School program. I followed the pgRouting workshop and underdark's posts (all linked to from my project page) to import OpenStreetMap into a PostGIS database, then used the driving_distance() function to create a point layer that had a cost attribute, then ran the contour plugin of Quantum GIS to create contour lines, which I then styled in QGIS to create this image (pardon the spurious lines, not sure where they came from):

enter image description here

What I'd like to do

I'd like to replace the QGIS contour plugin and styling feature with GRASS, as I'd like to create this image dynamically for a web service, and I don't think QGIS is meant for that (at least performance-wise, I think it may be possible with Python). So I'm trying to figure out how to do this same thing with GRASS, which appears to be used quite a bit in web services.

From my reading, it appears I'll want to use something like v.surf.rst, though that seems like it would generate more of a heat map with a gradient, rather than the type of image shown above with solid colors for each band (in this case each band is 1/4 mile).

1 Answer 1

10

After using v.surf.rst, it's only a question about how to display the resulting cost raster.

GRASS offers r.colors to specify a color map for a raster. As far as I can see, the normal behavior of GRASS is to interpolate colors, so you you'll have to work around this:

r.colors map=travel_costs color=rules 
0 green
100 green 
101 yellow
200 yellow
201 red 
300 red 
end
1
  • After getting v.surf.rst working correctly (I forgot to set the proper region), this worked perfectly. Thanks!
    – joshdoe
    Commented Aug 20, 2011 at 2:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.