Re: [GRASS-user] wxpython v.digit: how to copy features from background layer?

2009-06-01 Thread Martin Landa
Hi,

2009/6/1 Eric Patton :
> I'm having trouble figuring out how to use the 'copy features from
> (background) vector map' tool on the wxpython v.digit interface.
>
> For example, see the attached image. I'm trying to copy the grey
> polygons from a background map into the vector map currently
> being edited. I can't seem to select either of the grey polygons with
> any of my mouse buttons.

did you mark vector map layer in contextual menu as "background map" ?
Right, it's not documented yet... In the best case every tool should
be explained in the special section in the manual pages.

Martin

-- 
Martin Landa  * http://gama.fsv.cvut.cz/~landa
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] v.out.ascii: how to write "where" clause

2009-06-01 Thread Moritz Lennert

On 01/06/09 21:52, Nikos Alexandris wrote:

On Mon, 2009-06-01 at 21:51 +0200, Nikos Alexandris wrote:

Jarek:


where="gdzie='N' and typ=4"
v.out.ascii input=grze...@bramy output=tmp_ppunkty_los format=point fs=, 
dp=8 layer=1 where=$where


but  I recive: Sorry  is not a valid option (?)

Try the following:

where="gdzie="N" and typ=4"

v.out.ascii input=grze...@bramy output=tmp_ppunkty_los format=point fs=,
dp=8 layer=1 where=`echo $where`


or better... where=`echo "${where}"`


or maybe just

where="$where" ?

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


Re: [GRASS-user] v.out.ascii: how to write "where" clause

2009-06-01 Thread Nikos Alexandris
On Mon, 2009-06-01 at 21:51 +0200, Nikos Alexandris wrote:
> Jarek:
> 
> > where="gdzie='N' and typ=4"
> > v.out.ascii input=grze...@bramy output=tmp_ppunkty_los format=point fs=, 
> > dp=8 layer=1 where=$where
> > 
> > but  I recive: Sorry  is not a valid option (?)
> 
> Try the following:
> 
> where="gdzie="N" and typ=4"
> 
> v.out.ascii input=grze...@bramy output=tmp_ppunkty_los format=point fs=,
> dp=8 layer=1 where=`echo $where`

or better... where=`echo "${where}"`


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


Re: [GRASS-user] v.out.ascii: how to write "where" clause

2009-06-01 Thread Nikos Alexandris
Jarek:

> where="gdzie='N' and typ=4"
> v.out.ascii input=grze...@bramy output=tmp_ppunkty_los format=point fs=, 
> dp=8 layer=1 where=$where
> 
> but  I recive: Sorry  is not a valid option (?)

Try the following:

where="gdzie="N" and typ=4"

v.out.ascii input=grze...@bramy output=tmp_ppunkty_los format=point fs=,
dp=8 layer=1 where=`echo $where`

Nikos

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


[GRASS-user] v.out.ascii: how to write "where" clause

2009-06-01 Thread Jarek Jasiewicz

Hi all.

pleas help me how to properly write where clause in v.out.ascii. I use:

where="gdzie='N' and typ=4"
v.out.ascii input=grze...@bramy output=tmp_ppunkty_los format=point fs=, 
dp=8 layer=1 where=$where


but  I recive: Sorry  is not a valid option (?)

when I use:
where="gdzie='N'"
all seems to be OK

I use dbf driver

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


[GRASS-user] wxpython v.digit: how to copy features from background layer?

2009-06-01 Thread Eric Patton
I'm having trouble figuring out how to use the 'copy features from
(background) vector map' tool on the wxpython v.digit interface. 

For example, see the attached image. I'm trying to copy the grey
polygons from a background map into the vector map currently
being edited. I can't seem to select either of the grey polygons with
any of my mouse buttons.

Any help most welcome, 

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


[GRASS-user] Re: error importing postgresql db

2009-06-01 Thread Seb
On Mon, 1 Jun 2009 07:40:28 +0200,
Markus Neteler  wrote:

> On Mon, Jun 1, 2009 at 1:50 AM, Seb  wrote:
>> On Mon, 01 Jun 2009 00:54:05 +0200,
>> Nikos Alexandris  wrote:

>> Seb:
> ...
>>> Not sure if this is a conflict with SQL commands, but you could try
>>> to _feed_ new names for your columns by using the "cname=" paramater
>>> of "v.in.ogr" and see what happens?


>> I tried that but the problem remains.  It seems as if there's
>> problems importing such datetime columns.  Thanks.

> Can you please post cmd line and error?

Here's what I get from v.in.db with a view that has a Postgis geometry
column where the reprojection to the local GRASS location was done
directly.  This gives the same error message as what I saw with
v.in.ogr, even after changing the column names with the 'cnames'
argument:

------
v.in.db driver=pg database="dbname=locations,port=5433" \
table=locs x='x(pts_aea)' y='y(pts_aea)' key=locid out=test --o
> WARNING: Vector map  already exists and will be overwritten
WARNING: pg driver: PostGIS column 'pts_ll', type 'geometry' will not be
 converted
WARNING: pg driver: PostGIS column 'pts_aea', type 'geometry' will not be
 converted
Writing features...

Copying attributes...
WARNING: pg driver: PostGIS column 'pts_ll', type 'geometry' will not be
 converted
WARNING: pg driver: PostGIS column 'pts_aea', type 'geometry' will not be
 converted
WARNING: Type TEXT converted to 'VARCHAR(250)'
DBMI-DBF driver error:
SQL parser error: syntax error, unexpected NAME processing 'datetime'
in statement:
create table test ( sample_id varchar(12), project varchar(500), species 
varchar(300), sex varchar(250), flipper_tag integer, date_time_deployed 
datetime, claw_marks integer, mass double precision, body_length double 
precision, girth double precision, fat_depth double precision, locid integer, 
prognum varchar(10), date_time datetime, class varchar(3), lon double 
precision, lat double precision )
Cannot create table

WARNING: Unable to create table <Ðg¹>
WARNING: Unable to copy table
Building topology for vector map ...
Registering primitives...
1311 primitives registered
1311 vertices registered
Building areas...

0 areas built
0 isles built
Attaching islands...
Attaching centroids...

Number of nodes: 976
Number of primitives: 1311
Number of points: 1311
Number of lines: 0
Number of boundaries: 0
Number of centroids: 0
Number of areas: 0
Number of isles: 0
v.in.db complete. 1311 points written to vector map.
------


-- 
Seb

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


[GRASS-user] Re: [GRASS-windows] copy column values

2009-06-01 Thread Markus Neteler
On Mon, Jun 1, 2009 at 3:59 PM, Stefanie Obmann  wrote:
> Hello again,
>
> Could you please tell me if it’s possible to change a column data type after
> importing it and how? Got just double type data in it, but imported it as
> string.

Yes, you can do that:


Examples of changing a SQL type (type casting, does not work for DBF driver):
# North Carolina data set: convert string column to double precision
#  copy map into current mapset
g.copy vect=geodetic_pts,mygeodetic_pts
v.db.addcol mygeodetic_pts col="zval double precision"

# the 'z_value' col contains 'N/A' strings, not to be converted
v.db.update mygeodetic_pts col=zval \
qcol="CAST(z_value AS double precision)" \
where="z_value <> 'N/A'"

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


[GRASS-user] copy column values

2009-06-01 Thread Stefanie Obmann
Hello again,

 

Could you please tell me if it's possible to change a column data type after
importing it and how? Got just double type data in it, but imported it as
string. 

 

Kind regards!

stef

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


[GRASS-user] Re: error importing postgresql db

2009-06-01 Thread Seb
On Mon, 1 Jun 2009 07:40:28 +0200,
Markus Neteler  wrote:

> On Mon, Jun 1, 2009 at 1:50 AM, Seb  wrote:
>> On Mon, 01 Jun 2009 00:54:05 +0200,
>> Nikos Alexandris  wrote:

>> Seb:
> ...
>>> Not sure if this is a conflict with SQL commands, but you could try
>>> to _feed_ new names for your columns by using the "cname=" paramater
>>> of "v.in.ogr" and see what happens?


>> I tried that but the problem remains.  It seems as if there's
>> problems importing such datetime columns.  Thanks.

> Can you please post cmd line and error?

Ok, I set this up differently because I found yesterday that it's a
better approach in my case to import just the vector geometry and then
connect the vector to the database (it seems more efficient not to
duplicate the information by having it in the database and GRASS).  The
table I'd be importing is actually a view, so it was very simple to
modify the view to give names that don't collide with SQL if unquoted
(although it would be nice to avoid this inconvenience).  However, I'm
still running into problems:

------
# We're in an AEA projection, data in lon/lat so extract first to reproject
$ db.select table='locs' database='dbname=locations,port=5433' \
driver='pg' > locs_ll; head locs_ll
sample_id|project|species|sex|flipper_tag|date_time_deployed|claw_marks|mass|body_length|girth|fat_depth|locid|prognum|date_time|class|lon|lat
SAGB-08-0001|Fjord|Ph|male|1316|2008-8-11 
18:30:00||25|90|82.5||27867|01142|2008-8-12 8:28:08|1|-63.076|58.448
SAGB-08-0001|Fjord|Ph|male|1316|2008-8-11 
18:30:00||25|90|82.5||27868|01142|2008-8-12 9:41:28|A|-63.101|58.431
SAGB-08-0001|Fjord|Ph|male|1316|2008-8-11 
18:30:00||25|90|82.5||27869|01142|2008-8-12 11:22:01|A|-63.086|58.407
SAGB-08-0001|Fjord|Ph|male|1316|2008-8-11 
18:30:00||25|90|82.5||27870|01142|2008-8-12 11:48:25|2|-63.086|58.413
SAGB-08-0001|Fjord|Ph|male|1316|2008-8-11 
18:30:00||25|90|82.5||27871|01142|2008-8-12 12:58:22|B|-63.119|58.463
SAGB-08-0001|Fjord|Ph|male|1316|2008-8-11 
18:30:00||25|90|82.5||27872|01142|2008-8-12 13:39:50|0|-63.106|58.428
SAGB-08-0001|Fjord|Ph|male|1316|2008-8-11 
18:30:00||25|90|82.5||27873|01142|2008-8-12 13:51:36|B|-63.067|58.398
SAGB-08-0001|Fjord|Ph|male|1316|2008-8-11 
18:30:00||25|90|82.5||27874|01142|2008-8-12 14:54:49|A|-63.061|58.442
SAGB-08-0001|Fjord|Ph|male|1316|2008-8-11 
18:30:00||25|90|82.5||27875|01142|2008-8-12 15:20:01|0|-63.134|58.463

# Reproject to AEA
$ awk -F"|" 'NR > 1 {print $16, $17}' locs_ll | \
cs2cs +init=epsg:4326 +to $(g.proj -jf) | \
awk -v OFS="|" 'BEGIN {print "lon_aea", "lat_aea"}; {print $1, $2}' \
> locs_aea; head locs_aea
lon_aea|lat_aea
-4.44|22.06
-5.90|20.17
-5.03|17.49
-5.03|18.16
-6.94|23.74
-6.19|19.84
-3.92|16.49
-3.56|21.39
-7.82|23.74

# Paste back unique ID (locid, for category) and pass to v.in.ascii
$ cut -d'|' -f12 locs_ll | paste -d"|" - locs_aea | \
v.in.ascii out=locs_pts_import skip=1 x=2 y=3 cat=1
Scanning input for column types...
Maximum input row length: 22
Maximum number of columns: 3
Minimum number of columns: 3
Importing points...

Building topology for vector map ...
Registering primitives...
1311 primitives registered
1311 vertices registered
Building areas...

0 areas built
0 isles built
Attaching islands...
Attaching centroids...

Topology was built
Number of nodes: 976
Number of primitives: 1311
Number of points: 1311
Number of lines: 0
Number of boundaries: 0
Number of centroids: 0
Number of areas: 0
Number of isles: 0
v.in.ascii complete.

# So far so good (data even plots ok). Connect to postgresql (no DBF
# created by default, so no need to remove any previous connection)
$ v.db.connect map=locs_pts_import driver='pg' 
database='dbname=locations,port=5433' \
table='locs' key='locid'
> The table  is now part of vector map
 and may be deleted or overwritten by GRASS modules
DBMI-Postgres driver error:
Cannot create index:
create unique index locs_locid on locs ( locid )
ERROR:  "locs" is not a table


WARNING: Cannot create index
Select privileges were granted on the table

# Try to remove the vector -- OMG it tries to drop the view in
# Postgresql (how to avoid this even if it worked?!)
$ g.remove -f vect=locs_pts_import
Removing vector 
DBMI-Postgres driver error:
Cannot execute: 
drop table locs
ERROR:  "locs" is not a table
HINT:  Use DROP VIEW to remove a view.


WARNING: Unable to drop table: 'drop table locs'
Segmentation fault

$ g.version -b
GRASS 6.4.0RC4 (2009) 

# ./configure  --host=x86_64-linux-gnu --build=x86_64-linux-gnu 
--prefix=/usr/lib --sysconfdir=/etc --sharedstatedir=/var --enable-socket 
--enable-shared --with-postgres --with-mysql --with-cxx --with-x --with-gdal 
--with-freetype --with-motif --with-readline --with-nls --with-odbc 
--with-sqlite --enable-largefile 
--with-freetype-includes=/usr/include/freetype2 
--with-tcltk-includes=/usr/include/tcl 
--with-postgres-includes=/usr/include/postgresql 
--with-mysql-include

Re: [GRASS-user] Hamradio and GRASS (slightly OT)

2009-06-01 Thread Paulo 'Pmarc' Marcondes
On Mon, Jun 1, 2009 at 6:19 AM, Markus Neteler  wrote:
> On Fri, May 29, 2009 at 9:17 PM, Paulo 'Pmarc' Marcondes
>  wrote:
> ...
>> ( I would like to have a prominence tool in grass, but I can't code...)
>
> With permission of Benjamin, I have put his "r.prominence" [1] into
> GRASS Addons-SVN (grass-addons/raster/r.prominence)
>

Well, I got the 7.0 snapshot yesterday, will take a look at how to
compile them together with main.

I am only afraid that I might need to compile all of proj, gdal and
other deps too.

After all, if I am going the DIY way, why not to compile every single
option in there?


-- 
Paulo Marcondes = PU1/PU2PIX
-22.915 -43.224 = GG87jc <= Corrected !
-23.578 -46.671 = GG66pk
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] mask problem

2009-06-01 Thread Nikos Alexandris

Stefanie:
> I’m working with a mask to cut the extent of my raster data (dem). I
> also have point vector data which lies also outside my mask. 

> Now I want to do the v.what.rast module to get elevation data into my
> vector data table. What can I do to also get the elevation data of the
> raster outside the mask??


1. Be sure you have matched the "active" region to the queried raster.
E.g.: "g.region rast=dem", perhaps with "-a" flag

2. Remove the MASK! Alternatively, if the MASK is big and takes a long
time to rebuild, just rename it temporarily for example with "g.rename
rast=MASK,temp_MASK"

Then the points lying outside of the MASK should be updated as well.
Kind regards, Nikos


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


[GRASS-user] mask problem

2009-06-01 Thread Stefanie Obmann
Dear users,

 

I'm working with a mask to cut the extent of my raster data (dem). I also
have point vector data which lies also outside my mask. 

Now I want to do the v.what.rast module to get elevation data into my vector
data table. What can I do to also get the elevation data of the raster
outside the mask??

 

Thanks,

stef

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


Re: [GRASS-user] Hamradio and GRASS (slightly OT)

2009-06-01 Thread Markus Neteler
On Fri, May 29, 2009 at 9:17 PM, Paulo 'Pmarc' Marcondes
 wrote:
...
> ( I would like to have a prominence tool in grass, but I can't code...)

With permission of Benjamin, I have put his "r.prominence" [1] into
GRASS Addons-SVN (grass-addons/raster/r.prominence)

Markus

[1] http://lists.osgeo.org/pipermail/grass-dev/2008-July/038899.html
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user