Return the last point of the ST_Linestring.
@param geomref hive geometry bytes
@return byte-reference of the last ST_Point
553223
public BytesWritable evaluate(BytesWritable geomref) {
		if (geomref == null || geomref.getLength() == 0){
			LogUtils.Log_ArgumentsNull(LOG);
			return null;
		}

		OGCGeometry ogcGeometry = GeometryUtils.geometryFromEsriShape(geomref);
		if (ogcGeometry == null){
			LogUtils.Log_ArgumentsNull(LOG);
			return null;
		}

		if (GeometryUtils.getType(geomref) == GeometryUtils.OGCType.ST_LINESTRING) {
			MultiPath lines = (MultiPath)(ogcGeometry.getEsriGeometry());
			int wkid = GeometryUtils.getWKID(geomref);
			SpatialReference spatialReference = null;
			if (wkid != GeometryUtils.WKID_UNKNOWN) {
				spatialReference = SpatialReference.create(wkid);
			}
			return GeometryUtils.geometryToEsriShapeBytesWritable(OGCGeometry.createFromEsriGeometry(lines.getPoint(lines.getPointCount()-1),
																									 spatialReference));
		} else {
			LogUtils.Log_InvalidType(LOG, GeometryUtils.OGCType.ST_LINESTRING, GeometryUtils.getType(geomref));
			return null;
		}
	}
612111
private String getLastQueryParam() {

        final String param = parseOptionalStringValue(XML_ELEMENT_LAST_QUERYPARAM);
        if (param == null) {
            return DEFAULT_LAST_QUERY_PARAM;
        } else {
            return param;
        }
    }
47150
public static double length3D(Geometry geom) {
                double sum = 0;
                for (int i = 0; i < geom.getNumGeometries(); i++) {
                        Geometry subGeom = geom.getGeometryN(i);
                        if (subGeom instanceof Polygon) {
                                sum += length3D((Polygon) subGeom);
                        } else if (subGeom instanceof LineString) {
                                sum += length3D((LineString) subGeom);
                        }
                }
                return sum;
        }
515126
public Integer getEnd() {
    if (mtasPositionType.equals(POSITION_RANGE)
        || mtasPositionType.equals(POSITION_SET)) {
      return mtasPositionEnd;
    } else if (mtasPositionType.equals(POSITION_SINGLE)) {
      return mtasPositionStart;
    } else {
      return null;
    }
  }
683801
public static MultiLineString createSegments(Geometry geom) throws SQLException {
        if (geom != null) {
            List<LineString> result;
            if (geom.getDimension() > 0) {
                result = new LinkedList<LineString>();
                createSegments(geom, result);
                return GEOMETRY_FACTORY.createMultiLineString(
                        result.toArray(new LineString[0]));
            } else {
                return GEOMETRY_FACTORY.createMultiLineString(null);
            }
        }
        return null;
    }
533391
protected String getGtype(final String ogcGeometryType) {
      final String gType;
      if (ogcGeometryType == null) {
         gType = null;
      } else if ("LineString".equalsIgnoreCase(ogcGeometryType)) {
         gType = "LINE";
      } else if ("MultiLineString".equalsIgnoreCase(ogcGeometryType)) {
         gType = "MULTILINE";
      } else if ("Triangle".equalsIgnoreCase(ogcGeometryType)) {
         gType = "POLYGON";
      } else if ("Point".equalsIgnoreCase(ogcGeometryType)
            || "MultiPoint".equalsIgnoreCase(ogcGeometryType)
            || "Curve".equalsIgnoreCase(ogcGeometryType)
            || "MultiCurve".equalsIgnoreCase(ogcGeometryType)
            || "Polygon".equalsIgnoreCase(ogcGeometryType)
            || "MultiPolygon".equalsIgnoreCase(ogcGeometryType)) {
         gType = ogcGeometryType.toUpperCase();
      } else {
         gType = "COLLECTION";
      }
      return gType;
   }
1346482
public byte[] getLastSegment() {
    if (segments.isEmpty()) {
      return null;
    }
    BufferSegment seg = segments.get(segments.size() - 1);
    return Arrays.copyOfRange(seg.buf, seg.offset, seg.offset + seg.len);
  }
1016114
String lastLink() {
    if (totalResults == null || currentLimit == 0L) {
      return null;
    }

    Long lastOffset;
    if (totalResults % currentLimit == 0L) {
      lastOffset = totalResults - currentLimit;
    } else {
      // Truncation due to integral division gives floor-like behavior for free.
      lastOffset = totalResults / currentLimit * currentLimit;
    }

    return urlWithUpdatedPagination(lastOffset, currentLimit);
  }
1060932
public static void Log_SRIDMismatch(Log logger, BytesWritable geomref1, BytesWritable geomref2){
		logger.error(String.format(messages[MSG_SRID_MISMATCH], GeometryUtils.getWKID(geomref1), GeometryUtils.getWKID(geomref2)));
	}
326929
public static Double getMaxZ(Geometry geom) {
        if (geom != null) {
            return CoordinateUtils.zMinMax(geom.getCoordinates())[1];
        } else {
            return null;
        }
    }
314200
public static Integer getCoordinateDimension(byte[] geom) throws IOException {
        if (geom == null) {
            return null;
        }
        return GeometryMetaData.getMetaDataFromWKB(geom).dimension;
    }
583746
public static List<LineString> getSectionsFromCoordinates( List<Coordinate> coordinates, double width ) {

        if (coordinates.size() < 3) {
            throw new IllegalArgumentException("This method works only on lines with at least 3 coordinates.");
        }
        double halfWidth = width / 2.0;
        List<LineString> linesList = new ArrayList<LineString>();
        // first section
        Coordinate centerCoordinate = coordinates.get(0);
        LineSegment l1 = new LineSegment(centerCoordinate, coordinates.get(1));
        Coordinate leftCoordinate = l1.pointAlongOffset(0.0, halfWidth);
        Coordinate rightCoordinate = l1.pointAlongOffset(0.0, -halfWidth);
        LineString lineString = geomFactory.createLineString(new Coordinate[]{leftCoordinate, centerCoordinate, rightCoordinate});
        linesList.add(lineString);

        for( int i = 1; i < coordinates.size() - 1; i++ ) {
            Coordinate previous = coordinates.get(i - 1);
            Coordinate current = coordinates.get(i);
            Coordinate after = coordinates.get(i + 1);

            double firstAngle = azimuth(current, previous);
            double secondAngle = azimuth(current, after);

            double a1 = min(firstAngle, secondAngle);
            double a2 = max(firstAngle, secondAngle);

            double centerAngle = a1 + (a2 - a1) / 2.0;

            AffineTransformation rotationInstance = AffineTransformation.rotationInstance(-toRadians(centerAngle), current.x,
                    current.y);

            LineString vertical = geomFactory.createLineString(new Coordinate[]{new Coordinate(current.x, current.y + halfWidth),
                    current, new Coordinate(current.x, current.y - halfWidth)});
            Geometry transformed = rotationInstance.transform(vertical);
            linesList.add((LineString) transformed);
        }

        // last section
        centerCoordinate = coordinates.get(coordinates.size() - 1);
        LineSegment l2 = new LineSegment(centerCoordinate, coordinates.get(coordinates.size() - 2));
        leftCoordinate = l2.pointAlongOffset(0.0, halfWidth);
        rightCoordinate = l2.pointAlongOffset(0.0, -halfWidth);
        lineString = geomFactory.createLineString(new Coordinate[]{leftCoordinate, centerCoordinate, rightCoordinate});
        linesList.add(lineString);

        return linesList;
    }
1039699
JournalSegment<E> getLastSegment() {
    assertOpen();
    Map.Entry<Long, JournalSegment<E>> segment = segments.lastEntry();
    return segment != null ? segment.getValue() : null;
  }
639550
final TreeMapEntry<K,V> getLastEntry() {
        TreeMapEntry<K,V> p = root;
        if (p != null)
            while (p.right != null)
                p = p.right;
        return p;
    }
1148931
def last_chain(self):
        '''
        
        '''
        cols = self.columns.tolist()
        i_oid = cols.index('_oid')
        i_start = cols.index('_start')
        i_end = cols.index('_end')

        start_map = {}
        end_map = {}
        for row in self.values:
            oid = row[i_oid]
            if oid not in start_map:
                start_map[oid] = set()
                end_map[oid] = set()
            start_map[oid].add(row[i_start])
            end_map[oid].add(row[i_end])

        cutoffs = {}
        for oid in start_map:
            maxend = pd.NaT if pd.NaT in end_map[oid] else max(end_map[oid])
            ends = end_map[oid] - start_map[oid] - set([maxend])
            cutoffs[oid] = None if len(ends) == 0 else max(ends)

        vals = [row for row in self.values
                if cutoffs[row[i_oid]] is None
                or cutoffs[row[i_oid]] < row[i_start]]

        return pd.DataFrame(vals, columns=cols)
1046985
def get_last_offset(self, field, filters_=[]):
        '''
            
        '''

        offset = self.get_last_item_field(field, filters_=filters_, offset=True)

        return offset
1024705
public Coref getRef() {
    if (Coref_Type.featOkTst && ((Coref_Type)jcasType).casFeat_ref == null)
      jcasType.jcas.throwFeatMissing("ref", "de.julielab.jules.types.muc7.Coref");
    return (Coref)(jcasType.ll_cas.ll_getFSForRef(jcasType.ll_cas.ll_getRefValue(addr, ((Coref_Type)jcasType).casFeatCode_ref)));}