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

[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: Wed, 28 Mar 2018 04:04:55 -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 #4, bug #53422 (project octave):

I've tried shapewrite (latest snapshot on
https://sourceforge.net/p/octave/mapping/ci/default/tree/inst/) with the
Point, MultiPoint, Line and Polygon geometry types. I observe the same problem
as previously (no geometry appears on screen) when tying to open the files in
QGIS 2.14.4.

The range of coordinates was set to fit in the coordinate reference system
EPSG:21781 and the projection settings were set accordingly in QGIS, so I
don't think this is just a visualization issue.

Moreover, If I try reading the files with shaperead(), I do not get the same
structure as the input structure provided to shapewrite().

The code below was used for testing:


%% Multipoint

s = struct;
j = 1;
s(j).Geometry = 'MultiPoint';
s(j).X = [597600 597601 597602 597603 597604];
s(j).Y = [170250 170251 170252 170253 170254];
s(j).BoundingBox = [min(s(j).X), min(s(j).Y); max(s(j).X), max(s(j).Y)];
s(j).Custom1 = 'abc';
s(j).Custom2 = 42;

j = 2;
s(j).Geometry = 'MultiPoint';
s(j).X = [590600 590601 590602 590603 590604 590605];
s(j).Y = [178250 178251 178252 178253 178254 178255];
s(j).BoundingBox = [min(s(j).X), min(s(j).Y); max(s(j).X), max(s(j).Y)];
s(j).Custom1 = 'cdf';
s(j).Custom2 = 43;

% test if input and output have the same field values
shapewrite(s, 'multipoint.shp');        
s2 = shaperead('multipoint.shp');
test = all(cellfun(@(k) isequal(s.(k), s2.(k)), fieldnames(s2)))


%% Polygon (no holes)

s = struct;
j = 1;
s(j).Geometry = 'Polygon';
s(j).X = [590610 590620 590620 590610 590610];
s(j).Y = [178220 178220 178210 178210 178220];
s(j).BoundingBox = [min(s(j).X), min(s(j).Y); max(s(j).X), max(s(j).Y)];
s(j).Custom1 = 'abc';
s(j).Custom2 = 42;

j = 2;
s(j).Geometry = 'Polygon';
s(j).X = [597620 597630 597630 597620 597620];
s(j).Y = [170230 170230 170220 170220 170230];
s(j).BoundingBox = [min(s(j).X), min(s(j).Y); max(s(j).X), max(s(j).Y)];
s(j).Custom1 = 'cdf';
s(j).Custom2 = 43;

% test if input and output have the same field values
shapewrite(s, 'polygon.shp');        
s2 = shaperead('polygon.shp');     
test = all(cellfun(@(k) isequal(s.(k), s2.(k)), fieldnames(s2)))


%% Line

s = struct;
j = 1;
s(j).Geometry = 'Line';
s(j).X = [597600 597601 597602 597603 597604];
s(j).Y = [170250 170251 170252 170253 170254];
s(j).BoundingBox = [min(s(j).X), min(s(j).Y); max(s(j).X), max(s(j).Y)];
s(j).Custom1 = 'abc';
s(j).Custom2 = 42;

j = 2;
s(j).Geometry = 'Line';
s(j).X = [590600 590601 590602 590603 590604 590605];
s(j).Y = [178250 178251 178252 178253 178254 178255];
s(j).BoundingBox = [min(s(j).X), min(s(j).Y); max(s(j).X), max(s(j).Y)];
s(j).Custom1 = 'cdf';
s(j).Custom2 = 43;

% test if input and output have the same field values
shapewrite(s, 'line.shp');        
s2 = shaperead('line.shp');     
test = all(cellfun(@(k) isequal(s.(k), s2.(k)), fieldnames(s2)))





    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?53422>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

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