Codota Logo
RawInvalidLocRef
Code IndexAdd Codota to your IDE (free)

How to use
RawInvalidLocRef
in
openlr.rawLocRef

Best Java code snippets using openlr.rawLocRef.RawInvalidLocRef (Showing top 18 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
BufferedReader b =
  • Codota IconInputStream in;new BufferedReader(new InputStreamReader(in))
  • Codota IconReader in;new BufferedReader(in)
  • Codota IconFile file;new BufferedReader(new FileReader(file))
  • Smart code suggestions by Codota
}
origin: openlr/xml

/**
 * {@inheritDoc}
 */
@Override
public final RawLocationReference decodeData(final String id, final Object data)
    throws PhysicalFormatException {
  if (!(data instanceof PolygonLocationReference)) {
    throw new OpenLRXMLException(XMLErrorType.DATA_ERROR,
        "incorrect data class");
  }
  PolygonLocationReference polygonLoc = (PolygonLocationReference) data;
  List<Coordinates> corners = polygonLoc.getPolygonCorners().getCoordinates();
  if (corners == null || corners.size() < MIN_NUMBER_CORNERS) {
    return new RawInvalidLocRef(id, XmlReturnCode.MISSING_POLYGON_DATA,
        LocationType.POLYGON);
  }
  List<GeoCoordinates> cornerPoints = new ArrayList<GeoCoordinates>();
  for (Coordinates geoCoord : corners) {
    cornerPoints.add(createGeoCoord(geoCoord));
  }
  RawLocationReference rawLocRef = new RawPolygonLocRef(id,
      cornerPoints);
  return rawLocRef;
}
origin: openlr/xml

    .getLocationReferencePoint();
if (locPoints == null || locPoints.isEmpty()) {
  return new RawInvalidLocRef(id, XmlReturnCode.INVALID_NUMBER_OF_LRP, LocationType.LINE_LOCATION);
    .getLastLocationReferencePoint();
if (lastLRP == null) {
  return new RawInvalidLocRef(id, XmlReturnCode.NO_LAST_LRP_FOUND, LocationType.LINE_LOCATION);
origin: openlr/binary

      OpenLRBinaryConstants.MIN_BYTES_CLOSED_LINE_LOCATION))) {
LOG.error("not enough bytes in the stream");
return new RawInvalidLocRef(id, BinaryReturnCode.NOT_ENOUGH_BYTES);
return new RawInvalidLocRef(id, BinaryReturnCode.READING_HEADER_FAILURE);
return new RawInvalidLocRef(id, BinaryReturnCode.INVALID_VERSION);
    decoder = new GeoCoordDecoder();
  } else {
    rawLocRef = new RawInvalidLocRef(id, 
        BinaryReturnCode.INVALID_BYTE_SIZE);
    decoder = new PoiAccessDecoder();
  } else {
    rawLocRef = new RawInvalidLocRef(id, 
        BinaryReturnCode.INVALID_BYTE_SIZE);
  decoder = new ClosedLineDecoder();
} else {
  rawLocRef = new RawInvalidLocRef(id, BinaryReturnCode.INVALID_BYTE_SIZE);
    decoder = new GridDecoder();
  } else {
    rawLocRef = new RawInvalidLocRef(id, BinaryReturnCode.INVALID_BYTE_SIZE);
    decoder = new PolygonDecoder();
  } else {
    rawLocRef = new RawInvalidLocRef(id, BinaryReturnCode.INVALID_BYTE_SIZE);
origin: openlr/xml

/**
 * {@inheritDoc}
 */
@Override
public final RawLocationReference decodeData(final String id,
    final Object data) throws PhysicalFormatException {
  if (!(data instanceof CircleLocationReference)) {
    throw new OpenLRXMLException(XMLErrorType.DATA_ERROR,
        "incorrect data class");
  }
  CircleLocationReference circleLoc = (CircleLocationReference) data;
  long radius = circleLoc.getRadius().longValue();
  GeoCoordinate centerPoint = circleLoc.getGeoCoordinate();
  if (centerPoint == null || radius < 0) {
    return new RawInvalidLocRef(id, XmlReturnCode.MISSING_CIRCLE_DATA,
        LocationType.CIRCLE);
  }
  RawLocationReference rawLocRef = new RawCircleLocRef(id,
      createGeoCoord(centerPoint.getCoordinates()), radius);
  return rawLocRef;
}
origin: openlr/xml

/**
 * {@inheritDoc}
 */
@Override
public final RawLocationReference decodeData(final String id,
    final Object data) throws PhysicalFormatException {
  if (!(data instanceof RectangleLocationReference)) {
    throw new OpenLRXMLException(XMLErrorType.DATA_ERROR,
        "incorrect data class");
  }
  RectangleLocationReference rectangleLoc = (RectangleLocationReference) data;
  Rectangle rect = rectangleLoc.getRectangle();
  if (rect == null) {
    return new RawInvalidLocRef(id,
        XmlReturnCode.MISSING_RECTANGLE_DATA,
        LocationType.RECTANGLE);
  }
  Coordinates lowerLeftPoint = rect.getLowerLeft();
  Coordinates upperRightPoint = rect.getUpperRight();
  if (lowerLeftPoint == null || upperRightPoint == null) {
    return new RawInvalidLocRef(id,
        XmlReturnCode.MISSING_RECTANGLE_DATA,
        LocationType.RECTANGLE);
  }
  RawLocationReference rawLocRef = new RawRectangleLocRef(id,
      createGeoCoord(lowerLeftPoint), createGeoCoord(upperRightPoint));
  return rawLocRef;
}
origin: openlr/xml

/**
 * {@inheritDoc}
 */
@Override
public final RawLocationReference decodeData(final String id,
    final Object data) throws PhysicalFormatException {
  if (!(data instanceof GridLocationReference)) {
    throw new OpenLRXMLException(XMLErrorType.DATA_ERROR,
        "incorrect data class");
  }
  GridLocationReference gridLoc = (GridLocationReference) data;
  Rectangle rect = gridLoc.getRectangle();
  if (rect == null) {
    return new RawInvalidLocRef(id, XmlReturnCode.MISSING_GRID_DATA,
        LocationType.GRID);
  }
  Coordinates lowerLeftPoint = rect.getLowerLeft();
  Coordinates upperRightPoint = rect.getUpperRight();
  if (lowerLeftPoint == null || upperRightPoint == null) {
    return new RawInvalidLocRef(id, XmlReturnCode.MISSING_GRID_DATA,
        LocationType.GRID);
  }
  int ncols = gridLoc.getNumColumns();
  int nrows = gridLoc.getNumRows();
  RawLocationReference rawLocRef = new RawGridLocRef(id,
      createGeoCoord(lowerLeftPoint), createGeoCoord(upperRightPoint),
      ncols, nrows);
  return rawLocRef;
}
origin: openlr/xml

    .getLocationReferencePoint();
if (locPoints == null || locPoints.isEmpty()) {
  return new RawInvalidLocRef(id,
      XmlReturnCode.INVALID_NUMBER_OF_LRP,
      LocationType.CLOSED_LINE);
origin: openlr/encoder

  /**
   * {@inheritDoc}
   */
  @Override
  public final RawLocationReference doEncoding(final Location location,
      final OpenLREncoderParameter prop) throws OpenLRRuntimeException {
    Configuration properties = prop.getConfiguration();
    MapDatabase mdb = prop.getMapDatase();
    // check if the location is valid
    LocationCheck locCheck = new PolygonLocationCheck();
    CheckResult retCode = locCheck.check(properties, mdb,
        location);
    if (!retCode.checkPassed()) {
      RawLocationReference invalid = new RawInvalidLocRef(location.getID(), retCode.getError(), location.getLocationType());
      return invalid;
    }

    List<? extends GeoCoordinates> cornerCoords = location.getCornerPoints();
    RawLocationReference rawLocRef = new RawPolygonLocRef(location.getID(), cornerCoords);
    return rawLocRef;
  }
}
origin: openlr/encoder

CheckResult retCode = locCheck.check(properties, mdb, location);
if (!retCode.checkPassed()) {
  RawLocationReference invalid = new RawInvalidLocRef(
      location.getID(), retCode.getError(),
      location.getLocationType());
  RawLocationReference invalid = new RawInvalidLocRef(
      location.getID(), retCode.getError(),
      location.getLocationType());
origin: openlr/encoder

CheckResult retCode = locCheck.check(properties, mdb, location);
if (!retCode.checkPassed()) {
  RawLocationReference invalid = new RawInvalidLocRef(
      location.getID(), retCode.getError(),
      location.getLocationType());
  RawLocationReference invalid = new RawInvalidLocRef(
      location.getID(), retCode.getError(),
      location.getLocationType());
origin: openlr/encoder

  /**
   * {@inheritDoc}
   */
  @Override
  public final RawLocationReference doEncoding(final Location location,
      final OpenLREncoderParameter prop) throws OpenLRRuntimeException {
    Configuration properties = prop.getConfiguration();
    MapDatabase mdb = prop.getMapDatase();
    // check if the location is valid
    LocationCheck locCheck = new GridLocationCheck();
    CheckResult retCode = locCheck.check(properties, mdb,
        location);
    if (!retCode.checkPassed()) {
      RawLocationReference invalid = new RawInvalidLocRef(
          location.getID(), retCode.getError(),
          location.getLocationType());
      return invalid;
    }
    RawLocationReference rawLocRef = new RawGridLocRef(location.getID(),
        location.getLowerLeftPoint(), location.getUpperRightPoint(),
        location.getNumberOfColumns(), location.getNumberOfRows());

    return rawLocRef;
  }
}
origin: openlr/encoder

    location);
if (!retCode.checkPassed()) {
  RawLocationReference invalid = new RawInvalidLocRef(location.getID(), retCode.getError(), location.getLocationType());
  return invalid;
  RawLocationReference invalid = new RawInvalidLocRef(location.getID(), retCode.getError(), location.getLocationType());
  return invalid;
origin: openlr/encoder

/**
 * {@inheritDoc}
 */
@Override
public final RawLocationReference doEncoding(final Location location, final OpenLREncoderParameter parameter)
    throws OpenLRRuntimeException {
  Configuration properties = parameter.getConfiguration();
  MapDatabase mdb = parameter.getMapDatase();
  
  // check if the location is valid 
  LocationCheck locCheck = new GeoCoordinateLocationCheck();
  CheckResult retCode = locCheck.check(properties, mdb,
      location);
  if (!retCode.checkPassed()) {
    RawLocationReference invalid = new RawInvalidLocRef(location.getID(), retCode.getError(), location.getLocationType());
    return invalid;
  }

  GeoCoordinates gc = null;
  try {
    gc = new GeoCoordinates(location
        .getPointLocation().getLongitudeDeg(), location
        .getPointLocation().getLatitudeDeg());
  } catch (InvalidMapDataException e) {
    throw new OpenLREncoderRuntimeException(EncoderRuntimeError.INVALID_MAP_DATA, e);
  }
  RawLocationReference rawLocRef = new RawGeoCoordLocRef(
      location.getID(), gc);
  return rawLocRef;
}
origin: openlr/encoder

/**
 * {@inheritDoc}
 */
@Override
public final RawLocationReference doEncoding(final Location location,
    final OpenLREncoderParameter parameter)
    throws OpenLRRuntimeException {
  Configuration properties = parameter.getConfiguration();
  MapDatabase mdb = parameter.getMapDatase();
  // check if the location is valid
  LocationCheck locCheck = new ClosedLineLocationCheck();
  CheckResult retCode = locCheck.check(properties, mdb,
      location);
  if (!retCode.checkPassed()) {
    RawLocationReference invalid = new RawInvalidLocRef(
        location.getID(), retCode.getError(),
        location.getLocationType());
    return invalid;
  }
  LocRefData lrd = new LocRefData(location);
  // initialize location reference data array and start encoding
  lrd.setLocRefPoints(generateLocRef(lrd, properties));
  // check if the location reference meets all restrictions and adjust
  // length values if necessary
  LocationReferenceAdjust locRefAdjust = new ClosedLineLocRefAdjust();
  locRefAdjust.adjustLocationReference(properties, lrd);
  RawLocationReference rawLocRef = new RawClosedLineLocRef(
      location.getID(), lrd.getLocRefPoints());
  return rawLocRef;
}
origin: openlr/xml

    .getLastLocationReferencePoint();
if (startLRP == null || endLRP == null) {
  return new RawInvalidLocRef(id,
      XmlReturnCode.INVALID_NUMBER_OF_LRP,
      LocationType.POINT_ALONG_LINE);
origin: openlr/encoder

RawLocationReference invalid = new RawInvalidLocRef(
    location.getID(), retCode.getError(),
    location.getLocationType());
origin: openlr/xml

    .getLastLocationReferencePoint();
if (startLRP == null || endLRP == null) {
  return new RawInvalidLocRef(id,
      XmlReturnCode.INVALID_NUMBER_OF_LRP,
      LocationType.POI_WITH_ACCESS_POINT);
origin: openlr/encoder

    location);
if (!retCode.checkPassed()) {
  RawLocationReference invalid = new RawInvalidLocRef(location.getID(), retCode.getError(), location.getLocationType());
  return invalid;
openlr.rawLocRefRawInvalidLocRef

Most used methods

  • <init>

Popular in Java

  • Reactive rest calls using spring rest template
  • startActivity (Activity)
  • orElseThrow (Optional)
  • findViewById (Activity)
  • FileNotFoundException (java.io)
    Thrown when a file specified by a program cannot be found.
  • PrintStream (java.io)
    A PrintStream adds functionality to another output stream, namely the ability to print representatio
  • SecureRandom (java.security)
    This class generates cryptographically secure pseudo-random numbers. It is best to invoke SecureRand
  • Pattern (java.util.regex)
    A compiled representation of a regular expression. A regular expression, specified as a string, must
  • Servlet (javax.servlet)
    Defines methods that all servlets must implement.A servlet is a small Java program that runs within
  • XPath (javax.xml.xpath)
    XPath provides access to the XPath evaluation environment and expressions. Evaluation of XPath Expr
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now