Markus Metz | 1 Feb 2011 09:33

Re: Re: Shapefile to Surface

On Mon, Jan 31, 2011 at 9:29 PM, leonidas <leonidas_liakos <at> 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
_______________________________________________
grass-user mailing list
grass-user <at> lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

Patrick_schirmer | 1 Feb 2011 11:11
Picon
Picon

Re: replacement for d.mon in GRASS 7.0?

Does someone know how translate previous display commands into GRASS70, 
i.e. integrate a py-script that is called
"d.mon x1=start" (or similar) into GRASS70 doing these command:

#####start display in GRASS7.0
export GRASS_PNGFILE=map.bmp
d.erase
ximgview map.bmp &
export GRASS_PNG_MAPPED=TRUE

This would allow to run GRASS64-scripts on GRASS70 and for those you 
prefer direct output out of the script, just go on doing this as before. 
I tried to do so, but didn't manage to handle the "export" command in 
py. Maybe someone
of knows howto?

greetz, Patrick

>>> >>>  I just started using d.mon in combination with d.rast to quickly display
>>> >>>  a layer - but d.mon will be removed in 7.0. I assume there is a
>>> >>>  replacement for it, which I can use in 7.0? I do not assume, that I have
>>> >>>  to use GUI for display.
>> >>  
>> >>  You can use wxpyimgview[1] to view the images.
>> >>  
>> >>  [1] or wximgview or ximgview. ximgview is C/Xlib, wximgview is
>> >>  C++/wxWidgets, wxpyimgview is Python/wxWidgets.
>> >>  
>> >>  For this, you need:
>> >>  
(Continue reading)

Johannes Radinger | 1 Feb 2011 15:28
Picon
Picon

mapcalc/mapcalculator in python script

Hello,

I am running GRASS GIS 6.5 and want to run a python script
including a mapcaluculator-expression of a simple formula:

A=if(B,C)

grass.mapcalc("$upstream_shreve = if(${upstream_part},${shreve})",
                  upstream_shreve = options['upstream_shreve'],
                  upstream_part = options['upstream_part'],
                  shreve = options['shreve'])

but that isn't working... I don't know whats excaclty the problem....

hopefully you can help me

thanks
Johannes
--

-- 
GMX DSL Doppel-Flat ab 19,99 Euro/mtl.! Jetzt mit 
gratis Handy-Flat! http://portal.gmx.net/de/go/dsl
_______________________________________________
grass-user mailing list
grass-user <at> lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

Rainer M Krug | 1 Feb 2011 16:28
Picon

Re: mapcalc/mapcalculator in python script


On 02/01/2011 03:28 PM, Johannes Radinger wrote:
> Hello,
> 
> I am running GRASS GIS 6.5 and want to run a python script
> including a mapcaluculator-expression of a simple formula:
> 
> A=if(B,C)
> 
> grass.mapcalc("$upstream_shreve = if(${upstream_part},${shreve})",
>                   upstream_shreve = options['upstream_shreve'],
>                   upstream_part = options['upstream_part'],
>                   shreve = options['shreve'])
> 
> but that isn't working... I don't know whats excaclty the problem....

I don't know anything about python, but I had a similar problem under R,
where the problem was escaping of the formula - the formula needed to be
enclosed in " in grass.
To diagnose: can you see the command executed under GRASS? Does it work
if you paste this into GRASS?

Cheers,

Rainer

> 
> hopefully you can help me
> 
> thanks
(Continue reading)

mails-foren | 1 Feb 2011 16:43
Picon

Re: problem: boundary lines double


Hello Maris,

thanks a lot for replying.
Yes, I imported an esri shapefile. I'd tried to clean data with v.clean and with many different grass clean
modules, without any success.
Any other idea how to solve this issue? Maybe there is a method to import esri shapefiles without saving
double the boundary?

Steffen

-------- Original-Nachricht --------
> Datum: Thu, 27 Jan 2011 21:35:17 +0200
> Von: Maris Nartiss <maris.gis <at> gmail.com>
> An: mails-foren <at> gmx-topmail.de
> CC: grass-user <at> lists.osgeo.org
> Betreff: Re: [GRASS-user] problem: boundary lines double

> Hello,
> looks like Your data are coming from non-topological vector storage
> (Shapefile?). Cleanness of data stored in non-topological formats
> (i.e. Shapefile) depend on data creation software abilities to produce
> cliean-look data and not are enforced by data storage, as it is in
> GRASS.
> 
> Without seeing more information, my guess would be - You imported
> shapefile with areas into GRASS, still they had slivers and thus
> feature count has increased. Only way out is to clean data with
> v.clean and friends or by hand.
> 
(Continue reading)

Johannes Radinger | 1 Feb 2011 16:45
Picon
Picon

v.sample value to db column

hej,

is it somehow possible to sample a raster map at given point locations, and put the values directly into a
column of the db of the points?
I tried with
v.sample input=segment_points raster=stream_segments column=seg_num 
but thats not working...

In following discussion, the same thing is mentioned:
http://wald.intevation.org/tracker/index.php?func=detail&aid=513&group_id=21&atid=205

but is there a simple solution? (I am using GRASS GIS 6.5)

thanks
Johannes
--

-- 
NEU: FreePhone - kostenlos mobil telefonieren und surfen!			
Jetzt informieren: http://www.gmx.net/de/go/freephone
_______________________________________________
grass-user mailing list
grass-user <at> lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

Monica Buescu | 1 Feb 2011 17:15
Picon

Re: Check if a mapset exists- in Python Script

Hi Glynn
I tried grass.script.mapsets but I get this error:
line 59, in main
    var=grass.mapsets(False)
AttributeError: 'module' object has no attribute 'mapsets'

previously I had this: import grass.script as grass 

Am I doing something wrong? 

Thank you Glynn
Monica

On Mon, Jan 31, 2011 at 11:38 AM, Glynn Clements <glynn <at> gclements.plus.com> wrote:

Monica Buescu wrote:

> How can I check if a certain mapset exists in my active location in a Python
> Script?

       grass.script.mapsets(False)

returns a list of mapsets in the current location.

--
Glynn Clements <glynn <at> gclements.plus.com>

_______________________________________________
grass-user mailing list
grass-user <at> lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user
Martin Landa | 1 Feb 2011 17:27
Picon

Re: Check if a mapset exists- in Python Script

Hi,

2011/2/1 Monica Buescu <monicabuescu1985 <at> gmail.com>:
> I tried grass.script.mapsets but I get this error:
> line 59, in main
>     var=grass.mapsets(False)
> AttributeError: 'module' object has no attribute 'mapsets'
> previously I had this: import grass.script as grass
> Am I doing something wrong?

this function has been added quite recently. Update your installation
to 6.4.1 from SVN.

Martin

--

-- 
Martin Landa <landa.martin gmail.com> * http://geo.fsv.cvut.cz/~landa
_______________________________________________
grass-user mailing list
grass-user <at> lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

Micha Silver | 1 Feb 2011 17:44
Picon
Favicon

Re: v.sample value to db column

On 02/01/2011 05:45 PM, Johannes Radinger wrote:
> hej,
>
> is it somehow possible to sample a raster map at given point locations, and put the values directly into a
column of the db of the points?

v.what.rast

> I tried with
> v.sample input=segment_points raster=stream_segments column=seg_num
> but thats not working...
>
>
> In following discussion, the same thing is mentioned:
> http://wald.intevation.org/tracker/index.php?func=detail&aid=513&group_id=21&atid=205
>
> but is there a simple solution? (I am using GRASS GIS 6.5)
>
> thanks
> Johannes

--

-- 
Micha Silver
Arava Development Co. +972-52-3665918
http://www.surfaces.co.il

_______________________________________________
grass-user mailing list
grass-user <at> lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

Carlos Grohmann | 1 Feb 2011 18:27
Picon

v.surf.rst broken in 7.0 svn?

Hi, it seems that r.surf.rst has some bug in the SVN:

GRASS 7.0.svn (santa_catarina):~ > v.surf.rst -z --overwrite
input=caminhamento layer=1 elev=rover_5m_elev
maskmap=caminhamento_hull
Reading features from vector map ...
Reading nodes from vector map ...
 100%
WARNING: Strip exists with insufficient data
Ignoring 55394 points (too dense)
Number of points from vector map 69025
Number of points being used 13631
Bitmap mask created
Processing segments...
 100%
ERROR: Input window changed while maps are open for read

cheers

Carlos

--

-- 
Prof. Carlos Henrique Grohmann - Geologist D.Sc.
Institute of Geosciences - Univ. of São Paulo, Brazil
http://www.igc.usp.br/pessoais/guano
http://lattes.cnpq.br/5846052449613692
Linux User #89721
________________
Can’t stop the signal.
_______________________________________________
grass-user mailing list
grass-user <at> lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Gmane