Beispiel #1
0
  def placePoint(self, *coord):
      """
      Place or snap the :class:`point <geoscript.geom.Point>` to the `LineString <geoscript.geom.LineString>`. This method returns a new placed `Point <geoscript.geom.Point>`.

      *coord* A :class:`Point <geoscript.geom.Point>` or a variable list of x,y,z arguments.

      """
      point = coord[0] if isinstance(coord[0], Point) else Point(*coord)
      indexedLine = LengthIndexedLine(self)
      position = indexedLine.indexOf(point.coordinate)
      coord = indexedLine.extractPoint(position)
      return Point(coord.x, coord.y)
Beispiel #2
0
    def placePoint(self, *coord):
        """
      Place or snap the :class:`point <geoscript.geom.Point>` to the `LineString <geoscript.geom.LineString>`. This method returns a new placed `Point <geoscript.geom.Point>`.

      *coord* A :class:`Point <geoscript.geom.Point>` or a variable list of x,y,z arguments.

      """
        point = coord[0] if isinstance(coord[0], Point) else Point(*coord)
        indexedLine = LengthIndexedLine(self)
        position = indexedLine.indexOf(point.coordinate)
        coord = indexedLine.extractPoint(position)
        return Point(coord.x, coord.y)
Beispiel #3
0
  def locatePoint(self, *coord):
      """
      Locate the position of the :class:`point <geoscript.geom.Point>` along this :class:`LineString <geoscript.geom.LineString>`. The position returned is a number between 0 and 1.

      *coord* A :class:`Point <geoscript.geom.Point>` or a variable list of x,y,z arguments.
      
      """
      point = coord[0] if isinstance(coord[0], Point) else Point(*coord)
      indexedLine = LengthIndexedLine(self)
      position = indexedLine.indexOf(point.coordinate)
      percentAlong = position / self.getLength()
      return percentAlong
Beispiel #4
0
    def locatePoint(self, *coord):
        """
      Locate the position of the :class:`point <geoscript.geom.Point>` along this :class:`LineString <geoscript.geom.LineString>`. The position returned is a number between 0 and 1.

      *coord* A :class:`Point <geoscript.geom.Point>` or a variable list of x,y,z arguments.
      
      """
        point = coord[0] if isinstance(coord[0], Point) else Point(*coord)
        indexedLine = LengthIndexedLine(self)
        position = indexedLine.indexOf(point.coordinate)
        percentAlong = position / self.getLength()
        return percentAlong