octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #61757] [octave forge](mapping) function "shap


From: Philip Nienhuis
Subject: [Octave-bug-tracker] [bug #61757] [octave forge](mapping) function "shaperead" Atttributes property/value document error
Date: Sat, 8 Jan 2022 08:12:32 -0500 (EST)
User-agent: Mozilla/5.0 (Windows NT 6.1; rv:52.0) Gecko/20100101 Firefox/52.0

Follow-up Comment #4, bug #61757 (project octave):

Copied over (and layout adapted slightly for Savannah) from private email:
(@Bob: the Savannah bug tracker won't work with email replies, it apparently
needs manual comments entry. Or I'm overlooking something)

==========================================================================

Brief report:
New dbfread.m works well with old shaperead.m :)
New shaperead.m adds underscores to .dbf attributes :(
A "bad" attribute name does not trigger an error message if one valid .dbf
attribute appears in the list.

Detailed report follows.

I ran three examples using different attribute lists:

Example    Attribute list
  1        {"X","GEOID10","BoundingBox","Y","foobar"}
  2        {"GEOID10"}
  3        {"foobar","X","Y"}

First, I replaced both shaperead.m and dbfread.m:


octave:195> attr={"X","GEOID10","BoundingBox","Y","foobar"};
octave:196> bl =
shaperead(BLNAME,"BoundingBox",ds.BoundingBox,"Attributes",attr,"Recordnumbers",[1:1000:150000])
bl =

  8x1 struct array containing the fields:

    Geometry
    BoundingBox
    X
    Y
    _GEOID10_

octave:197> attr={"GEOID10"};
octave:198> bl =
shaperead(BLNAME,"BoundingBox",ds.BoundingBox,"Attributes",attr,"Recordnumbers",[1:1000:150000])
bl =

  8x1 struct array containing the fields:

    Geometry
    BoundingBox
    X
    Y
    _GEOID10_

octave:199> attr={"foobar","X","Y"};
octave:200> bl =
shaperead(BLNAME,"BoundingBox",ds.BoundingBox,"Attributes",attr,"Recordnumbers",[1:1000:150000])
shaperead: file /home/maier/bob/IRC/CENSUS/tl_2019_04_tabblock10.dbf couldn't
be read;
           no attributes appended
bl =

  8x1 struct array containing the fields:

    Geometry
    BoundingBox
    X
    Y



Notes:
Functionality was correct in each example.
Underscores were prepended and appended to the .dbf attribute.
dbfread issues a warning in example 3 but not in example 1.

Then, I used the original shaperead.m and the new dbfread.m:



octave:209> attr={"X","GEOID10","BoundingBox","Y","foobar"};
octave:210> bl =
shaperead(BLNAME,"BoundingBox",ds.BoundingBox,"Attributes",attr,"Recordnumbers",[1:1000:150000])
     
bl =

  8x1 struct array containing the fields:

    Geometry
    BoundingBox
    X
    Y
    GEOID10

octave:211> attr={"GEOID10"};
octave:212> bl =
shaperead(BLNAME,"BoundingBox",ds.BoundingBox,"Attributes",attr,"Recordnumbers",[1:1000:150000])
     
bl =

  8x1 struct array containing the fields:

    Geometry
    BoundingBox
    X
    Y
    GEOID10

octave:213> attr={"foobar","X","Y"};
octave:214> bl =
shaperead(BLNAME,"BoundingBox",ds.BoundingBox,"Attributes",attr,"Recordnumbers",[1:1000:150000])
     
shaperead: file /home/maier/bob/IRC/CENSUS/tl_2019_04_tabblock10.dbf couldn't
be read;
           no attributes appended
bl =

  8x1 struct array containing the fields:

    Geometry
    BoundingBox
    X
    Y



Notes:
Functionality was correct in each example.
No underscores.
dbfread issues a warning in example 3 but not in example 1.

Code:


attr={"X","GEOID10","BoundingBox","Y","foobar"};
bl =
shaperead(BLNAME,"BoundingBox",ds.BoundingBox,"Attributes",attr,"Recordnumbers",[1:1000:150000])
attr={"GEOID10"};
bl =
shaperead(BLNAME,"BoundingBox",ds.BoundingBox,"Attributes",attr,"Recordnumbers",[1:1000:150000])
attr={"foobar","X","Y"};
bl =
shaperead(BLNAME,"BoundingBox",ds.BoundingBox,"Attributes",attr,"Recordnumbers",[1:1000:150000])


Let me know if you would like to repeat these tests or try a different
example.  Thanks!




    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?61757>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]