[Top][All Lists]

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

[Octave-bug-tracker] [bug #53422] [octave forge] (mapping) Corrupt outpu

From: anonymous
Subject: [Octave-bug-tracker] [bug #53422] [octave forge] (mapping) Corrupt output when writing polygons to shapefile with shapewrite
Date: Tue, 3 Apr 2018 13:51:44 -0400 (EDT)
User-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.181 Safari/537.36

Follow-up Comment #11, bug #53422 (project octave):

Thanks for the updates Philip.

I've made a few additional tests in Octave and QGIS for the Point type with
the new functions you provided.

I still can't display the geometry in QGIS. However, I think (at least for the
Point type) that the problem is coming from the index file (SHX).  

To test this, I prepared a shapefile (point_test_qgis.shp) with QGIS 2.14.4,
read it in Octave with shaperead.m and wrote the resulting structure to a new
shapefile (point_test_octave.shp) with shapewrite.m.

I then checked if the content of the SHP and SHX files were the same for the
Octave and QGIS versions. The SHP files were the same, but the SHX are
different. To confirm this, if I substitute the Octave SHX file with the QGIS
SHX file, QGIS is able to display the layer correctly.

I've included the test files as an attachement.  

% test SHP equality
fid1 = fopen('point_test_qgis.shp');
F1 = fread(fid1, inf, 'uint8');

fid2 = fopen('point_test_octave.shp');
F2 = fread(fid2, inf, 'uint8');

isequal(F1, F2) % YES

% test SHX equality
fid1 = fopen('point_test_qgis.shx');
I1 = fread(fid1, inf, 'uint8');

fid2 = fopen('point_test_octave.shx');
I2 = fread(fid2, inf, 'uint8');

isequal(I1, I2) % NO

(file #43784, file #43785, file #43786, file #43787)

Additional Item Attachment:

File name: point_test_octave.shp          Size:0 KB
File name: point_test_octave.shx          Size:0 KB
File name: point_test_qgis.shp            Size:0 KB
File name: point_test_qgis.shx            Size:0 KB


Reply to this item at:


  Message sent via/by Savannah

reply via email to

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