WARNING: This server is unstable and will be retired in the next days. If you want to keep this forum available, please request immediately a migration on the Nabble Support forum. Forums that don't receive any migration request will be deleted forever.

MGRSPoint bug or confusing documentation?

View: New views
2 Messages — Rating Filter:   Alert me  

MGRSPoint bug or confusing documentation?

by Lecomte, J-Francois :: Rate this Message:

| View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.

I am not very familiar with coordinate systems, but…

 

In the class MGRSPoint, the following constructor exists :

 

    /**

     * Create a MGRSPoint from UTM values;

     */

    public MGRSPoint(final float northing, final float easting, final int zoneNumber, final char zoneLetter) {

        super(northing, easting, zoneNumber, zoneLetter);

    }

 

When I read the documentation of this constructor, I expect the zoneLetter to be in UTM (either ‘S’ or ‘N’), but this constructor calls super, which is:

 

    /**

     * @param northing The northing component.

     * @param easting The easting component.

     * @param zone_number The zone of the coordinate.

     * @param zone_letter MGRS zone letter

     */

    public ZonedUTMPoint(float northing, float easting, int zone_number, char zone_letter) {

        super(northing,

              easting,

              zone_number,

              MGRSPoint.MGRSZoneToUTMZone(zone_letter));

    }

 

In this constructor, it is clear that the expected zone_letter is for MGRS. I don’t know if there is a bug in the MGRSPoint constructor or if this is only a documentation issue, but this lead to many bugs in my current project… I think it would be a good idea to document the parameters of the MGRSPoint constructor…

 


Re: MGRSPoint bug or confusing documentation?

by Don Dietrick-2 :: Rate this Message:

| View Threaded | Show Only this Message

Hello,

Sorry for the confusion, that's a result of incomplete copy/pasting.  I've updated the javadocs in MGRSPoint for the next release.

You're correct, the parameters should be the MGRS values.

- Don

=-=-=-=-=-=-=-=-=
Don Dietrick
@dfdietrick
=-=-=-=-=-=-=-=-=

On Thursday, March 15, 2012 at 2:15 PM, Lecomte, J-Francois wrote:

I am not very familiar with coordinate systems, but…

 

In the class MGRSPoint, the following constructor exists :

 

    /**

     * Create a MGRSPoint from UTM values;

     */

    public MGRSPoint(final float northing, final float easting, final int zoneNumber, final char zoneLetter) {

        super(northing, easting, zoneNumber, zoneLetter);

    }

 

When I read the documentation of this constructor, I expect the zoneLetter to be in UTM (either ‘S’ or ‘N’), but this constructor calls super, which is:

 

    /**

     * @param northing The northing component.

     * @param easting The easting component.

     * @param zone_number The zone of the coordinate.

     * @param zone_letter MGRS zone letter

     */

    public ZonedUTMPoint(float northing, float easting, int zone_number, char zone_letter) {

        super(northing,

              easting,

              zone_number,

              MGRSPoint.MGRSZoneToUTMZone(zone_letter));

    }

 

In this constructor, it is clear that the expected zone_letter is for MGRS. I don’t know if there is a bug in the MGRSPoint constructor or if this is only a documentation issue, but this lead to many bugs in my current project… I think it would be a good idea to document the parameters of the MGRSPoint constructor…