Tabnine Logo
GeoSpatialFeature.setValue
Code IndexAdd Tabnine to your IDE (free)

How to use
setValue
method
in
com.oculusinfo.ml.feature.spatial.GeoSpatialFeature

Best Java code snippets using com.oculusinfo.ml.feature.spatial.GeoSpatialFeature.setValue (Showing top 3 results out of 315)

origin: unchartedsoftware/ensemble-clustering

public GeoSpatialFeature fieldToGeoSpatialFeature(String name) {
  Field field = fields.get(name);
  
  if (field == null) return null;
  
  GeoSpatialFeature feature = null;
  
  try {
    feature = new GeoSpatialFeature(field.name);
  
    String val = field.value.substring(1, field.value.length()-1);  // strip off enclosing [ ]
  
    if (val.isEmpty()) return null;
    
    String[] tokens = val.split(";");
  
    feature.setValue(Double.parseDouble(tokens[0]), Double.parseDouble(tokens[1]));
  }
  catch (Exception e) {
    e.printStackTrace();
  }
  return feature;
}

origin: unchartedsoftware/ensemble-clustering

@Override
public GeoSpatialFeature getCentroid() {
  double lat = 0, lon = 0, hyp = 0;
  
  // calculate average x,y,z coords
  double ax = cx/weight, ay = cy/weight, az = cz/weight;
  
  // convert the centroid cartesian coordinates to lat/lon		
  lon = Math.toDegrees(Math.atan2(ay, ax));
  hyp = Math.sqrt(ax * ax + ay * ay);
  lat = Math.toDegrees(Math.atan2(hyp, az));
  
  // create the centroid geospatial feature set
  GeoSpatialFeature centroid = new GeoSpatialFeature(name);
  centroid.setValue(lat, lon);
  centroid.setWeight(weight);

  return centroid;
}
origin: unchartedsoftware/ensemble-clustering

@Override
public GeoSpatialFeature getCentroid() {
  // create the centroid geospatial feature set
  GeoSpatialFeature centroid = new GeoSpatialFeature(name);
  centroid.setValue( (clat), (clon) );  // return average lat, lon - very crude method of determining centroid for geo
  centroid.setWeight(weight);
  return centroid;
}
com.oculusinfo.ml.feature.spatialGeoSpatialFeaturesetValue

Popular methods of GeoSpatialFeature

  • <init>
  • getLatitude
  • getLongitude
  • getName
  • getWeight
  • setWeight

Popular in Java

  • Making http requests using okhttp
  • getSystemService (Context)
  • getContentResolver (Context)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • ConnectException (java.net)
    A ConnectException is thrown if a connection cannot be established to a remote host on a specific po
  • MalformedURLException (java.net)
    This exception is thrown when a program attempts to create an URL from an incorrect specification.
  • Calendar (java.util)
    Calendar is an abstract base class for converting between a Date object and a set of integer fields
  • HashMap (java.util)
    HashMap is an implementation of Map. All optional operations are supported.All elements are permitte
  • NoSuchElementException (java.util)
    Thrown when trying to retrieve an element past the end of an Enumeration or Iterator.
  • JTable (javax.swing)
  • Top plugins for WebStorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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