patchGNU Octave - Patches: patch #8377, Added new 3D Coordinate system...


patch #8377: Added new 3D Coordinate system conversion functions for Geodesy in Mapping toolbox

Submitted by:  None
Submitted on:  Wed 05 Mar 2014 01:51:47 PM UTC  
Category:  None Priority:  5 - Normal
Status:  Need Info Privacy:  Public
Assigned to:  Philip Nienhuis <philipnienhuis> Originator Email:  -email is unavailable-
Open/Closed:  Open

Add a New Comment(Rich Markup)

You are not logged in

Please log in, so followups can be emailed to you.


( Jump to the original submission)

Wed 28 Jun 2017 07:59:04 AM UTC, comment #19:

IMHO, the best way is to make geod a octave package, then mapping can import it.

This requieres only a script to be added to the geod package to organize it as a OF package. Now, to be in OF (external package), we need to upload the code from Felipe to a CVS. Ideally Felipe would do this and continue dthe development there, otherwise we can fork his project. I can use my gitlab account, but I guess it is better that one of the devs of mapping does it.

I can help with this, done it several times already.

Juan Pablo Carbajal <juanpi>
Project Member
Wed 28 Jun 2017 06:25:57 AM UTC, comment #18:

That still leaves the documentation, right?

Felipe I'm still willing to include your functions, but I'm unsure how to do this so that the OF mapping package is one comprehensive piece.
And, until at least later July I have no time/priority for this.

Philip Nienhuis <philipnienhuis>
Project MemberIn charge of this item.
Wed 28 Jun 2017 04:18:26 AM UTC, comment #17:

I've updated the zip file to include the LICENSE file.

Felipe G. Nievinski <fgnievinski>
Tue 27 Jun 2017 10:35:13 PM UTC, comment #16:

btw, do you mena this link?

That zip file doesn't seem to have any license into it. Also the files do not conitan header with copyright and license ... that makes it proprietary (I mean for anyone who doesn't know you want to share it under gplv3 or any other libre license)

Juan Pablo Carbajal <juanpi>
Project Member
Tue 27 Jun 2017 10:32:13 PM UTC, comment #15:

Great, I was just mentioning it.

Also, why not use gitlab or any other FOSS CVS server?

Juan Pablo Carbajal <juanpi>
Project Member
Tue 27 Jun 2017 10:21:27 PM UTC, comment #14:

I'm the original author and I've already made the files available outside of File Exchange, see Google Drive link.

Felipe G. Nievinski <fgnievinski>
Tue 27 Jun 2017 09:23:15 PM UTC, comment #13:

I guess you already know this, but just in case. The issue with File exchange is not the license but the term of use. You are not allowed to use code downloaded from there in products that are not from the mathworks.

Juan Pablo Carbajal <juanpi>
Project Member
Mon 06 Apr 2015 04:25:51 PM UTC, comment #12:

The license is here:
it's the BSD 2-Clause License:
therefore GPL-compatible --
in fact, it's very permissive.
I've checked that before choosing it.

Ideally the Octave-specific implementation would be just wrappers for the cross-compatible implementation. That way when I update my library, the Octave package wouldn't have to be changed.

Sandeep was doing some preliminary work on their SoC proposal, which didn't end up being picked up, reason why the work is a bit scattered.

And you're absolutely right about the need for improving geod's documentation. I'll try to set some time aside to do that. Unfortunately I can't commit to a due date on the documentation, though.

So you might wish to set these geodetic functions aside and go ahead with the planned release of the Mapping Package in the near future.

Felipe G. Nievinski <fgnievinski>
Mon 06 Apr 2015 03:51:13 PM UTC, comment #11:

Core Octave is GPL, Octave-Forge requires "compatible" licenses.
Reading up here:
I conclude that the "original BSD license" (which is what Matlab Central requires I think) is incompatible with GPL.
The "3-way" aka "modified" BSD license seems to be compatible, but AFAIK that is not the license accepted on Matlab Central.
Please read up yourself.

> But I have to ask: is it necessary to fork the code and make it
> Matlab-incompatible? The version that I maintain is cross-compatible, rather
> than compatible with Octave only.
> For example, myassert exists because each of Matlab's and Octave's assert.m
> are incompatible.

You mean, you want to keep the toolbox on Matlab Central and the functions in the mapping package in sync?
That would be one good reason not to fork them, as long as you want to maintain the geodesy functions.
The OF tsa toolbox has a similar setup. So if you want to follow that line I'm fine with it.

But then I do not follow what work was done by Sandeep etc. to port the functions to Octave.

BTW please note that I'm not mapping package maintainer, I know too little about projections, geodesy, etc. I just have an interest to make a release because there has been a lot of progress in this package that currently is only in the repo.
Maybe later I might pick up pkg maintenance but not soon.

A point to consider is that none of the geodesy function seem to have any usable user documentation; i.e., if I type...
"help aer2ecef"
...I only get "Origin of the system in geocentric coordinates", but no info on the input and output parameters and the values they accept and return.
So some action is required to document all functions.

AFAIK Octave accepts Matlab's help syntax (function call at top line, followed by the actual help text). Looking at the tsa package that help stuff also makes it to the on-line documentation on the Octave-Forge web site for each package.

Philip Nienhuis <philipnienhuis>
Project MemberIn charge of this item.
Mon 06 Apr 2015 02:40:16 PM UTC, comment #10:

Philip, the geod lib is BSD licensed, so you can take it and make it GPL3 if you want.

But I have to ask: is it necessary to fork the code and make it Matlab-incompatible? The version that I maintain is cross-compatible, rather than compatible with Octave only.

For example, myassert exists because each of Matlab's and Octave's assert.m are incompatible.

Thanks for your interest.

Felipe G. Nievinski <fgnievinski>
Mon 06 Apr 2015 02:36:17 PM UTC, comment #9:

Comment sent by Philip:

---------- Forwarded message ----------

Thanks Felipe.

I didn't know about your geodesy toolbox and the work done to transplant it to the Octave-Forge mapping package in the past.
I just happened to stumble on the patches by accident. While I was busy with that package anyway for GIS shape file functions I figured the geodesy functions are very useful.

IMO the tests had better be changed to invoke Octave assert() calls. I'm prepared to do that work; I've already converted Sandeep's contributions to Octave coding style, converting the tests doesn't constitute much additional work.

==> How about licenses? Do you guys agree with GPL3, as usual in many Octave-Forge packages?


Felipe G. Nievinski <fgnievinski>
Sun 05 Apr 2015 02:08:29 PM UTC, comment #8:

The missing myassert.m is part of the geod toolbox, available at:

discussed in the mailing list:

and now also mentioned in the wiki:

Felipe G. Nievinski <fgnievinski>
Sat 04 Apr 2015 08:24:08 AM UTC, comment #7:

Got a answer from Sandeep (Sunny):
"Yes. convert_to_cartesian() is geodetic2ecef"

(BTW Please follow up in the patch tracker, not through (private) email.)

I found out that convert_to_cartesian.m might be a wrapper around geodetic2ecef.m as in the tests the input & output of convert_to_cartesian.m more or less wrap up several input/output arguments of geodetic2ecef.m.
In addition, myassert() is missing.

In short, the code seems too incomplete to incorporate in the next mapping package release :-(
For me it is simply undoable to fix all such changes in the test suite; I lack time for that.

I also found a bug in geodetic2ecef.m (that could be due to my changes):
there needs to be another "else" clause in the code testing for the "ell" variable:

..without that change the first test breaks.

I haven't had time to check the rest of the functions. I hope you can do that yourself.

Could you please start from my patch on top of your two patches? I've already checked in the contributions of Pooja (see patch #8372) yesterday; AFAICS your patches and mine still apply cleanly upon the new repo state as of yesterday April 3.
It would be very nice if your contributions could make it for the next mapping package release.

Do not worry about style, I can fix that; my concern is that the code and all tests works in Octave-4.0.0-rc2.


Philip Nienhuis <philipnienhuis>
Project MemberIn charge of this item.
Fri 03 Apr 2015 09:18:27 PM UTC, comment #6:

Am I right to surmise that function convert_to_cartesian() (referenced in tests in geodetic2ecef.m) really is geodetic2ecef ?

Philip Nienhuis <philipnienhuis>
Project MemberIn charge of this item.
Fri 27 Mar 2015 08:43:39 PM UTC, comment #5:

Hi Felipe and Sandeep:

I've further converted your functions to Octave coding style, see attached patch.

Some remarks:

Where are the functions myassert.m and onvert_to_cartesian.m ?

Please review licenses for get_J2.m (lacking altogether), get_ellipsoid.m, get_sinefun.m and geodetic2ned.m

Would you agree with GPL-3?

Furthermore there's one (the last) test in get_ellipsoid.m that seems to run only in Matlab?

I hope to be able to include these functions in the next mapping package release (within -say- 3 weeks or so).
Could you please review my attach patch fix the above issues and supply a new patch on top of mine before mid-April, please?


(file #33471)

Philip Nienhuis <philipnienhuis>
Project MemberIn charge of this item.
Sat 14 Mar 2015 09:22:10 PM UTC, comment #4:

Hi Sunny,

Just stumbled onto your patches.

I've also contributed some stuff to the mapping package (GIS shapefile etc,) lately. I plan to make a release soon (but OK that has been postponed a few times due to other occupations).

In the next days/weeks I'll review your patches and push them to the mapping pkg repo if they're OK.

Philip Nienhuis <philipnienhuis>
Project MemberIn charge of this item.
Thu 13 Mar 2014 08:15:25 PM UTC, comment #3:


yes. If you compare the submission to the code that can be found in Octave you will see the differences. There is no need for me to point them out.

Carnë Draug <carandraug>
Project Member
Mon 10 Mar 2014 12:38:12 AM UTC, comment #2:

@Carne: anything non-standard other than "specific end-of-block statement (like endif, endswitch) rather than generic end"?

@Sunny: thanks for your submission; please see <>

Felipe G. Nievinski <fgnievinski>
Wed 05 Mar 2014 05:52:27 PM UTC, comment #1:

None of those files follow Octave coding guidelines. Please take a look at some code in Octave for examples

Carnë Draug <carandraug>
Project Member
Wed 05 Mar 2014 01:51:47 PM UTC, original submission:

Added the following new functions to mapping toolbox. They are related to Geodesy calculations.



(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:

Attached Files
file #33471:  mapping_pkg_PRN.patch added by philipnienhuis (79KiB - application/x-download)
file #31007: added by None (15KiB - application/x-zip-compressed - I have updated my patch to follow the coding guidelines of octave community. If I miss anything, please inform. Also, I had two commits in my local repository which is why I had to generate two patch files. )
file #30845:  file-2.patch added by None (88KiB - application/octet-stream - This is an update to my previous file. Modified ECEF2GEODETIC to work with an array of inputs. )
file #30834:  file.patch added by None (89KiB - application/octet-stream - This is an update to my previous file. All the functions are working properly and giving the same values as Matlab. I have also implemented some of the suggestions of Felipe and I ll include the tests soon.)
file #30780:  file.diff added by None (71KiB - application/octet-stream - This is my first time contributing to Octave.)


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by juanpi (Posted a comment)
  • -email is unavailable- added by fgnievinski (Posted a comment)
  • -email is unavailable- added by None (Submitted the item)

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.




    Follow 8 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2015-03-27 philipnienhuis Attached File- => Added mapping_pkg_PRN.patch, #33471
        StatusIn Progress => Need Info
        Assigned toNone => philipnienhuis
    2015-03-24 philipnienhuis StatusNone => In Progress
    2014-03-23 None Attached File- => Added, #31007
    2014-03-10 None Attached File- => Added file-2.patch, #30845
    2014-03-09 None Attached File- => Added file.patch, #30834
    2014-03-05 None Attached File- => Added file.diff, #30780

    Back to the top

    Powered by Savane 3.3