[GRASS5] more cats in one layer and where condition

Hi all,

the problem which I described in last e-mail (d.vect disp=cat|attr where=)
is more complex (as I have found out using ps.map)...

The patch for d.vect, attached to the last e-mail, is faulty. It works only
if 'where' condition or category value is set. I forgot to check 'chcat' variable.
So there is modified patch for d.vect (d.vect-patch1.tar.gz),
I hope better than the last one...

I have similar problem with ps.map. I have tried to display centroids using where
condition. No points were displayed... For example:

one centroid/point
  layer/cat
     50/1
     50/2

attribute table:
  cat | kod
    1 | 18
    2 | 304

input for ps.map:

vpoints bylany_hp
  type centroid
  layer 50
  where kod=304
  symbol dkm/zahrada
  color black
  size 7
  lpos 0
  label
end

--> no points found ...

In function Vect_set_varray_from_db () is used Vect_cat_get () which
finds _first_ category of given field. So in this case category '1'!

For my purpose (I am trying to develop GRASS module for importing data in Czech
cadastre exchange data format -- my diploma thesis) I have modified this function
(see array.c.patch). But I am not sure if this solution is good...

Best regards,

  Martin

--
Martin Landa <landa@gama.fsv.cvut.cz> * http://gama.fsv.cvut.cz/~landa *
CTU Prague, Faculty of Civil Engineering, Czech Republic

(attachments)

array.c.patch (2.5 KB)
d.vect-patch1.tar.gz (1.13 KB)

the problem which I described in last e-mail (d.vect disp=cat|attr
where=) is more complex (as I have found out using ps.map)...

does v.extract work or does it have the same problem?

Hamish

Hi,

> the problem which I described in last e-mail (d.vect disp=cat|attr
> where=) is more complex (as I have found out using ps.map)...

does v.extract work or does it have the same problem?

it seems that v.extract works correctly...

btw, I am trying to add multiple layer support to this module.

  v.extract ... [layer=value[,value,...]] ...

It is almost done.

Martin

--
Martin Landa <landa@gama.fsv.cvut.cz> * http://gama.fsv.cvut.cz/~landa *
CTU Prague, Faculty of Civil Engineering, Czech Republic

Thanks,

I have applied the array.c.path to both GRASS 6 branches.

I am curious why a parcel has more categories?

Radim

Martin Landa wrote:

Hi all,

the problem which I described in last e-mail (d.vect disp=cat|attr where=)
is more complex (as I have found out using ps.map)...

The patch for d.vect, attached to the last e-mail, is faulty. It works only
if 'where' condition or category value is set. I forgot to check 'chcat' variable.
So there is modified patch for d.vect (d.vect-patch1.tar.gz),
I hope better than the last one...

I have similar problem with ps.map. I have tried to display centroids using where
condition. No points were displayed... For example:

one centroid/point layer/cat
     50/1
     50/2

attribute table:
  cat | kod
    1 | 18
    2 | 304

input for ps.map:

vpoints bylany_hp
  type centroid
  layer 50
  where kod=304
  symbol dkm/zahrada
  color black
  size 7
  lpos 0
  label end

--> no points found ...

In function Vect_set_varray_from_db () is used Vect_cat_get () which finds _first_ category of given field. So in this case category '1'!

For my purpose (I am trying to develop GRASS module for importing data in Czech cadastre exchange data format -- my diploma thesis) I have modified this function
(see array.c.patch). But I am not sure if this solution is good...

Best regards,

  Martin

--
Martin Landa <landa@gama.fsv.cvut.cz> * http://gama.fsv.cvut.cz/~landa *
CTU Prague, Faculty of Civil Engineering, Czech Republic

Martin Landa wrote:

Hi,

the problem which I described in last e-mail (d.vect disp=cat|attr
where=) is more complex (as I have found out using ps.map)...

does v.extract work or does it have the same problem?

it seems that v.extract works correctly...

btw, I am trying to add multiple layer support to this module.

  v.extract ... [layer=value[,value,...]] ...

It is almost done.

How should it work? Currently the layer option is used together with (list or where) and type. How do you want to use more layers?

Radim

Martin

--
Martin Landa <landa@gama.fsv.cvut.cz> * http://gama.fsv.cvut.cz/~landa *
CTU Prague, Faculty of Civil Engineering, Czech Republic

_______________________________________________
grass5 mailing list
grass5@grass.itc.it
http://grass.itc.it/mailman/listinfo/grass5

Hi,

On Thu, 05 May 2005, Radim Blazek wrote:

>>>the problem which I described in last e-mail (d.vect disp=cat|attr
>>>where=) is more complex (as I have found out using ps.map)...
>>
>>does v.extract work or does it have the same problem?
>
>
>it seems that v.extract works correctly...
>
>btw, I am trying to add multiple layer support to this module.
>
> v.extract ... [layer=value[,value,...]] ...
>
>It is almost done.

How should it work? Currently the layer option is used together with
(list or where) and type. How do you want to use more layers?

you are right, I am not sure how to implement it (with where, list, type option)
in the right way...

The reason why I have modified this module:

I have a map which contains more thematic layers (e.g. parcels and buildings).
I need to split this map into two maps.

v.extract in=map out=map_parcels layer=1,2,3,4,5,....
v.extract in=map out=map_buildings layer=50,51,52,....

I am not sure how to do it in one step. Of course I can use v.extract
more times, then patch these maps and clean the result. But it takes
a lot of time and I think it is not a good way...

So, do you know how to solve this problem without modifying v.extract?

Thanks,

  Martin

--
Martin Landa <landa@gama.fsv.cvut.cz> * http://gama.fsv.cvut.cz/~landa *
CTU Prague, Faculty of Civil Engineering, Czech Republic

Hi,

I am curious why a parcel has more categories?

One centroid:

attribute table 'obrazy_parcel' (parcels):
cat | typppd_kod
-----+------------
  70 | 304
608 | 18

table 't_prvku_p_dat' ("object type")
kod | vyznam
-----+-----------------------------------
  18 | Cislo (def.bod) pozemkove parcely -> parcel type (ground-plot X building-plot)
304 | Zahrada -> garden

Martin

--
Martin Landa <landa@gama.fsv.cvut.cz> * http://gama.fsv.cvut.cz/~landa *
CTU Prague, Faculty of Civil Engineering, Czech Republic