Venka,

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
attrcolumn=elevation

# 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.

Regards,
Huidae



On Tue, Apr 29, 2014 at 4:19 AM, Moritz Lennert <
[email protected]> 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.
>
>
> Moritz
> _______________________________________________
> grass-user mailing list
> [email protected]
> http://lists.osgeo.org/mailman/listinfo/grass-user
>
_______________________________________________
grass-user mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/grass-user

Reply via email to