[GRASS-user] Shapefile to Surface
Markus Metz
markus.metz.giswork at googlemail.com
Mon Jan 31 11:00:38 EST 2011
On Mon, Jan 31, 2011 at 4:32 PM, leonidas <leonidas_liakos at yahoo.gr> wrote:
>
> I need to convert a shapefile (that stores data as grid points (lattices in
> arcinfo terminology), 150m x 150m for wind velocity). You can see the
> shapefile contents here: http://flic.kr/p/9eAZr3
>
> Then I tried to generate a surface in grass as follow:
> 1. I converted the shapefile to csv with :
> ogr2ogr -f CSV output.csv input.shp -lco GEOMETRY=AS_XY
> The csv contents are like that:
>
> 105000|4422900|8.36855000
> 105150|4422900|7.85873000
> 105000|4422750|9.67642000
> ..........................................
> ........................
> ............
>
> 2. Then, I used r.in.xyz to generate the surface.
>
> Unfortunately, the generated raster was again another grid of points (image:
> http://flic.kr/p/9exTT4)
r.inxyz would give you a surface if the region is set to the spacing
of the points, i.e. 150mx150m, and the region should preferably be set
such that the vector points fall into cell centers.
If you want to get a surface with a finer resolution, you could import
the shapefile as is (as 3D if possible) and then use any of the
v.surf.* modules to interpolate a raster surface from the vector
points.
Or use your existing raster with r.resamp.rst or one of the "IDW from
raster points" modules.
Markus M
More information about the grass-user
mailing list