[GRASS-user] Help the newbie importing data into GRASS

Jorge Echeverri jorge.echeverri at Stein.de
Wed Mar 21 11:52:49 EDT 2007


Hi,

I need to do the following:

Display a sewer network and generate charts with classification in a
colour scale based on attributes like Age, Material, Diameter, etc.

Data are in a MySQL database:

The network is geometrically defined by the relationship between these
two tables:

tbl_line:
"LINE_ID","FROM_NODE_ID","TO_NODE_ID"
1,1,2
tbl_node
"NODE_ID","X_COORDINATE","Y_COORDINATE","Z_COORDINATE","NET_TYPE_ID"
1,3400630.04,5718486.603,,1,

Assuming that attributes where also stored in the same table: tbl_line,
which is not the case, how would be the better way to perform this task?
Attributes are actually stored in another table, tbl_basedata, which is
in the same database and has a 1:c relationship to tbl_line.

So far I have managed to connect to the MySQL-database but cannot figure
out how to further proceed.

Previously I had tried following workaround:
1.I performed a MySQL-query on tbl_node and tbl_line to obtain the
couples of points defining a line and stored this in a .csv-file. 
2. From this I created a new file with an awk-programm like this:
#'X_COORDINATE, Y_COORDINATE'
L 2 0
3400630.04 5718486.603
3400639.238 5718515.776
L 2 0
3400639.238 5718515.776
3400648.641 5718546.057
L 2 0
3400648.641 5718546.057
3400665.041 5718562.99
L 2 0
3400665.041 5718562.99
3400625.996 5718597.349
L 2 0 
3.I successfully imported this with v.in.ascii and can depict the
geometry.

But I don't think that is the most logical way to do it as GRASS can
connect directly to the DB. Any suggestions???

Thanks in advance
-- 
Jorge Echeverri
SP
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/grass-user/attachments/20070321/59681e75/attachment.html


More information about the grass-user mailing list