[GRASS-user] filling inter-contour area with constant value
raghavan at media.osaka-cu.ac.jp
Wed Apr 30 20:06:52 PDT 2014
Huidae, Moritz and all,
Many thanks for you suggestions for filling inter-contour area with
I will try them out and report back.
On 5/1/2014 4:03 AM, Huidae Cho wrote:
> Ah.. if you have two adjacent contour lines that are farther than the
> contour interval from each other, my method doesn't work. For example, 100,
> 102, and 106 will become 101, 103, and 107, not 101, 104, and 107 (what
> should the max value be?).
> On Wed, Apr 30, 2014 at 2:50 PM, Huidae Cho <grass4u at gmail.com> wrote:
>> Let's say you have the elevation field in your shapefile and the contour
>> interval is 2 meters.
>> # Import your shapefile into GRASS
>> v.in.ogr dsn=contours.shp output=contours type=boundary
>> # Add centroids to the imported boundaries to make areas
>> v.centroids input=contours output=contourareas
>> # Convert the contour areas to raster filling inter-contour areas with
>> contour elevations
>> v.to.rast input=contourareas output=contourareas use=attr
>> # Now you want to add a half of the contour interval to get what you want
>> r.mapcalc expression="contoursteps=contourareas+1"
>> contoursteps is what you need, I think.
>> On Tue, Apr 29, 2014 at 4:19 AM, Moritz Lennert <
>> mlennert at club.worldonline.be> wrote:
>>> [Please keep threads on the list]
>>> On 29/04/14 00:33, John Ciolek wrote:
>>>> Hi Moritz.
>>>> What do you mean by the following suggestion?
>>>> On Apr 28, 2014, at 2:45 AM, Moritz Lennert wrote:
>>>> - if necessary, add a line at the edge of the region and patch that
>>>>> with your contour lines to close polygons (v.in.region, v.patch)
>>>> Are you suggesting that you can close a contour (connect the beginning
>>>> point to the ending point) using v.in.region or v.patch?
>>> No, not the beginning point to the end point. Either you have closed
>>> contours or your contours go over the edge of your current region, meaning
>>> that some contours are not closed. So, in order to close them, you can do
>>> so arbitrarily at the edge of your region by patching in a line that
>>> represents that edge. This line can be created with v.in.region.
>>> grass-user mailing list
>>> grass-user at lists.osgeo.org
> grass-user mailing list
> grass-user at lists.osgeo.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the grass-user