Re: [GRASS-user] Best way to reconnect tables in grass' databse

2008-11-27 Thread Markus Neteler
hi Nikos,

On Thu, Nov 27, 2008 at 1:32 AM, Nikos Alexandris
[EMAIL PROTECTED] wrote:
...
 Your explanation(s) are, as usual, precise. The parameter's names are
 very clear. I got confused somehow from the fact the v.db.connect -g
 prints out several variables and the help-text of v.db.reconnect.all
 contains the word variables as well. So I stuck in plural :-?

 My mistake of course. But adding your words *the string which appears as
 the fourth field of v.db.connect -g* (or some other text) in
 v.db.reconnect.all's description/help can't harm anyone.

 Or maybe an example, in my case using sqlite as a DBMS, (for future
 grass-adventurer's ;-):

 v.db.reconnect.all
 old_database=/home/nik/grassdb/peloponnese/hgrs87/PERMANENT/sqlite.db
 new_database=/geo/grassdb/peloponnese/hgrs87/PERMANENT/sqlite.db

Can you please submit a diff against SVN with the document change?
Then it is 100 times easier to merge that in :) Since you are power user
I am sure that creating a diff is no big deal for you, see
 http://trac.osgeo.org/grass/wiki/HowToSVN#LocalDiffs

Thanks,
Markus
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] get ESRI polygon shape with v.out.ogr

2008-11-27 Thread Moritz Lennert

On 27/11/08 03:06, Hamish wrote:

christian Brandt wrote:

I would like to export a vectorized raster theme as a ESRI
polygon shape from GRASS 6.3.

After vectorization of the raster with r.to.vect I get a
vector theme with categories. Within this GRASS-layer, it is
also possible to fill areas.

Hence I run v.out.ogr using the boundary and area option as
well as the ESRI shape option. At the end of the process,
GRASS tells me that no categories are written. Visualizing
the result within another GIS-software, there is just a line
theme and thus no way to display filled areas.



see the example in the v.out.ogr help page.

in most vector modules features without category are skipped.
areas are a virtual feature type made up of a centroid + a boundary.
in most vector maps boundaries are without category, as centroids hold those.

no idea why type=boundary,area would fail when type=area works.


This is because boundaries are considered as lines in GRASS and are 
exported as ARC. Areas are exported as POLYGONS. You cannot mix 
different types of features (e.g. lines and polygons) in the same shapefile.


Normally, there should have been a warning. main.c, lines 189ff:

if (((GV_POINTS  otype)  (GV_LINES  otype)) ||
((GV_POINTS  otype)  (GV_AREA  otype)) ||
((GV_POINTS  otype)  (GV_FACE  otype)) ||
((GV_LINES  otype)  (GV_AREA  otype)) ||
((GV_LINES  otype)  (GV_FACE  otype))
) {
G_warning(_(The combination of types is not supported
 by all formats.));


During the export the lines (boundaries) apparently get exported first, 
and then you cannot add the polygons (areas). Here's the full message I 
get when I try this:


GRASS 6.4.svn (nc_spm_06):~  v.out.ogr kkk type=boundary,area dsn=./ 
layer=testATTENTION: The combination of types is not supported by all 
formats.

Exporting 5 points/lines...
 100%
Exporting 2 areas (may take some time)...
ERROR 1: Attempt to write non-linestring (POLYGON) geometry to ARC type 
shapefile.

 100%
ERROR 1: Attempt to write non-linestring (POLYGON) geometry to ARC type 
shapefile.

4 features written
ATTENTION: 4 features without category were written

The ERROR message seem to be from ogr, not from GRASS.

Conclusion: If you want polygons, use type=area.

Moritz
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] How to copy vector columns between databases

2008-11-27 Thread Peter Löwe
Excellent. Thank you Markus!
Another proof how the community benefits when simple minds address stuff they 
can't figure out by themselves,

Simple minded,
Peter
 Original-Nachricht 
 Datum: Thu, 27 Nov 2008 11:39:14 +0100
 Von: Markus Neteler [EMAIL PROTECTED]
 An: [EMAIL PROTECTED]
 CC: GRASS user list grass-user@lists.osgeo.org
 Betreff: Re: [GRASS-user] How to copy vector columns between databases

 (back from grass-dev)
 
 On Thu, Nov 27, 2008 at 10:06 AM, Moritz Lennert
 [EMAIL PROTECTED] wrote:
 ...
  And to respond to Peter's original query, i.e:
 
  I have a vector layer FOO which is linked to two tables in layers 1 and
 2.
  The categories for each vector element are different in layer 1 and
 (e.g.
  a certain area may have the cat value 51 in layer 1 and a cat value
 of
  42 in layer 2).
  Let's assume that layer one has a VARCHAR column containing the names
 of
  the region (e.g. database_layer_1: 51,Wolfenstein database_layer_2:
 42 )
 
  If a new VARCHAR column is added to layer 2 by v.db.adcol,
  how can the the names from layer 1 be copied into it?
 
 
  it should actually be (assuming that the varchar attribute in layer 1 is
  called 'name':
 
  v.db.addcol FOO layer=2 col='name varchar(Size)'
  v.to.db myroads layer=2 option=query col=name qlayer=1 qcolumn=name
 
 Now a FAQ:
 
 
 http://grass.osgeo.org/wiki/Vector_map_attribute_transfer_between_connected_tables
 
 Markus

-- 
Dr. Peter Löwe
[EMAIL PROTECTED]





Sensationsangebot nur bis 30.11: GMX FreeDSL - Telefonanschluss + DSL 
für nur 16,37 Euro/mtl.!* http://dsl.gmx.de/?ac=OM.AD.PD003K11308T4569a
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] Best way to reconnect tables in grass' databse

2008-11-27 Thread Nikos Alexandris
On Thu, 2008-11-27 at 09:33 +0100, Markus Neteler wrote:
 hi Nikos,
 
 On Thu, Nov 27, 2008 at 1:32 AM, Nikos Alexandris
 [EMAIL PROTECTED] wrote:
 ...
  Your explanation(s) are, as usual, precise. The parameter's names are
  very clear. I got confused somehow from the fact the v.db.connect -g
  prints out several variables and the help-text of v.db.reconnect.all
  contains the word variables as well. So I stuck in plural :-?
 
  My mistake of course. But adding your words *the string which appears as
  the fourth field of v.db.connect -g* (or some other text) in
  v.db.reconnect.all's description/help can't harm anyone.
 
  Or maybe an example, in my case using sqlite as a DBMS, (for future
  grass-adventurer's ;-):
 
  v.db.reconnect.all
  old_database=/home/nik/grassdb/peloponnese/hgrs87/PERMANENT/sqlite.db
  new_database=/geo/grassdb/peloponnese/hgrs87/PERMANENT/sqlite.db
 
 Can you please submit a diff against SVN with the document change?
 Then it is 100 times easier to merge that in :) Since you are power user
 I am sure that creating a diff is no big deal for you, see
  http://trac.osgeo.org/grass/wiki/HowToSVN#LocalDiffs
 
 Thanks,
 Markus

Hi Markus!

Sure, I will do so.

Thank you, Nikos

___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] How to copy vector columns between databases

2008-11-27 Thread Markus Neteler
(back from grass-dev)

On Thu, Nov 27, 2008 at 10:06 AM, Moritz Lennert
[EMAIL PROTECTED] wrote:
...
 And to respond to Peter's original query, i.e:

 I have a vector layer FOO which is linked to two tables in layers 1 and 2.
 The categories for each vector element are different in layer 1 and (e.g.
 a certain area may have the cat value 51 in layer 1 and a cat value of
 42 in layer 2).
 Let's assume that layer one has a VARCHAR column containing the names of
 the region (e.g. database_layer_1: 51,Wolfenstein database_layer_2: 42 )

 If a new VARCHAR column is added to layer 2 by v.db.adcol,
 how can the the names from layer 1 be copied into it?


 it should actually be (assuming that the varchar attribute in layer 1 is
 called 'name':

 v.db.addcol FOO layer=2 col='name varchar(Size)'
 v.to.db myroads layer=2 option=query col=name qlayer=1 qcolumn=name

Now a FAQ:

 
http://grass.osgeo.org/wiki/Vector_map_attribute_transfer_between_connected_tables

Markus
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] New user grass help in Australia

2008-11-27 Thread John Morris
I've just downloaded my copy of GRASS (last night) and found this link:

http://grass.itc.it/intro/firsttime.php

very helpful.  Yes, the GRASS-Bible is great, too.  I've been reading this
list while waiting for my copy.  I hope you can find it in Oz-land.

John Morris

On Sat, Nov 22, 2008 at 3:55 AM, Matt B [EMAIL PROTECTED] wrote:

 Hi Group,
 I've been plugging away with grass for a few months now and not making
 progress as fast as I would like. Is there a user group (preferably in
 Melbourne though Adelaide is doable) or someone who would be able to sit
 down with me for an hour or two to help me through a few startup problems.
 Even having someone on chat (I haven't had much luck on the grass irc
 channel, maybe because of the time difference?) walk me through a few push
 this button steps would be useful.

 Thanks
 Matt


 ___
 grass-user mailing list
 grass-user@lists.osgeo.org
 http://lists.osgeo.org/mailman/listinfo/grass-user


___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] v.in.wfs [was Re: Grass-GIS 6.4 on OSX]

2008-11-27 Thread Glynn Clements

Richard Chirgwin wrote:

 ...well, that worked. The xerces check is dead. Next question, can
 v.in.wfs do a get capabilities or do I have to have a full URL to the
 desired feature?

It should be noted that once you strip away the boilerplate, the
v.in.wfs script is actually just:

lynx -source $WFS_URL  $TMP.xml
v.in.ogr dsn=$TMP.xml out=$OUT -o

-- 
Glynn Clements [EMAIL PROTECTED]
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] v.in.wfs [was Re: Grass-GIS 6.4 on OSX]

2008-11-27 Thread Markus Neteler
On Thu, Nov 27, 2008 at 8:02 AM, Richard Chirgwin
[EMAIL PROTECTED] wrote:
...
 ...well, that worked. The xerces check is dead. Next question, can
 v.in.wfs do a get capabilities or do I have to have a full URL to the
 desired feature?

I am afraid yes.
I tried but failed to generate a GetCapabilities call with OGR (which is
essentially what we would need here). If you/someone manages, we
can certainly add this functionality.

Markus

PS: r.in.wms seems to do something in this regard but I dunno if it could
 be merged into v.in.wfs.
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] Best way to reconnect tables in grass' databse

2008-11-27 Thread Nikos Alexandris
On Thu, 2008-11-27 at 13:09 +0100, Nikos Alexandris wrote:
 On Thu, 2008-11-27 at 09:33 +0100, Markus Neteler wrote:
  hi Nikos,
  
  On Thu, Nov 27, 2008 at 1:32 AM, Nikos Alexandris
  [EMAIL PROTECTED] wrote:
  ...
   Your explanation(s) are, as usual, precise. The parameter's names are
   very clear. I got confused somehow from the fact the v.db.connect -g
   prints out several variables and the help-text of v.db.reconnect.all
   contains the word variables as well. So I stuck in plural :-?
  
   My mistake of course. But adding your words *the string which appears as
   the fourth field of v.db.connect -g* (or some other text) in
   v.db.reconnect.all's description/help can't harm anyone.
  
   Or maybe an example, in my case using sqlite as a DBMS, (for future
   grass-adventurer's ;-):
  
   v.db.reconnect.all
   old_database=/home/nik/grassdb/peloponnese/hgrs87/PERMANENT/sqlite.db
   new_database=/geo/grassdb/peloponnese/hgrs87/PERMANENT/sqlite.db
  
  Can you please submit a diff against SVN with the document change?
  Then it is 100 times easier to merge that in :) Since you are power user
  I am sure that creating a diff is no big deal for you, see
   http://trac.osgeo.org/grass/wiki/HowToSVN#LocalDiffs
  
  Thanks,
  Markus
 
 Hi Markus!
 
 Sure, I will do so.
 
 Thank you, Nikos

This seem to require another treatment... ?

# editing the file and saving changes
[EMAIL PROTECTED]:/usr/local/src/grass6_devel$ nano
scripts/v.db.reconnect.all/v.db.reconnect.all.tmp.html 

# excute svn diff to check changes
[EMAIL PROTECTED]:/usr/local/src/grass6_devel$ svn diff
scripts/v.db.reconnect.all/

No output!!

What am I doing wrong?
Is something, due to the .tmp.html ending, different?

Nikos

___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] Best way to reconnect tables in grass' databse

2008-11-27 Thread Nikos Alexandris
On Fri, 2008-11-28 at 00:18 +0100, Markus Neteler wrote:
 On Fri, Nov 28, 2008 at 12:16 AM, Nikos Alexandris
 [EMAIL PROTECTED] wrote:
 ...
  This seem to require another treatment... ?
 
  # editing the file and saving changes
  [EMAIL PROTECTED]:/usr/local/src/grass6_devel$ nano
  scripts/v.db.reconnect.all/v.db.reconnect.all.tmp.html
 
 This is the temporary file, not the file in SVN (which
 is description.html in 6.x and modulename.html in 7).
 
 Just copy over your changes into the right html file and
 svn diff will work.
 
 Markus

Well, I thought so (that description is the file to be edited) but it
(=description.html) has only one sentence in it:

cat /usr/local/src/grass6_devel/scripts/v.db.reconnect.all/description.html 
H2DESCRIPTION/H2

EMv.db.reconnect.all/EM changes database connection of all layers of
all vectors in the current mapset from old_database to database. If a
link
does not match the old_database it is left untouched.

H2AUTHOR/H2
Radim Blazek

p
iLast changed: $Date: 2007-04-17 01:41:41 +0200 (Tue, 17 Apr 2007)
$/i

Anyhow, I'll copy the whole file (I think it's not wrong -- or is it?)

Cheers, Nikos

___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] Best way to reconnect tables in grass' databse

2008-11-27 Thread Nikos Alexandris
On Fri, 2008-11-28 at 00:43 +0100, Nikos Alexandris wrote:
 On Fri, 2008-11-28 at 00:18 +0100, Markus Neteler wrote:
  On Fri, Nov 28, 2008 at 12:16 AM, Nikos Alexandris
  [EMAIL PROTECTED] wrote:
  ...
   This seem to require another treatment... ?
  
   # editing the file and saving changes
   [EMAIL PROTECTED]:/usr/local/src/grass6_devel$ nano
   scripts/v.db.reconnect.all/v.db.reconnect.all.tmp.html
  
  This is the temporary file, not the file in SVN (which
  is description.html in 6.x and modulename.html in 7).
  
  Just copy over your changes into the right html file and
  svn diff will work.
  
  Markus
 
 Well, I thought so (that description is the file to be edited) but it
 (=description.html) has only one sentence in it:
 
 cat /usr/local/src/grass6_devel/scripts/v.db.reconnect.all/description.html 
 H2DESCRIPTION/H2
 
 EMv.db.reconnect.all/EM changes database connection of all layers of
 all vectors in the current mapset from old_database to database. If a
 link
 does not match the old_database it is left untouched.
 
 H2AUTHOR/H2
 Radim Blazek
 
 p
 iLast changed: $Date: 2007-04-17 01:41:41 +0200 (Tue, 17 Apr 2007)
 $/i
 
 Anyhow, I'll copy the whole file (I think it's not wrong -- or is it?)
 
 Cheers, Nikos

Sorry for the mail-traffic. Just more info to support my claim that the
current description.html is sort of empty:

# copy the .tmp.html over to .html 
[EMAIL PROTECTED]:/usr/local/src/grass6_devel$ cp
scripts/v.db.reconnect.all/v.db.reconnect.all.tmp.html
scripts/v.db.reconnect.all/description.html

# changes 
[EMAIL PROTECTED]:/usr/local/src/grass6_devel$ svn diff
scripts/v.db.reconnect.all/

Index: scripts/v.db.reconnect.all/description.html
===
--- scripts/v.db.reconnect.all/description.html (revision 34562)
+++ scripts/v.db.reconnect.all/description.html (working copy)
@@ -1,3 +1,40 @@
+!DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN
+html
+head
+titleGRASS GIS: v.db.reconnect.all/title
+meta http-equiv=Content-Type content=text/html;
charset=iso-8859-1
+link rel=stylesheet href=grassdocs.css type=text/css
+/head
+body bgcolor=white
+
+img src=grass_logo.png alt=GRASS logohr align=center size=6
noshade
+
+h2NAME/h2
+embv.db.reconnect.all/b/em  - Reconnects vectors to a new
database.
+h2KEYWORDS/h2
+vector, database, attribute table
+h2SYNOPSIS/h2
+bv.db.reconnect.all/bbr
+bv.db.reconnect.all help/bbr
+bv.db.reconnect.all/b bold_database/b=emstring/em
bnew_database/b=emstring/em  [bold_schema/b=emstring/em]
[bnew_schema/b=emstring/em]   [--bverbose/b]
[--bquiet/b] 
+
+
+h3Parameters:/h3
+DL
+DTbold_database/b=emstring/em/DT
+DDName of old database. It needs to be the exact string which 
+appears as the fourth field printed by v.db.connect -g, i.e. with
substituted variables/DD
+
+DTbnew_database/b=emstring/em/DT
+DDName of new database/DD
+
+DTbold_schema/b=emstring/em/DT
+DDOld schema/DD
+
+DTbnew_schema/b=emstring/em/DT
+DDNew schema/DD
+
+/DL
 H2DESCRIPTION/H2
 
 EMv.db.reconnect.all/EM changes database connection of all layers
of
@@ -9,3 +46,8 @@
 
 p
 iLast changed: $Date$/i
+HR
+Pa href=index.htmlMain index/a - a href=vector.htmlvector
index/a - a href=full_index.htmlFull index/a/P
+Pcopy; 2003-2008 a href=http://grass.osgeo.org;GRASS Development
Team/a/p
+/body
+/html

Nikos

___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user