Tabnine Logo
Geometry.getArea
Code IndexAdd Tabnine to your IDE (free)

How to use
getArea
method
in
com.vividsolutions.jts.geom.Geometry

Best Java code snippets using com.vividsolutions.jts.geom.Geometry.getArea (Showing top 20 results out of 369)

origin: osmandapp/Osmand

  @Override
  public boolean accept(Geometry geometry) {
    boolean accept = true;

    if((geometry instanceof Polygon || geometry instanceof MultiPolygon)
        && geometry.getArea() < minArea) {
      accept = false;

    } else if((geometry instanceof LineString || geometry instanceof MultiLineString)
        && geometry.getLength() < minLength) {
      accept = false;
    }

    return accept;
  }
}
origin: com.vividsolutions/jts

/**
 *  Returns the area of this <code>GeometryCollection</code>
 *
 * @return the area of the polygon
 */
public double getArea()
{
 double area = 0.0;
 for (int i = 0; i < geometries.length; i++) {
  area += geometries[i].getArea();
 }
 return area;
}
origin: com.vividsolutions/jts

static double area(Collection geoms)
{
  double area = 0.0;
   for (Iterator i = geoms.iterator(); i.hasNext(); ) {
     Geometry geom = (Geometry) i.next();
     area += geom.getArea();
   }
   return area;
}
 
origin: com.vividsolutions/jts

private void checkArea()
{
  double inputArea = input.getArea();
  double resultArea = result.getArea();
  
  if (distance > 0.0
      && inputArea > resultArea) {
    isValid = false;
    errorMsg = "Area of positive buffer is smaller than input";
  errorIndicator = result;
  }
  if (distance < 0.0
      && inputArea < resultArea) {
    isValid = false;
    errorMsg = "Area of negative buffer is larger than input";
    errorIndicator = result;
  }
 report("Area");
}
 
origin: com.vividsolutions/jts

public double measure(Geometry g1, Geometry g2)
{        
  double areaInt = g1.intersection(g2).getArea();
  double areaUnion = g1.union(g2).getArea();
  return areaInt / areaUnion;
}
 
origin: opentripplanner/OpenTripPlanner

private void createNamedAreas(AreaEdgeList edgeList, Ring ring, Collection<Area> areas) {
  Polygon containingArea = ring.toJtsPolygon();
  for (Area area : areas) {
    Geometry intersection = containingArea.intersection(area.toJTSMultiPolygon());
    if (intersection.getArea() == 0) {
      continue;
    }
    NamedArea namedArea = new NamedArea();
    OSMWithTags areaEntity = area.parent;
    int cls = StreetEdge.CLASS_OTHERPATH;
    cls |= OSMFilter.getStreetClasses(areaEntity);
    namedArea.setStreetClass(cls);
    String id = "way (area) " + areaEntity.getId() + " (splitter linking)";
    I18NString name = handler.getNameForWay(areaEntity, id);
    namedArea.setName(name);
    WayProperties wayData = wayPropertySet.getDataForWay(areaEntity);
    Double safety = wayData.getSafetyFeatures().first;
    namedArea.setBicycleSafetyMultiplier(safety);
    namedArea.setOriginalEdges(intersection);
    StreetTraversalPermission permission = OSMFilter.getPermissionsForEntity(areaEntity,
        StreetTraversalPermission.PEDESTRIAN_AND_BICYCLE);
    namedArea.setPermission(permission);
    edgeList.addArea(namedArea);
  }
}
origin: org.geotools/gt-main

static public double area(Geometry arg0)
{
   if (arg0 == null) return -1d;
   Geometry _this = arg0;
   return _this.getArea();
}
origin: org.orbisgis/h2gis

  public static Double getArea(Geometry geometry) {
    if(geometry==null) {
      return null;
    }
    return geometry.getArea();
  }
}
origin: org.geotools/gt2-main

static public double area(Geometry arg0)
{
   Geometry _this = arg0;
   return _this.getArea();
}
origin: org.orbisgis/h2spatial

  public static Double getArea(Geometry geometry) {
    if(geometry==null) {
      return null;
    }
    return geometry.getArea();
  }
}
origin: org.orbisgis/h2gis-functions

  public static Double getArea(Geometry geometry) {
    if(geometry==null) {
      return null;
    }
    return geometry.getArea();
  }
}
origin: com.vividsolutions/jts-example

static double area(Collection geoms)
{
  double area = 0.0;
   for (Iterator i = geoms.iterator(); i.hasNext(); ) {
     Geometry geom = (Geometry) i.next();
     area += geom.getArea();
   }
   return area;
}
 
origin: com.vividsolutions/jts-core

public double measure(Geometry g1, Geometry g2)
{        
  double areaInt = g1.intersection(g2).getArea();
  double areaUnion = g1.union(g2).getArea();
  return areaInt / areaUnion;
}
 
origin: org.jboss.teiid/teiid-engine

public static double area(GeometryType geom) throws FunctionExecutionException {
  Geometry g = getGeometry(geom);
  return g.getArea();
}
origin: org.geotools/gt-jts-wrapper

public final double getArea() {
  com.vividsolutions.jts.geom.Geometry jtsGeom = getJTSGeometry();
  return jtsGeom.getArea();
}
origin: org.geotools/gt2-jts-wrapper

public final double getArea() {
  com.vividsolutions.jts.geom.Geometry jtsGeom = getJTSGeometry();
  return jtsGeom.getArea();
}
origin: BaseXdb/basex

 @Override
 public Item item(final QueryContext qc, final InputInfo ii) throws QueryException {
  return Dbl.get(checkGeo(0, qc).getArea());
 }
}
origin: org.geoserver/wms

@Override
protected Double getSortAttributeValue(SimpleFeature f) {
  Geometry g = (Geometry) f.getAttribute(attribute);
  if (g instanceof MultiPoint)
    return (double) ((MultiPoint) g).getNumGeometries();
  if (g instanceof Polygon || g instanceof MultiPolygon)
    return g.getArea();
  else
    return g.getLength();
}
origin: org.geoserver/kml

@Override
protected Double getSortAttributeValue(SimpleFeature f) {
  Geometry g = (Geometry) f.getAttribute(attribute);
  if (g instanceof MultiPoint)
    return (double) ((MultiPoint) g).getNumGeometries();
  if (g instanceof Polygon || g instanceof MultiPolygon)
    return g.getArea();
  else
    return g.getLength();
}
origin: mapplus/spatial_statistics_for_geotools_udig

public double getArea(Geometry geometry, AreaUnit targetUnit) {
  double area = transformGeometry(geometry).getArea();
  if (targetUnit == AreaUnit.Default) {
    return area;
  }
  return UnitConverter.convertArea(Measure.valueOf(area, areaUnit), targetUnit);
}
com.vividsolutions.jts.geomGeometrygetArea

Javadoc

Returns the area of this Geometry. Areal Geometries have a non-zero area. They override this function to compute the area. Others return 0.0

Popular methods of Geometry

  • getEnvelopeInternal
    Gets an Envelope containing the minimum and maximum x and y values in this Geometry. If the geometr
  • getCoordinates
    Returns an array containing the values of all the vertices for this geometry. If the geometry is a c
  • isEmpty
    Tests whether the set of points covered by this Geometry is empty.
  • getCentroid
    Computes the centroid of this Geometry. The centroid is equal to the centroid of the set of componen
  • getGeometryN
    Returns an element Geometry from a GeometryCollection(or this, if the geometry is not a collection).
  • toText
    Returns the Well-known Text representation of this Geometry. For a definition of the Well-known Text
  • getNumGeometries
    Returns the number of Geometrys in a GeometryCollection(or 1, if the geometry is not a collection).
  • getFactory
    Gets the factory which contains the context in which this geometry was created.
  • getGeometryType
    Returns the name of this Geometry's actual class.
  • getSRID
    Returns the ID of the Spatial Reference System used by the Geometry. JTS supports Spatial Reference
  • getCoordinate
    Returns a vertex of this Geometry (usually, but not necessarily, the first one). The returned coordi
  • intersection
    Computes a Geometry representing the point-set which is common to both this Geometry and the other
  • getCoordinate,
  • intersection,
  • buffer,
  • contains,
  • getEnvelope,
  • intersects,
  • union,
  • apply,
  • getLength

Popular in Java

  • Making http requests using okhttp
  • runOnUiThread (Activity)
  • getSystemService (Context)
  • startActivity (Activity)
  • InetAddress (java.net)
    An Internet Protocol (IP) address. This can be either an IPv4 address or an IPv6 address, and in pra
  • ArrayList (java.util)
    ArrayList is an implementation of List, backed by an array. All optional operations including adding
  • Calendar (java.util)
    Calendar is an abstract base class for converting between a Date object and a set of integer fields
  • LinkedList (java.util)
    Doubly-linked list implementation of the List and Dequeinterfaces. Implements all optional list oper
  • SortedSet (java.util)
    SortedSet is a Set which iterates over its elements in a sorted order. The order is determined eithe
  • ThreadPoolExecutor (java.util.concurrent)
    An ExecutorService that executes each submitted task using one of possibly several pooled threads, n
  • PhpStorm for WordPress
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