Marcello Gorini | 1 Aug 02:55 2011
Picon

How to extract one single contour.

Dear all,

I am interested in extracting the longest -1,000 meter contour from a
bathymetric DEM and to save it in a text file as points.

By doing:

r.contour in=my_dem out=contour levels=-1000
v.to.points in=contour out=contour_points dmax=my_resolution
v.out.ascii in=contour_points out=contour_points.txt fs=" " dp=4

... I get a text file with the contour points, however, it includes many
different isolated contours, all with the same category (1).

Since I need only the longest, I believe I need to separate the different
contours, maybe assigning different categories somehow, then maybe updating
the database with v.to.db using option=length and then v.db.select the
longest contour.

But I am not very used to working with vectors, so I don't know if that's
the correct approach (nor how to accomplish it), so I would appreciate very
much any help.

Many thanks.

Marcello.

--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/How-to-extract-one-single-contour-tp6639491p6639491.html
Sent from the Grass - Users mailing list archive at Nabble.com.
(Continue reading)

Luisa Peña | 1 Aug 10:38 2011
Picon

Re: Using non-ASCII chartacters in r.reclass rules file

Hi
Sorry for not being clear.
When I try to display the legend, in Map Display Window, those characters are not displayed. Shall I add a print screen?
Luisa

2011/7/30 Glynn Clements <glynn <at> gclements.plus.com>

Luisa Peña wrote:

> > > Question: It seems that it is not possible to use non-ascii characters. Is
> > > it true? Is there any way to add labels to the classes and use characters
> > > (such as á;à;ó; â)
> >
> > I don't know; what error (or other unexpected behaviour) are you
> > getting?
>
> Those characters are not displayed (they are replaced by blank spaces)

Displayed where? In a terminal? wxGUI?

Are they present in the "cats" file when viewed in a text editor?

--

_______________________________________________
grass-user mailing list
grass-user <at> lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user
Marcello Gorini | 1 Aug 17:20 2011
Picon

Re: How to extract one single contour.

Also, even when I zoom in to extract only one contour, the exported points
are not always in order in the file, in a way that when I use it to plot in
another program as a line, it connects the points in a wrong way.

How can I export contours in an amenable way to use in other programs, such
as Matlab, for instance?

Thanks in advance.

Marcello.

Marcello Gorini wrote:
> 
> Dear all,
> 
> I am interested in extracting the longest -1,000 meter contour from a
> bathymetric DEM and to save it in a text file as points.
> 
> By doing:
> 
> r.contour in=my_dem out=contour levels=-1000
> v.to.points in=contour out=contour_points dmax=my_resolution
> v.out.ascii in=contour_points out=contour_points.txt fs=" " dp=4
> 
> ... I get a text file with the contour points, however, it includes many
> different isolated contours, all with the same category (1).
> 
> Since I need only the longest, I believe I need to separate the different
> contours, maybe assigning different categories somehow, then maybe
> updating the database with v.to.db using option=length and then
> v.db.select the longest contour.
> 
> But I am not very used to working with vectors, so I don't know if that's
> the correct approach (nor how to accomplish it), so I would appreciate
> very much any help.
> 
> Many thanks.
> 
> Marcello.
> 

--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/How-to-extract-one-single-contour-tp6639491p6641376.html
Sent from the Grass - Users mailing list archive at Nabble.com.
_______________________________________________
grass-user mailing list
grass-user <at> lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

Agustín Diez Castillo | 1 Aug 19:18 2011
Picon

Grass on macos 10.7 aka Lion

Hi there,
Latest William's binary (6.4.1) is working in Lion. In an upgraded machine there is no major problems to run
it both with tcltk and wxpython. In a fresh installation, I got problems to point to the correct GISBASE
directory, the terminal ended in the text gui and once I pointed to where grass data was, it starts with the
following warnings:

CFURLCreateWithString was passed this invalid URL string:
'/System/Library/CoreServices/CommonCocoaPanels.bundle' (a file system path instead of an URL
string). The URL created will not work with most file URL functions. CFURLCreateWithFileSystemPath or
CFURLCreateWithFileSystemPathRelativeToBase should be used instead.

wish warning:

Wish[3284] <Error>: kCGErrorInvalidConnection: CGSGetWindowTags: Invalid connection
Aug  1 19:04:51 vpn1-22.vpn.uv.es Wish[3284] <Error>: kCGErrorFailure: Set a breakpoint  <at> 
CGErrorBreakpoint() to catch errors as they are logged.

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

Rosca Bogdan | 1 Aug 21:59 2011
Picon

Error in r.basin

Hello! I am trying to run r.basin for some analysis and it start promising but it end badly:
##########
r.basin.py map=dem_fill <at> harta prefix=a easting=491896.20 northing=659955.69 threshold=900
Removing raster <MASK>
Raster map <MASK> not found
<MASK> nothing removed
SECTION 1a (of 5): Initiating Memory.
SECTION 1b (of 5): Determining Offmap Flow.
SECTION 2: A * Search.
SECTION 3: Accumulating Surface Flow with SFD.
SECTION 4: Watershed determination.
SECTION 5: Closing Maps.
Writing out only positive flow accumulation values.
Cells with a likely underestimate for flow accumulation can no longer be identified.
Traceback (most recent call last):
  File "/usr/lib/grass64/scripts/r.basin.py", line 427, in
<module>
    sys.exit(main())
  File "/usr/lib/grass64/scripts/r.basin.py", line 133, in
main
    grass.run_command('r.stream.extract', elevation =
r_elevation, accumulation = r_accumulation, threshold = th,
d8cut = 'infinity', mexp = 0, stream_rast = r_stream_e,
stream_vect = v_stream_e, direction = r_drainage_e, flags
='-o')
  File "/usr/lib/grass64/etc/python/grass/script/core.py",
line 186, in run_command
    ps = start_command(*args, **kwargs)
  File "/usr/lib/grass64/etc/python/grass/script/core.py",
line 167, in start_command
    args = make_command(prog, flags, overwrite, quiet,
verbose, **options)
  File "/usr/lib/grass64/etc/python/grass/script/core.py",
line 124, in make_command
    raise ScriptError("'-' is not a valid flag")
grass.script.core.ScriptError: "'-' is not a valid flag"
(Mon Aug  1 21:19:09 2011) Command finished (2 sec) 
########
I must mention that I have Grass64 installed from  https://launchpad.net/~grass/+archive/grass-stable on Ubuntu Maverick and all dependencies needed ( I have managed to run separately almost every command but I have in total  22 basins)
Please could someone point me in the right direction ?
Bogdan Rosca   

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

Re: Error in r.basin

Hi,

2011/8/1 Rosca Bogdan <roscao <at> gmail.com>:
>     grass.run_command('r.stream.extract', elevation =
> r_elevation, accumulation = r_accumulation, threshold = th,
> d8cut = 'infinity', mexp = 0, stream_rast = r_stream_e,
> stream_vect = v_stream_e, direction = r_drainage_e, flags
> ='-o')

replace `flags = '-o'` with `overwrite = True`

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

Glynn Clements | 1 Aug 23:41 2011

Re: Re: Import vector: illegal filename


deagon wrote:

> v.in.ogr -o dsn=C:/GIS/NL/NL1980s.shp output=NL1980s snap=-1 min_area=0.0001
> Illegal filename. Character  not allowed.
> 
> Over-riding projection check
> Illegal filename. Character  not allowed.
> Illegal filename. Character  not allowed.
> Illegal filename. Character  not allowed.

This error comes from G_legal_filename():

	if (*s == '/' || *s == '"' || *s == '\'' || *s <= ' ' ||
	    *s == ' <at> ' || *s == ',' || *s == '=' || *s == '*' || *s > 0176) {
	    G_warning(_("Illegal filename <%s>. Character <%c> not allowed.\n"), name, *s);
	    return -1;
	}

It appears that an invalid (and non-printable) character has crept in
to the value of the output= option.

Unfortunately, I don't have any ideas as to how to track this down.

How is the command being entered? In QGIS? the wxGUI? bash? cmd.exe? 
If it's QGIS, I can only suggest taking it up with the QGIS
developers. If you can reproduce the error within GRASS itself, please
provide details.

--

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

Glynn Clements | 1 Aug 23:50 2011

Re: Using non-ASCII chartacters in r.reclass rules file


Luisa Peña wrote:

> > > Those characters are not displayed (they are replaced by blank spaces)
> >
> > Displayed where? In a terminal? wxGUI?
> >
> > Are they present in the "cats" file when viewed in a text editor?
> 
> When I try to display the legend, in Map Display Window, those characters
> are not displayed. Shall I add a print screen?

You'll need to select a font which has those characters (I don't think
that the default stroke fonts have accented characters), and also
select the correct encoding (presumably either ISO-8859-1 or UTF-8).

AFAICT, this has to be done globally, in the preferences. There
doesn't appear to be a way to set the font or encoding for an
individual layer.

--

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

Markus Metz | 2 Aug 08:58 2011

Re: Error in r.basin

On Mon, Aug 1, 2011 at 10:41 PM, Martin Landa <landa.martin <at> gmail.com> wrote:
> Hi,
>
> 2011/8/1 Rosca Bogdan <roscao <at> gmail.com>:
>>     grass.run_command('r.stream.extract', elevation =
>> r_elevation, accumulation = r_accumulation, threshold = th,
>> d8cut = 'infinity', mexp = 0, stream_rast = r_stream_e,
>> stream_vect = v_stream_e, direction = r_drainage_e, flags
>> ='-o')
>
> replace `flags = '-o'` with `overwrite = True`

There are probably more problems further down with e.g. flags = '-v'
in lines 249 and 254. Also, some of the printed messages should use
grass.message() to avoid spoiling the output written to stdout.

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

Otto Dassau | 2 Aug 12:02 2011
Picon

Re: [gdal-dev] r.out.gdal export with color table for floating-point values

Am Mon, 01 Aug 2011 16:24:23 +0200
schrieb Even Rouault <even.rouault <at> mines-paris.org>:

> > > Hi,
> > >
> > > I have an elevation map in GRASS with a color table that distinguishes
> > > decimal values based on the srtm color table, see below. I only want to
> > > have the value 0 in aqua, and all values <> 0 shall reflect land below
> > > or above sea level.
> > >
> > > -10  57 151 105
> > > -0.000001 57 151 105
> > > 0 aqua
> > > 0.000001  57 151 105
> > > 50   117 194 93
> > > 100  230 230 128
> > > 200  202 158 75
> > >
> > > When I export the raster with r.out.gdal (nor now I used GeoTiff and
> > > ERDAS Img) the color table seems to be changed to reflect "only"
> > > integer values. so all 0 floating point values are displayed as aqua.
> > >
> > > Is there a solution for this?
> > >
> > > Thanks a lot
> > >  Otto
> > 
> > Hi,
> >
> > fowarded from grass list, because it is probably better here with some
> > additional notes:
> >
> > I used Float32 as data type for the export to ERDAS Img, so the data a
> > floating point and there is a color table but the colortable does not
> > reflect the floating point data.
> >
> > Color Table (RGB with 174 entries)
> >     0: 0,191,191,255
> >     1: 58,151,105,255
> >     2: 59,152,105,255
> >     3: 60,153,105,255
> >     4: 61,154,105,255
> >     5: 62,155,104,255
> >     6: 64,156,104,255
> >
> > Is it possible somehow to adjust the colortable after the GRASS export
> > to get a color table that distinguishes floating point values as it does
> > in GRASS?
> 
> Otto,
> 
> In the GDAL data model, the index of a color table is necessary a
> (positive) integer. So there's no direct way to translate the GRASS color
> table of a floating point band into a matching GDAL object.
> 
> There are several workarounds you could try :
> * put your color table in a text file that can be used for example by
> "gdaldem color-relief" . See http://gdal.org/gdaldem.html
> * build a Raster Attribute Table from the color table and set it to the IMG
> dataset. But be aware that R.A.T. are rarely exploited by GDAL utilities.
> 
> 
> Best regards,
> 
> Even

Thanks a lot Even for your help,

the workaround with gdaldem worked fine for me. I can use the integer output
for nice looking visualisation in the background and the floating ERDAS Img
for further processing.

Are there any plans to be able to translate GRASS color tables of a floating
point band into a matching GDAL object? Would it make sense to write an
enhancement report to the GDAL bug tracker?

Regards,
 Otto

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


Gmane