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

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

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


From: Robert Maier
Subject: Re: [Octave-bug-tracker] [bug #61757] [octave forge](mapping) function "shaperead" Atttributes property/value document error
Date: Sat, 08 Jan 2022 01:49:33 -0000

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:

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

-verbatim-

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:

+verbatim+

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

-verbatim-

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!



On Fri, Jan 7, 2022 at 9:40 AM Philip Nienhuis <INVALID.NOREPLY@gnu.org> wrote:
Update of bug #61757 (project octave):

                  Status:               Need Info => Ready For Test         

    _______________________________________________________

Follow-up Comment #3:

In the mean time I provisionally pushed shaperead.m fixes here:
http://hg.code.sf.net/p/octave/mapping/rev/a432f37ae570

Then I also fixed dbfread.m (in the io package, which is a dependency of the
mapping package) and pushed the changes here:
http://hg.code.sf.net/p/octave/io/rev/57526ecaac0a

Updated dbfread.m attached, so you don't to need to wait for io-2.6.5 (as
io-2.6.4 was released just a week ago). Swap it with the one in the io package
subdir in your Octave installation (where? in the Octave command window just
type "which dbfread" w/o quotes).
I think that with this new dbfread.m and the old shaperead.m your use case
would work fine as well. Probably even better as now the order in which
requested attributes are specified really doesn't matter anymore (it did
before in spite of what the documentation mentioned).

Status -> Ready For Test

(file #52624)
    _______________________________________________________

Additional Item Attachment:

File name: dbfread.m                      Size:13 KB
    <https://file.savannah.gnu.org/file/dbfread.m?file_id=52624>



    _______________________________________________________

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]