congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
SFException.<init>
Code IndexAdd Tabnine to your IDE (free)

How to use
mil.nga.sf.util.SFException
constructor

Best Java code snippets using mil.nga.sf.util.SFException.<init> (Showing top 14 results out of 315)

origin: mil.nga/sf

/**
 * Verify with the remaining bytes that there are enough remaining to read
 * the provided amount
 * 
 * @param bytesToRead
 *            number of bytes to read
 */
private void verifyRemainingBytes(int bytesToRead) {
  if (nextByte + bytesToRead > bytes.length) {
    throw new SFException(
        "No more remaining bytes to read. Total Bytes: "
            + bytes.length + ", Bytes already read: "
            + nextByte + ", Attempted to read: " + bytesToRead);
  }
}
origin: mil.nga.sf/sf-geojson

/**
 * Convert the JSON tree to a typed GeoJSON object
 * 
 * @param type
 *            GeoJSON object type
 * @param tree
 *            tree node
 * @return typed GeoJSON object
 */
private static <T extends GeoJsonObject> T toTypedGeoJsonObject(
    Class<T> type, JsonNode tree) {
  T geoJsonObject;
  try {
    geoJsonObject = mapper.treeToValue(tree, type);
  } catch (JsonProcessingException e) {
    throw new SFException(
        "Failed to convert node tree to GeoJSON object: " + tree, e);
  }
  return geoJsonObject;
}
origin: mil.nga.sf/sf-geojson

/**
 * Convert the GeoJSON object to a string value
 * 
 * @param object
 *            GeoJSON object
 * @return string value
 */
public static String toStringValue(GeoJsonObject object) {
  String stringValue = null;
  try {
    stringValue = mapper.writeValueAsString(object);
  } catch (JsonProcessingException e) {
    throw new SFException(
        "Failed to write GeoJSON object as a String: "
            + object.getType(), e);
  }
  return stringValue;
}
origin: mil.nga.sf/sf-geojson

/**
 * Convert the string content to a typed GeoJSON object
 * 
 * @param type
 *            GeoJSON object type
 * @param content
 *            string content
 * @return typed GeoJSON object
 */
private static <T extends GeoJsonObject> T toTypedGeoJsonObject(
    Class<T> type, String content) {
  JsonNode tree;
  try {
    tree = mapper.readTree(content);
  } catch (Exception e) {
    throw new SFException("Failed to convert content to a node tree: "
        + content, e);
  }
  T typedGeoJsonObject = toTypedGeoJsonObject(type, tree);
  return typedGeoJsonObject;
}
origin: mil.nga/sf

/**
 * Update the extended geometry type based upon the contained geometries
 */
public void updateGeometryType() {
  GeometryType geometryType = getCollectionType();
  switch (geometryType) {
  case GEOMETRYCOLLECTION:
  case MULTICURVE:
  case MULTISURFACE:
    break;
  case MULTIPOINT:
    geometryType = GeometryType.GEOMETRYCOLLECTION;
    break;
  case MULTILINESTRING:
    geometryType = GeometryType.MULTICURVE;
    break;
  case MULTIPOLYGON:
    geometryType = GeometryType.MULTISURFACE;
    break;
  default:
    throw new SFException(
        "Unsupported extended geometry collection geometry type: "
            + geometryType);
  }
  this.geometryType = geometryType;
}
origin: mil.nga/sf

/**
 * {@inheritDoc}
 */
@Override
public void setPoints(List<Point> points) {
  super.setPoints(points);
  if (numPoints() != 2) {
    throw new SFException("A line must have exactly 2 points.");
  }
}
origin: mil.nga/sf

throw new SFException("Unsupported Geometry Type: " + geometryType);
origin: mil.nga/sf

/**
 * {@inheritDoc}
 */
@Override
public void setPoints(List<Point> points) {
  super.setPoints(points);
  if (!isEmpty()) {
    if (!isClosed()) {
      addPoint(points.get(0));
    }
    if (numPoints() < 4) {
      throw new SFException(
          "A closed linear ring must have at least four points.");
    }
  }
}
origin: mil.nga/sf

  break;
default:
  throw new SFException("Unexpected Curve Type: " + curveGeometryType);
    break;
  default:
    throw new SFException("Unexpected Curve Type: "
        + curveHoleGeometryType);
origin: mil.nga/sf

throw new SFException("Unsupported "
    + this.getClass().getSimpleName() + " Geometry Type: "
    + geometryType);
origin: mil.nga.sf/sf-geojson

  geometry = new GeometryCollection(simpleGeometryCollection);
} else {
  throw new SFException("Unsupported Geometry type: "
      + simpleGeometry.getClass().getSimpleName());
origin: mil.nga/sf

throw new SFException("Unsupported "
    + this.getClass().getSimpleName() + " Geometry Type: "
    + geometryType);
origin: mil.nga/sf

throw new SFException("Unsupported "
    + this.getClass().getSimpleName() + " Geometry Type: "
    + geometryType);
origin: mil.nga/sf

throw new SFException("Unexpected Geometry Collection Type: "
    + geometryType);
mil.nga.sf.utilSFException<init>

Javadoc

Constructor

Popular methods of SFException

    Popular in Java

    • Updating database using SQL prepared statement
    • getSupportFragmentManager (FragmentActivity)
    • getResourceAsStream (ClassLoader)
    • findViewById (Activity)
    • EOFException (java.io)
      Thrown when a program encounters the end of a file or stream during an input operation.
    • BigInteger (java.math)
      An immutable arbitrary-precision signed integer.FAST CRYPTOGRAPHY This implementation is efficient f
    • URI (java.net)
      A Uniform Resource Identifier that identifies an abstract or physical resource, as specified by RFC
    • KeyStore (java.security)
      KeyStore is responsible for maintaining cryptographic keys and their owners. The type of the syste
    • MessageDigest (java.security)
      Uses a one-way hash function to turn an arbitrary number of bytes into a fixed-length byte sequence.
    • ArrayList (java.util)
      ArrayList is an implementation of List, backed by an array. All optional operations including adding
    • From CI to AI: The AI layer in your organization
    Tabnine Logo
    • Products

      Search for Java codeSearch for JavaScript code
    • IDE Plugins

      IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
    • Company

      About UsContact UsCareers
    • Resources

      FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
    Get Tabnine for your IDE now