regions

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
regions [2013/09/23 16:33]
igor
regions [2017/07/21 03:08] (current)
Line 1: Line 1:
-To work with spatial objects we use HelperJTS. According to [[http://www.vividsolutions.com/]|Vivid Solutions]], JTS is an API providing 2D spatial object model and fundamental geometric functions. It implements the geometry model defined in the OpenGIS Consortium Simple Features Specification for SQL. Functions provided include:+====== JTS Topology Suite====== 
 + 
 +To work with spatial objects we use HelperJTS. According to [[http://www.vividsolutions.com/]|Vivid Solutions]], **J**TS **T**opology **S**uite (JTSis an API providing 2D spatial object model and fundamental geometric functions. It implements the geometry model defined in the OpenGIS Consortium Simple Features Specification for SQL. Functions provided include:
        * Unordered List Item spatial predicates (based on the DE-9IM model)        * Unordered List Item spatial predicates (based on the DE-9IM model)
        * overlay functions (intersection, difference, union, symmetric difference)        * overlay functions (intersection, difference, union, symmetric difference)
Line 18: Line 20:
 Some summary information is available: Some summary information is available:
  
-    * getArea() - Returns the area of this Geometry. Area returned in the same units as the coordinates (be careful of lat/lon data!) +    * ''getArea()'' - Returns the area of this Geometry. Area returned in the same units as the coordinates (be careful of lat/lon data!) 
-  *   getCentroid() - Computes the centroid of this Geometry. +  *   ''getCentroid()'' - Computes the centroid of this Geometry. 
-  *  getEnvelope() -  Returns this Geometrys bounding box. +  *  ''getEnvelope()'' -  Returns this Geometrys bounding box. 
-  *   getEnvelopeInternal() - tReturns the minimum and maximum x and y values in this Geometry , or a null Envelope if this Geometry is empty. +  *   ''getEnvelopeInternal()'' - tReturns the minimum and maximum x and y values in this Geometry , or a null Envelope if this Geometry is empty. 
-  *  getInteriorPoint() - Computes an interior point of this Geometry. +  *  ''getInteriorPoint()'' - Computes an interior point of this Geometry. 
-  *  getDimension() - Returns the dimension of this Geometry. The dimension of the class implementing this interface, whether or not this object is the empty geometry+  *  ''getDimension()'' - Returns the dimension of this Geometry. The dimension of the class implementing this interface, whether or not this object is the empty geometry
    
  Geometry relationships are represented by the following functions returning true or false:  Geometry relationships are represented by the following functions returning true or false:
  
-  *  disjoint(Geometry) -  Returns true if this geometry is disjoint to the specified geometry. +  *  ''disjoint(Geometry)'' -  Returns true if this geometry is disjoint to the specified geometry. 
-  *   touches(Geometry) -  Returns true if this geometry touches the specified geometry. +  *   ''touches(Geometry)'' -  Returns true if this geometry touches the specified geometry. 
-  *   intersects(Geometry) - Returns true if this geometry intersects the specified geometry. +  *   ''intersects(Geometry)'' - Returns true if this geometry intersects the specified geometry. 
-  *   crosses(Geometry) -   Returns true if this geometry crosses the specified geometry. +  *   ''crosses(Geometry)'' -   Returns true if this geometry crosses the specified geometry. 
-  *  within(Geometry) - Returns true if this geometry is within the specified geometry. +  *  ''within(Geometry)'' - Returns true if this geometry is within the specified geometry. 
-  *   contains(Geometry) - Returns true if this geometry contains the specified geometry. +  *   ''contains(Geometry)'' - Returns true if this geometry contains the specified geometry. 
-  * overlaps(Geometry) - Returns true if this geometry overlaps the specified geometry. +  * ''overlaps(Geometry)'' - Returns true if this geometry overlaps the specified geometry. 
-  *   covers(Geometry) -  Returns true if this geometry covers the specified geometry. +  *   ''covers(Geometry)'' -  Returns true if this geometry covers the specified geometry. 
-  * coveredBy(Geometry) - Returns true if this geometry is covered by the specified geometry. +  * ''coveredBy(Geometry)'' - Returns true if this geometry is covered by the specified geometry. 
-  *  relate(Geometry, String) - Returns true if the elements in the DE-9IM IntersectionMatrix for the two Geometrys match the elements in intersectionPattern. +  *  ''relate(Geometry, String)'' - Returns true if the elements in the DE-9IM IntersectionMatrix for the two Geometrys match the elements in intersectionPattern. 
-  *   relate(Geometry) Returns the DE-9IM IntersectionMatrix for the two Geometrys..+  *   ''relate(Geometry)'' Returns the DE-9IM IntersectionMatrix for the two Geometrys..
    
 To actually determine a shape based on two geometry: To actually determine a shape based on two geometry:
  
-  *   intersection(Geometry) -  Computes a Geometry representing the points shared by this Geometry and other. +  *   ''intersection(Geometry)'' -  Computes a Geometry representing the points shared by this Geometry and other. 
-  *   union(Geometry) -   Computes a Geometry representing all the points in this Geometry and other. +  *   ''union(Geometry)'' -   Computes a Geometry representing all the points in this Geometry and other. 
-  *   difference(Geometry) - Computes a Geometry representing the points making up this Geometry that do not make up other. +  *   ''difference(Geometry)'' - Computes a Geometry representing the points making up this Geometry that do not make up other. 
-  *   symDifference(Geometry) - Returns a set combining the points in this Geometry not in other, and the points in other not in this Geometry.+  *   ''symDifference(Geometry)'' - Returns a set combining the points in this Geometry not in other, and the points in other not in this Geometry.
    
  Some of the most helpful functions are:  Some of the most helpful functions are:
  
-  * distance( Geometry ) - Returns the minimum distance between this Geometry and the Geometry g +  * ''distance(Geometry)'' - Returns the minimum distance between this Geometry and the Geometry g 
-  * buffer(double) -Computes a buffer area around this geometry having the given width. +  * ''buffer(double)'' -Computes a buffer area around this geometry having the given width. 
-  * union() - Computes a Geometry representing all the points in this Geometry and other.+  * ''union()'' - Computes a Geometry representing all the points in this Geometry and other.
  
 The three most difficult methods are here : The three most difficult methods are here :
  
-  * equals( Object ) - Returns true if this geometry is equal to the specified geometry +  * ''equals(Object)'' - Returns true if this geometry is equal to the specified geometry 
-  * equals( Geometry ) - checks if the geometry is the same shape +  * ''equals(Geometry)'' - checks if the geometry is the same shape 
-  * equalsExact( Geometry ) - Returns true if the two Geometrys are exactly equal, up to a specified distance tolerance.+  * ''equalsExact(Geometry)'' - Returns true if the two Geometrys are exactly equal, up to a specified distance tolerance.
  
 There are some book keeping methods to help discovery how the geometry was constructed: There are some book keeping methods to help discovery how the geometry was constructed:
  
-  * getGeometryFactory() - Gets the factory which contains the context in which this geometry was created. +  * ''getGeometryFactory()'' - Gets the factory which contains the context in which this geometry was created. 
-  * getPreceisionModel() +  * ''getPreceisionModel()'' 
-  * toText() - the WKT representation of the Geometry +  * ''toText()'' - the WKT representation of the Geometry 
-  * getGeoemtryType() - factory method called (ie “point”, “linestring”, etc..)+  * ''getGeometryType()'' - factory method called (ie “point”, “linestring”, etc..)
  
 A couple of methods are there to store your developer information: A couple of methods are there to store your developer information:
  
-  * getSRID() - stores the “spatial reference id”, used as an external key when working with databases +  * ''getSRID()'' - stores the “spatial reference id”, used as an external key when working with databases 
-  * getUserData() - intended to be used by developers, a best practice is to store a java.util.Map. GeoTools will occasionally use this field to store a “srsName” or full CoordianteReferenceSystem.+  * ''getUserData()'' - intended to be used by developers, a best practice is to store a java.util.Map. GeoTools will occasionally use this field to store a “srsName” or full CoordianteReferenceSystem.
  
 The code below is based on this two polygons. Its coordinates can be viewed in GerarPoligonoA  and GerarPoligonoB methods. The code below is based on this two polygons. Its coordinates can be viewed in GerarPoligonoA  and GerarPoligonoB methods.
  • regions.1379964787.txt.gz
  • Last modified: 2017/07/21 02:51
  • (external edit)