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)
So, how can I generate a raster surface from a shapefile like that? Do I
need to use v.surf.idw or is any faster way
Do I need a data conversion or interpolation?
Thank you, Leonidas!
--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/Shapefile-to-Surface-tp5977485p5977485.html
Sent from the Grass - Users mailing list archive at Nabble.com.
On Mon, Jan 31, 2011 at 4:32 PM, leonidas <leonidas_liakos@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
Markus thank you!
I used r.in.xyz according to your instructions.
I set the region as follow:
g.region -a res=150
And then r.in.xyz to generate the surface.
The points are not located in the center of the cells but on the upper left
corner. Is that a feature or I made a mistake with the region settings?
--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/Shapefile-to-Surface-tp5977485p5978538.html
Sent from the Grass - Users mailing list archive at Nabble.com.
On Mon, Jan 31, 2011 at 9:29 PM, leonidas <leonidas_liakos@yahoo.gr> wrote:
Markus thank you!
I used r.in.xyz according to your instructions.
I set the region as follow:
g.region -a res=150
And then r.in.xyz to generate the surface.
The points are not located in the center of the cells but on the upper left
corner. Is that a feature or I made a mistake with the region settings?
The extents of the region need to be adjusted. Get the N,S,E,W bounds
of the vector points, add 75 m to N and E, substract 75 m from S and
W, use these with res=150, but without -a, to set the region. N - S
and E - W should be multiples of 150. The points should now fall into
the cell centers, granted that the vector points are really evenly
spaced.
Markus M