Glynn Clements | 1 Jul 2011 01:34

Re: Python scripts- How to call external bin


katrin eggert wrote:

> I want to integrate in a Python script a call to an external binary (a small
> fucntion that I have done). What can i use to do this?

The standard Python functions for spawning child processes are
subprocess.Popen() and subprocess.call()

	http://docs.python.org/library/subprocess.html

The grass.script module has its own versions of these functions, which
set shell=True on Windows so that scripts work, but that doesn't
matter if you're running a binary executable. It also has several
functions which are intended specifically for running GRASS modules
(anything that uses the GRASS command-line parser).

--

-- 
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

Andrew MacIntyre | 1 Jul 2011 02:13
Picon

RE: Python scripts- How to call external bin [SEC=PERSONAL]

> From: katrin eggert
> 
> I want to integrate in a Python script a call to an external binary (a small
> fucntion that I have done). What can i use to do this?

Python's subprocess module is the recommended way to do this for a generic external binary.

-------------------------> "These thoughts are mine alone!" <---------
Andrew MacIntyre           Operations Branch
tel:   +61 2 6219 5356     Communications Infrastructure Division
fax:   +61 2 6253 3277     Australian Communications & Media Authority
email: andrew.macintyre <at> acma.gov.au            http://www.acma.gov.au/

NOTICE: This email message is for the sole use of the intended recipient(s) 
 and may contain confidential and privileged information. Any unauthorized 
 review, use, disclosure or distribution is prohibited. If you are not the 
 intended recipient, please contact the sender by reply email and destroy all 
 copies of the original message.
_______________________________________________
grass-user mailing list
grass-user <at> lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

Markus Metz | 1 Jul 2011 09:18

Re: v.generalize issues

On Thu, Jun 30, 2011 at 7:49 PM, Christian Guirreri <guirreri <at> gmail.com> wrote:
> I suppose my other question is if anyone has any recommendations concerning
> v.generalize as it applies specifically to tiger data - I'm doing all of US.
> Lots of settings and tests and its a bit overwhelming for a newbie.
>
For simplification (vertex reduction), Douglas-Peucker is generally a
good choice, it's relatively simple and commonly used.

For smoothing, Chaiken's Algorithm and Hermite Interpolation should
produce quite different results, apart from being a matter of taste,
it depends on what kind of modifications are allowed.

Markus M

> On Jun 30, 2011 11:33 AM, "Christian Guirreri" <christian <at> guirreri.com>
> wrote:
>> Success! Thanks for making this easy for the total noob that I am.
>>
>> On Thu, Jun 30, 2011 at 11:04 AM, Markus Metz <
>> markus.metz.giswork <at> googlemail.com> wrote:
>>
>>> On Thu, Jun 30, 2011 at 4:47 PM, Christian Guirreri
>>> <christian <at> guirreri.com> wrote:
>>> > I'm on GRASS 6.4.1. QGIS 1.7.0
>>> >
>>> In this version, v.generalize is still broken. You would need a recent
>>> version of GRASS 6.4.2. For Windows, you can get a recent version
>>> here:
>>>
>>> http://wingrass.fsv.cvut.cz/grass64/
(Continue reading)

Hamish | 1 Jul 2011 10:24
Picon
Favicon
Gravatar

Re: wave energy model

Salvatore wrote:
> I'm not able to download any data from your links...

what's the error message?

> I never worked with these kind of data before. 

now's your chance :)

gdal can read GRIB format directly, but due to a gdal bug you'll
have to apply a 1/2 cell correction after import with r.region.

did you want long-term average conditions/exposure or 

> Than I would to know where I can find a good bathymetry.

I don't know of a good source in the Med. Maybe someone else
does?  For global oceans the ETOPO1 dataset is great, but that's
not terribly useful near shore.

An approach of last resort is to digitize from nautical charts.
I usually prepare my model grid/bathy in GRASS then export with
r.out.ascii, it can read those files directly.

For MacOSX I guess you'll have to build SWAN yourself using a
fortran compiler. (GCC's gfortran is fine)  Note SWAN likes lots
and lots of RAM.

Hamish

(Continue reading)

Markus Metz | 1 Jul 2011 11:12

GRASS 7 vector topology format changed

Hi all,

the GRASS 7 vector topology format changed a bit. I have removed
redundant information (bounding boxes) from vector topology and
updated all affected components. The changes are numerous and require

make distclean
configure
make

This change also means that whenever you switch between GRASS 6.x and
GRASS 7, topology needs to be rebuilt, easiest done by using

v.build.all

The GRASS 7 format always consumes much less memory and is most of the
times, but not always, faster than the GRASS 6 format.

The network analysis modules should be a bit more robust now and can
easier detect errors in the networks.

The new format offers new possibilities for the v.surf.* modules
because it is now possible to build (parts of the) topology even for
massive point clouds which in turn makes it possible to quickly
perform spatial queries with very low memory consumption (a very few
MB).

Please test!

Markus M
(Continue reading)

Martin Landa | 1 Jul 2011 11:15
Picon

Re: [GRASS-dev] GRASS 7 vector topology format changed

Hi,

2011/7/1 Markus Metz <markus.metz.giswork <at> googlemail.com>:
> The new format offers new possibilities for the v.surf.* modules
> because it is now possible to build (parts of the) topology even for
> massive point clouds which in turn makes it possible to quickly
> perform spatial queries with very low memory consumption (a very few
> MB).

perfect, thanks a lot for your work! 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

Salvatore Mellino | 1 Jul 2011 11:30
Picon

Re: wave energy model


I have a problem with safari, but now I try to download files with firefox and it works. I download this file:
US058GOCN-GR1mdl(1).0110_0240_00000F0RL2010010100_0001_000000-000000max_wav_ht. It is
correct? This is the file for 01/01/201o the first on the list. I have to download 1 file for each day? I need a
long term average/exposure (one year).

Thanks for now...I have a lot things to learn.

I don't know if I am able to build SWAN by my self, I'm not a programmer. Until one week ago I worked with ArcGis
but now I want switch to opensource.

Il giorno 01/lug/2011, alle ore 10.24, Hamish ha scritto:

> Salvatore wrote:
>> I'm not able to download any data from your links...
> 
> what's the error message?
> 
>> I never worked with these kind of data before. 
> 
> now's your chance :)
> 
> gdal can read GRIB format directly, but due to a gdal bug you'll
> have to apply a 1/2 cell correction after import with r.region.
> 
> did you want long-term average conditions/exposure or 
> 
> 
>> Than I would to know where I can find a good bathymetry.
> 
(Continue reading)

Luisa Peña | 1 Jul 2011 12:40
Picon

Exporting labels of a raster

Greetings


I have a raster map to wich I have applied r.reclass to add labels to raster classes.  When I try to export this raster with the classes I loose the lablels I only stick with the values.
In a script how can edit this raster in order to be exported with the labels?Thanks
Luisa
_______________________________________________
grass-user mailing list
grass-user <at> lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user
Martin Album Ytre-Eide | 1 Jul 2011 12:44
Picon

divide a vector map in the display monitor.

Hello all!

I am trying to divide a vector map of Norway in the display monitor (I am running a python script and using the
png-driver).  I have made to separeted vector files which I now wont to put next to each other.

I have experimented with using d.frame and d.split.frame - but the results is not good. When doing a split
the dimensions are lost? - when doing a horizontal split the "height" is set equal which in my case is not
correct. When doing a vertical split , the "heigt" is preserved, but the width get messued up.

I have attached a file which shows what I wont to do (except the island in the top left corner). 

Anyone knows how this should be done?

Thanks!

Martin
_______________________________________________
grass-user mailing list
grass-user <at> lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user
Giovanni Manghi | 1 Jul 2011 12:45
Picon
Gravatar

Re: Exporting labels of a raster

Hi,

> 
> I have a raster map to wich I have applied r.reclass to add labels to
> raster classes.  When I try to export this raster with the classes I
> loose the lablels I only stick with the values.
> In a script how can edit this raster in order to be exported with the
> labels?Thanks

r.mapcalc "new_map= <at> existing_map"

then export "new_map" to tiff as usual.

Cheers

-- Giovanni --

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


Gmane