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: NonePriority: 5 - Normal
Status: Need InfoPrivacy: Public
Assigned to: Philip Nienhuis <philipnienhuis>Originator Email: -unavailable-
Open/Closed: Open

Add a New Comment (Rich MarkupRich Markup):

You are not logged in

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


(Jump to the original submission Jump to the original submission)

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 File(s):

Attached Files
file #33471:  mapping_pkg_PRN.patch added by philipnienhuis (79kB - application/x-download)
file #31007: added by None (15kB - 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 (88kB - 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 (89kB - 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 (71kB - 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
  • -unavailable- added by fgnievinski (Posted a comment)
  • -unavailable- added by None (Submitted the item)

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

    Only logged-in users can vote.


    Please enter the title of George Orwell's famous dystopian book (it's a date):



    Follow 8 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Fri 27 Mar 2015 08:43:39 PM UTCphilipnienhuisAttached File-=>Added mapping_pkg_PRN.patch, #33471
      StatusIn Progress=>Need Info
      Assigned toNone=>philipnienhuis
    Tue 24 Mar 2015 10:09:20 PM UTCphilipnienhuisStatusNone=>In Progress
    Sun 23 Mar 2014 01:16:56 AM UTCNoneAttached File-=>Added, #31007
    Mon 10 Mar 2014 04:24:43 PM UTCNoneAttached File-=>Added file-2.patch, #30845
    Sun 09 Mar 2014 03:38:29 AM UTCNoneAttached File-=>Added file.patch, #30834
    Wed 05 Mar 2014 01:51:47 PM UTCNoneAttached File-=>Added file.diff, #30780

    Back to the top

    Powered by Savane 3.1-cleanup