[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #57669] [octave forge](mapping/io) Corrupt out
From: |
Matthew Parkan |
Subject: |
[Octave-bug-tracker] [bug #57669] [octave forge](mapping/io) Corrupt output when a single record is written with shapewrite |
Date: |
Sun, 26 Jan 2020 13:08:42 -0500 (EST) |
User-agent: |
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.130 Safari/537.36 |
URL:
<https://savannah.gnu.org/bugs/?57669>
Summary: [octave forge](mapping/io) Corrupt output when a
single record is written with shapewrite
Project: GNU Octave
Submitted by: mparkan
Submitted on: dim. 26 janv. 2020 18:08:41 UTC
Category: Octave Forge Package
Severity: 3 - Normal
Priority: 5 - Normal
Item Group: Incorrect Result
Status: None
Assigned to: None
Originator Name: Matt Parkan
Originator Email:
Open/Closed: Open
Discussion Lock: Any
Release: 5.1.90
Operating System: Microsoft Windows
_______________________________________________________
Details:
Hi,
There seems to be an issue with the output of the shapewrite function in the
mapping package (latest snapshot files from Jan 26, 2020): when a single
record is written to a shapefile, the result does not contain any of the
attributes.
Example:
s = struct;
j = 1;
s(j).Geometry = 'Point';
s(j).X = 597600;
s(j).Y = 172250;
s(j).BoundingBox = [min(s(j).X), min(s(j).Y); max(s(j).X), max(s(j).Y)];
s(j).Attribute1 = 'abc';
s(j).Attribute2 = 42;
shapewrite(s, 'point.shp');
s2 = shaperead('point.shp');
This will return:
Geometry = Point
X = 597600
Y = 172250
Custom1 = [](0x0)
Custom2 = [](0x0)
This only seems to happen when the structure contains a single record. For
example, the following code will produce the expected result:
s = struct;
j = 1;
s(j).Geometry = 'Point';
s(j).X = 597600;
s(j).Y = 172250;
s(j).BoundingBox = [min(s(j).X), min(s(j).Y); max(s(j).X), max(s(j).Y)];
s(j).Attribute1 = 'abc';
s(j).Attribute2 = 42;
j = 2;
s(j).Geometry = 'Point';
s(j).X = 598600;
s(j).Y = 170250;
s(j).BoundingBox = [min(s(j).X), min(s(j).Y); max(s(j).X), max(s(j).Y)];
s(j).Attribute1 = 'efg';
s(j).Attribute2 = 43;
shapewrite(s, 'point.shp');
It is likely that the issue is in the dbwrite() function used by shapewrite to
create the dBase file.
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?57669>
_______________________________________________
Message posté via Savannah
https://savannah.gnu.org/
- [Octave-bug-tracker] [bug #57669] [octave forge](mapping/io) Corrupt output when a single record is written with shapewrite,
Matthew Parkan <=
- [Octave-bug-tracker] [bug #57669] [octave forge](mapping/io) Corrupt output when a single record is written with shapewrite, Philip Nienhuis, 2020/01/26
- [Octave-bug-tracker] [bug #57669] [octave forge](mapping/io) Corrupt output when a single record is written with shapewrite, Philip Nienhuis, 2020/01/27
- [Octave-bug-tracker] [bug #57669] [octave forge](io) Corrupt output when a single row of data is written with dbfwrite, Philip Nienhuis, 2020/01/27
- [Octave-bug-tracker] [bug #57669] [octave forge](io) Corrupt output when a single row of data is written with dbfwrite, Matthew Parkan, 2020/01/27
- [Octave-bug-tracker] [bug #57669] [octave forge](io) Corrupt output when a single row of data is written with dbfwrite, Philip Nienhuis, 2020/01/27
- [Octave-bug-tracker] [bug #57669] [octave forge](io) Corrupt output when a single row of data is written with dbfwrite, Matthew Parkan, 2020/01/27
- [Octave-bug-tracker] [bug #57669] [octave forge](io) Corrupt output when a single row of data is written with dbfwrite, Philip Nienhuis, 2020/01/27