layer names

5 messages Options
Embed this post
Permalink
Martin Landa

layer names

Reply Threaded More More options
Print post
Permalink
Hi all,

most of the functions in Vlib takes layer number as argument. To
support layer names we need just change their prototypes to use 'const
char *' instead of 'int' and update all modules. Then layer will found
by number and if failed by name - see Vect_get_field2(). The second
approach would be to add new functions ending by '2', e.g.
Vect_cidx_find_all2(.., const char *layer, ...), etc.

What do you think? From my point of view would be better just change
prototypes without adding new and new functions which just takes layer
as a string...

Martin

--
Martin Landa <landa.martin gmail.com> * http://gama.fsv.cvut.cz/~landa
_______________________________________________
grass-dev mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/grass-dev
Martin Landa

Re: layer names

Reply Threaded More More options
Print post
Permalink
of course only related to GRASS 7 (trunk)...

2009/10/18 Martin Landa <[hidden email]>:

> most of the functions in Vlib takes layer number as argument. To
> support layer names we need just change their prototypes to use 'const
> char *' instead of 'int' and update all modules. Then layer will found
> by number and if failed by name - see Vect_get_field2(). The second
> approach would be to add new functions ending by '2', e.g.
> Vect_cidx_find_all2(.., const char *layer, ...), etc.
>
> What do you think? From my point of view would be better just change
> prototypes without adding new and new functions which just takes layer
> as a string...

--
Martin Landa <landa.martin gmail.com> * http://gama.fsv.cvut.cz/~landa
_______________________________________________
grass-dev mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/grass-dev
Markus Metz-2

Re: layer names

Reply Threaded More More options
Print post
Permalink
In reply to this post by Martin Landa

Martin Landa wrote:
> Hi all,
>
> most of the functions in Vlib takes layer number as argument. To
> support layer names we need just change their prototypes to use 'const
> char *' instead of 'int' and update all modules. Then layer will found
> by number and if failed by name - see Vect_get_field2().
Layer number is always available, like category number, because it's
stored both in the coor and the cidx file, even without topology and
without an attribute table linked to a vector layer. Layer names
associated with a layer number are only available (currently) if dblinks
are present, otherwise layers have only numbers if I understand
Vect_read_dblinks() properly.
> The second
> approach would be to add new functions ending by '2', e.g.
> Vect_cidx_find_all2(.., const char *layer, ...), etc.
>
> What do you think? From my point of view would be better just change
> prototypes without adding new and new functions which just takes layer
> as a string...
>  
I think using new Vect_get_field2() in modules is sufficient to support
layer names. When copying a vector map or only dblinks, layer names are
already automatically copied as well. It's more like making layer names
available to users through a modified layer input option that can take
both numbers and names?

Markus M
_______________________________________________
grass-dev mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/grass-dev
cgnicholas

Re: r.sim.water working?

Reply Threaded More More options
Print post
Permalink
ok - rebuilt 6.3 ... and things worked with terraflow; got the
useful/expected message with r.sim.water that I was out of memory...sounds
like you folks know the issues.

If anyone is interested, I converted the accumulation output to lat/long,
and posted as WMS, along with the CIESEN gridded population, to:

http://maps.geography.uc.edu//cgi-bin/mapserv?map=/home/cgn/public_html/maps/mapfiles/haiti.map&SERVICE=WMS&REQUEST=GetCapabilities

thank you folks!

Chris

>> >From a previous post I realize
>> r.terraflow isnt working in 6.4 yet..,
>
> I would encourage you to try it for yourself. It is likely that
> it does work for all but some corner cases.
>
>
> Hamish
>

_______________________________________________
grass-dev mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/grass-dev
Martin Landa

Re: layer names

Reply Threaded More More options
Print post
Permalink
In reply to this post by Markus Metz-2
Hi,

2009/10/18 Markus Metz <[hidden email]>:

[...]

>> The second
>> approach would be to add new functions ending by '2', e.g.
>> Vect_cidx_find_all2(.., const char *layer, ...), etc.
>>
>> What do you think? From my point of view would be better just change
>> prototypes without adding new and new functions which just takes layer
>> as a string...
>>
>
> I think using new Vect_get_field2() in modules is sufficient to support
> layer names. When copying a vector map or only dblinks, layer names are
> already automatically copied as well. It's more like making layer names
> available to users through a modified layer input option that can take both
> numbers and names?

right, probably Vect_get_field_number() (added in r39620) would be
sufficient solution.

Martin

--
Martin Landa <landa.martin gmail.com> * http://gama.fsv.cvut.cz/~landa
_______________________________________________
grass-dev mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/grass-dev