GeoAPI
  1. GeoAPI
  2. GEO-137

Need the missing single argument call PointArray.getDirectPosition(int index)

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Not A Bug
    • Affects Version/s: 2.1
    • Fix Version/s: 2.2-M1
    • Component/s: geometry
    • Labels:
      None
    • Environment:
      all
    • Number of attachments :
      0

      Description

      The specification method #column(int) has not been included in the interface. We can surely change the name to a more neutral get*() and indeed, so far, provide PointArray.getDirectPosition(int index, DirectPosition dp). The latter imposes all sorts of details on the implementation, for instance, the existance of a mutable DirectPosition.

      We should provide a simple getDirectPosition(int index) method.

      Perhaps we should also let the former method be optional by allowing it to throw an OperationNotSupported exception.

        Activity

        Hide
        Martin Desruisseaux added a comment -

        PointArray.column(int)

        In GeoAPI 2.0, the column association was provided through the positions() method. This method has been deprecated in 2.2 and replaced by direct inheritence of java.util.List<Position> methods.

        Reference: PointArray.positions() javadoc

        So PointArray.column(int) is functionality is provided by PointArray.get(int) inherited from java.util.List. However we should probably document this get method explicitly. Note that we inherit PointArray.set(int, Position) from java.util.List as well.

        PointArray.getDirectPosition(int, DirectPosition)

        Actually this method does not require the existence of a mutable DirectPosition. The user can pass null, in which case the method will create its own DirectPosition which doesn't need to be mutable (however it is recommanded in order to allow usage of the idiom documented in the javadoc, but I don't think that it is a problem given how trivial implementing a mutable DirectPosition is).

        The getDirectPosition(int) functionality can be provided by get(int).getDirectPosition().

        Show
        Martin Desruisseaux added a comment - PointArray.column(int) In GeoAPI 2.0, the column association was provided through the positions() method. This method has been deprecated in 2.2 and replaced by direct inheritence of java.util.List<Position> methods. Reference: PointArray.positions() javadoc So PointArray.column(int) is functionality is provided by PointArray.get(int) inherited from java.util.List . However we should probably document this get method explicitly. Note that we inherit PointArray.set(int, Position) from java.util.List as well. PointArray.getDirectPosition(int, DirectPosition) Actually this method does not require the existence of a mutable DirectPosition . The user can pass null , in which case the method will create its own DirectPosition which doesn't need to be mutable (however it is recommanded in order to allow usage of the idiom documented in the javadoc, but I don't think that it is a problem given how trivial implementing a mutable DirectPosition is). The getDirectPosition(int) functionality can be provided by get(int).getDirectPosition() .
        Hide
        Adrian Custer added a comment -

        Ah, yes, of course. get(int) is provided. I'm clearly not thinking things through deeply enough.

        I'll change the name to reflect the second, more complex issue.

        Show
        Adrian Custer added a comment - Ah, yes, of course. get(int) is provided. I'm clearly not thinking things through deeply enough. I'll change the name to reflect the second, more complex issue.
        Hide
        Adrian Custer added a comment -

        Nothing to see here, please move on. Interesting issues will be discussed in other bugs.

        Show
        Adrian Custer added a comment - Nothing to see here, please move on. Interesting issues will be discussed in other bugs.
        Adrian Custer made changes -
        Field Original Value New Value
        Status Open [ 1 ] Closed [ 6 ]
        Resolution Not A Bug [ 6 ]
        Martin Desruisseaux made changes -
        Resolution Not A Bug [ 6 ]
        Assignee Martin Desruisseaux [ desruisseaux ]
        Status Closed [ 6 ] Reopened [ 4 ]
        Martin Desruisseaux made changes -
        Status Reopened [ 4 ] Closed [ 6 ]
        Resolution Not A Bug [ 6 ]
        Fix Version/s 2.2 [ 12386 ]
        Fix Version/s 2.2-M1 [ 14472 ]

          People

          • Assignee:
            Martin Desruisseaux
            Reporter:
            Adrian Custer
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: