[GRASS-user] creating vector grids (especially associated with projections)

Hello,

I have meteorological data that are on diverse grids, in general associated
with a specific projection. For example, a lambert conic projection has
a 'natural' grid associated, just like the lon-lat grid is a natural grid
for lon-lat pprojection. Then I would like to intersect a vector
corresponding with this grid with some features on a map. For lon-lat grid
(and, unless I am missing something it works also fine for a Lambert Equal
Area location), the grass grid may be used for that, by setting the right
region information. Here is the code I use to create my grid, simply
by computing a raster grid with a different integer for each point and
using r.to.vect:

cols_nr=`g.region -g |grep '^cols=' |sed 's/^cols=//'`
r.mapcalc "grid_map=col() + ((row()-1) * $cols_nr)"
r.to.vect input=grid_map out=grid_map_v feature=area
v.db.addcol grid_map_v columns="lon Double Precision, lat Double Precision"
v.to.db map=grid_map_v option=coor column=lon,lat
v.db.addcol grid_map_v columns="area Double Precision"
v.to.db map=grid_map_v option=area column=area units=meters

But for other grids, like a non regular lon lat grid (more precise in the
middle) or for a lambert conformal 'natural' grid (which are the examples
I have) or any other grid that could arise, is there a simple way to do
a vector corresponding with that grid?

If not, are there some code somewhere that helps doing geometric vectors,
like grids (but one could also imagine doing circles and so on) and is readily
converted in grass vector format or directly leads to grass vector format?
Something like a high level API to do vector geometries, and not something
where you have to enter every coordinate and curve informations?

Also are you aware of people interested in such developments, are there
library of vector code/features/scripting or similar in the open source
GIS community?

--
Pat

Patrice wrote:

But for other grids, like a non regular lon lat grid (more precise in
the middle)

nested or non-linear?

or for a lambert conformal 'natural' grid (which are the examples
I have) or any other grid that could arise, is there a simple way to do
a vector corresponding with that grid?

try the v.mkgrid module. then use v.proj to pull it into the other
projection.

in LCC or some other projection you can run d.grid, and "d.grid -w" to
get both local grid and lat/lon grid over the top of each other.

neither v.mkgrid or d.grid are very happy with 180 longitude, but using
0-360 instead of -180 to +180 can help there. (?)

If not, are there some code somewhere that helps doing geometric vectors,
like grids (but one could also imagine doing circles and so on)

see the GRASS raster screenshots page for polar stereographic projection
with a lat/lon grid made by v.mkgrid reprojected into the local projection.
(making circles around the poles)

Something like a high level API to do vector geometries, and not
something where you have to enter every coordinate and curve
informations?

create SVG in Inkscape, save as DXF, import DXF into GRASS.

Also are you aware of people interested in such developments, are there
library of vector code/features/scripting or similar in the open source
GIS community?

for really sophisticated mesh grids have a look at Pavel Sakov's tools:
   http://code.google.com/u/pavel.sakov/
and the front-end to that Octant:
   http://code.google.com/p/octant/

good luck,
Hamish

a web search found this:
  http://www.genekeyes.com/CKOG-OOo/6-CKOG-grid-&-illus.html