[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #47502] geometry or mapping package: polysplit
From: |
Philip Nienhuis |
Subject: |
[Octave-bug-tracker] [bug #47502] geometry or mapping package: polysplit and polyjoin functions |
Date: |
Fri, 15 Apr 2016 16:35:00 +0000 |
User-agent: |
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:41.0) Gecko/20100101 Firefox/41.0 SeaMonkey/2.38 |
Follow-up Comment #3, bug #47502 (project octave):
Looking at the description of the files I am not very sure if the geometry
package is the right place.
AFAICS these functions are mainly used for converting (X,Y) or (Lat, Lon)
coordinates in mapstructs or geostructs to a form in which they can more
easily be plotted, and back. So they may be more useful in the mapping
package after all. Sorry for a bit of confusion.
JuanPi, what is your opinion? Does the geometry package use the cell array
coordinate format?
@Alex:
=======
Thanks for your contribution.
Contributions like this should go on the patch tracker, not bug tracker.
Looking at polyjoin.m I see a for loop that had better be vectorized to avoid
undue CPU time.
shapedraw.m in the mapping package invokes a better construct, I just
translated it into 2D for you:
XY(1:2:2*numel (latcells), :) = [{latcells{:}}' , {loncells{:}}'];
XY(2:2:2*numel (latcells) - 1, :) = NaN;
XY = cell2mat (XY);
lat = XY(:, 1);
lon = XY(:, 2);
(BTW this trick is actually due to David Bateman)
The reverse operation in polysplit.m should also be amenable to vectorization.
I'll have a look at it if no one beats me to it.
Furthermore, would you please follow Octave coding style?
- "A ~= B" should be "A != B"
- "~iscell" => "! iscell"
- two consecutive "|" rather than one
- indent only two spaces instead of four
... and please adapt the texinfo header to mention that X and Y coordinates
can be treated as well. The Matlabs docs don't mention that but this is very
useful.
Similar goes to polysplit.m.
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?47502>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/
- [Octave-bug-tracker] [bug #47502] geometry or mapping package: polysplit and polyjoin functions,
Philip Nienhuis <=