Java Doc for FeatureCollectionTools.java in  » GIS » openjump » de » fho » jump » pirol » utilities » apiTools » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » GIS » openjump » de.fho.jump.pirol.utilities.apiTools 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   de.fho.jump.pirol.utilities.apiTools.ToolToMakeYourLifeEasier
      de.fho.jump.pirol.utilities.apiTools.FeatureCollectionTools

FeatureCollectionTools
public class FeatureCollectionTools extends ToolToMakeYourLifeEasier (Code)
Class to speed up handling of FeatureCollections (or lists of features) during progamming by implementing a set of common tasks. Most functions can be used in a static way, but on the other hand for each FeatureCollection a instance of this class can be invoked. This might be more convenient, if there is more than one thing to do with the same feature collection.
author:
   Ole Rahn
author:
  

author:
  
FH Osnabrück - University of Applied Sciences Osnabrück,
author:
  
Project: PIROL (2005),
author:
  
Subproject: Daten- und Wissensmanagement
version:
   $Rev: 902 $


Field Summary
protected  FeatureCollectionfc
    
protected  List<Feature>featureList
    
protected static  PersonalLoggerlogger
    

Constructor Summary
public  FeatureCollectionTools(FeatureCollection fc)
    
public  FeatureCollectionTools(List<Feature> fcl)
    

Method Summary
public static  Feature[]FeatureCollection2FeatureArray(FeatureCollection fc)
     Converts a given FeatureCollection into an array of Feature, that can - by far - be faster iterated.
public static  Feature[]FeatureCollection2FeatureArray(List<Feature> features)
     Converts a given list of features into an array of Feature, that can - by far - be faster iterated.
public  PirolFeatureCollectionaddAttributeToFeatureCollection(String attr, AttributeType at, Object defaultVal)
    
public static  PirolFeatureCollectionaddAttributeToFeatureCollection(FeatureCollection fc, AttributeInfo attrInfo)
    
public static  PirolFeatureCollectionaddAttributeToFeatureCollection(FeatureCollection fc, AttributeInfo attrInfo, boolean clearOldFeatureCollection)
    
public static  PirolFeatureCollectionaddAttributeToFeatureCollection(FeatureCollection fc, String attr, AttributeType at, Object defaultVal, boolean clearOldFeatureCollection)
     Method to add a new attribute to an existing FeatureCollection.
public static  PirolFeatureCollectionaddAttributeToFeatureCollection(FeatureCollection fc, String attr, AttributeType at, Object defaultVal)
     Method to add a new attribute to an existing FeatureCollection.
public  PirolFeatureCollectionaddAttributesToFeatureCollection(List attributeInfos)
    
public static  PirolFeatureCollectionaddAttributesToFeatureCollection(FeatureCollection fc, List<AttributeInfo> attributeInfos)
    
public static  PirolFeatureCollectionaddAttributesToFeatureCollection(FeatureCollection fc, AttributeInfo[] attributeInfos)
    
public static  PirolFeatureCollectionaddAttributesToFeatureCollection(FeatureCollection fc, AttributeInfo[] attributeInfos, boolean clearOriginalFeatureCollection)
     Adds multiple attributes to a FeatureCollection
Parameters:
  fc - the source feature collection
Parameters:
  attributeInfos - array containing the attributes to be added
Parameters:
  clearOriginalFeatureCollection - set true, if you want to save RAM by clearing the original FeatureCollection, false if you still want to use it.
public static  PirolFeatureCollectionapplyFormulaToFeatureCollection(FeatureCollection oldFc, AttributeInfo attrInfo, FormulaValue formula, boolean clearOldFeatureCollection)
    
protected static  booleanattributeExistsInSchema(FeatureSchema fs, String attr)
    
final public static  PirolFeatureCollectioncloneFeatureCollection(FeatureCollection fc)
    
public static  FeaturecopyFeature(Feature feat)
    
public static  FeaturecopyFeatureAndSetFeatureSchema(Feature feat, FeatureSchema newFs)
    
public static  voiddeleteFeatures(List<Feature> features, PlugInContext context)
     deletes the given features from the map.
public static  doublegetAritmeticMiddleForAttribute(Feature[] features, String attr)
    
public static  doublegetAritmeticMiddleForAttribute(List<Feature> features, int attr)
    
public static  doublegetAritmeticMiddleForAttribute(Feature[] featArray, int attr)
    
public static  GeometrygetCenterOfMass(Feature[] features)
     Calculates the center of mass for the gives features' geometries.
public static  EnvelopegetEnvelopeForFeatures(Feature[] features)
     Creates an envelope object for the features in the given array.
public  FeaturegetFeature(int fid)
     gets the Feature with the given FID.
public static  FeaturegetFeatureFromCollection(List<Feature> features, int fid)
    
public static  FeaturegetFeatureFromCollection(Feature[] features, int fid)
    
public static  FeaturegetFeatureFromCollection(FeatureCollection features, int fid)
    
public static  Object[]getMeanOrModeForAttributes(Feature[] features, String[] attrs)
     Method to calculate means (or modes) for the attributes given.
public static  double[]getMinMaxAttributeValue(Feature[] featArray, FeatureSchema fs, String attr)
    
public static  double[]getMinMaxAttributeValue(FeatureCollection features, String attr)
    
public static  ObjectgetModusForAttribute(Feature[] features, String attr)
    
public static  ObjectgetModusForAttribute(Feature[] features, int attr)
    
public static  intgetNumOfDifferentAttributeValues(Feature[] features, String attr)
    
public static  intgetNumOfDifferentAttributeValues(Feature[] features, int attr)
    
public static  SetgetSetOfDifferentAttributeValues(Feature[] features, String attr)
    
public static  Set<Object>getSetOfDifferentAttributeValues(Feature[] features, int attr)
    
public  StringgetUniqueAttributeName(String attr)
    
public static  StringgetUniqueAttributeName(FeatureCollection fc, String attr)
    
final public static  HashMap<Object, Integer>[]getValueAppearancesCount(Feature[] features, int[] attrs)
     Counts the number of appearances of each value of the given attributes within the given features.
public static  booleanisAttributeTypeNumeric(AttributeType at)
    
public static  ObjectresizeArray(Object oldArray, int newSize)
     Reallocates an array with a new size, and copies the contents of the old array to the new array.
Parameters:
  oldArray - the old array, to be reallocated.
Parameters:
  newSize - the new array size.

Field Detail
fc
protected FeatureCollection fc(Code)



featureList
protected List<Feature> featureList(Code)



logger
protected static PersonalLogger logger(Code)




Constructor Detail
FeatureCollectionTools
public FeatureCollectionTools(FeatureCollection fc)(Code)



FeatureCollectionTools
public FeatureCollectionTools(List<Feature> fcl)(Code)




Method Detail
FeatureCollection2FeatureArray
public static Feature[] FeatureCollection2FeatureArray(FeatureCollection fc)(Code)
Converts a given FeatureCollection into an array of Feature, that can - by far - be faster iterated.
Parameters:
  fc - the feature Collection an array of the features of the feature collection



FeatureCollection2FeatureArray
public static Feature[] FeatureCollection2FeatureArray(List<Feature> features)(Code)
Converts a given list of features into an array of Feature, that can - by far - be faster iterated.
Parameters:
  features - list of features an array of the features of the feature list



addAttributeToFeatureCollection
public PirolFeatureCollection addAttributeToFeatureCollection(String attr, AttributeType at, Object defaultVal)(Code)



addAttributeToFeatureCollection
public static PirolFeatureCollection addAttributeToFeatureCollection(FeatureCollection fc, AttributeInfo attrInfo)(Code)



addAttributeToFeatureCollection
public static PirolFeatureCollection addAttributeToFeatureCollection(FeatureCollection fc, AttributeInfo attrInfo, boolean clearOldFeatureCollection)(Code)



addAttributeToFeatureCollection
public static PirolFeatureCollection addAttributeToFeatureCollection(FeatureCollection fc, String attr, AttributeType at, Object defaultVal, boolean clearOldFeatureCollection)(Code)
Method to add a new attribute to an existing FeatureCollection. Since there is no "legal" way to add an attribute to a FeatureCollection, this method creates (and returns) a new FeatureCollection with a new FeatureSchema to do this operation. If a layer is to be manipulated the new FeatureCollection has to be set as THE FeatureCollection for the layer...
Parameters:
  fc - the old feature collection
Parameters:
  attr - name of the new attribute
Parameters:
  at - type of the new attribute
Parameters:
  defaultVal - the initial value for the attribute, since we do not want NULL values in the attribute table
Parameters:
  clearOldFeatureCollection - if true the old feature collection will be erased to save RAM new FeatureCollection with a new FeatureSchema including the new attribute



addAttributeToFeatureCollection
public static PirolFeatureCollection addAttributeToFeatureCollection(FeatureCollection fc, String attr, AttributeType at, Object defaultVal)(Code)
Method to add a new attribute to an existing FeatureCollection. Since there is no "legal" way to add an attribute to a FeatureCollection, this method creates (and returns) a new FeatureCollection with a new FeatureSchema to do this operation. If a layer is to be manipulated the new FeatureCollection has to be set as THE FeatureCollection for the layer...
Parameters:
  fc - the old feature collection
Parameters:
  attr - name of the new attribute
Parameters:
  at - type of the new attribute
Parameters:
  defaultVal - the initial value for the attribute, since we do not want NULL values in the attribute table new FeatureCollection with a new FeatureSchema including the new attribute



addAttributesToFeatureCollection
public PirolFeatureCollection addAttributesToFeatureCollection(List attributeInfos)(Code)
Adds multiple attributes to the FeatureCollection
Parameters:
  attributeInfos - list containing the attributes (as AttributeInfo objects) to be added a new FeatureCollection containing the old and the new attributes
See Also:   AttributeInfo



addAttributesToFeatureCollection
public static PirolFeatureCollection addAttributesToFeatureCollection(FeatureCollection fc, List<AttributeInfo> attributeInfos)(Code)
Adds multiple attributes to a FeatureCollection
Parameters:
  fc - the source feature collection
Parameters:
  attributeInfos - list containing the attributes (as AttributeInfo objects) to be added a new FeatureCollection containing the old and the new attributes
See Also:   AttributeInfo



addAttributesToFeatureCollection
public static PirolFeatureCollection addAttributesToFeatureCollection(FeatureCollection fc, AttributeInfo[] attributeInfos)(Code)



addAttributesToFeatureCollection
public static PirolFeatureCollection addAttributesToFeatureCollection(FeatureCollection fc, AttributeInfo[] attributeInfos, boolean clearOriginalFeatureCollection)(Code)
Adds multiple attributes to a FeatureCollection
Parameters:
  fc - the source feature collection
Parameters:
  attributeInfos - array containing the attributes to be added
Parameters:
  clearOriginalFeatureCollection - set true, if you want to save RAM by clearing the original FeatureCollection, false if you still want to use it. a new FeatureCollection containing the old and the new attributes



applyFormulaToFeatureCollection
public static PirolFeatureCollection applyFormulaToFeatureCollection(FeatureCollection oldFc, AttributeInfo attrInfo, FormulaValue formula, boolean clearOldFeatureCollection)(Code)
Method to apply a given formula to the given, new attribute of the given featureCollection
Parameters:
  oldFc - old FeatureCollection that will be replaced by the new one
Parameters:
  attrInfo - information for the new attribute
Parameters:
  formula - the parsed formula FeatureCollection containing the new attribute



attributeExistsInSchema
protected static boolean attributeExistsInSchema(FeatureSchema fs, String attr)(Code)



cloneFeatureCollection
final public static PirolFeatureCollection cloneFeatureCollection(FeatureCollection fc)(Code)
deep copies a the FeatureSchema, the Features and their Geometries
Parameters:
  fc - the FeatureCollection to copy the new copied FeatureCollection



copyFeature
public static Feature copyFeature(Feature feat)(Code)
"deep copys" the given Feature
Parameters:
  feat - the feature to be copied copy of the feature



copyFeatureAndSetFeatureSchema
public static Feature copyFeatureAndSetFeatureSchema(Feature feat, FeatureSchema newFs)(Code)
"deep copys" the given Feature and thereby sets the given feature schema
Parameters:
  feat - the feature to be copied
Parameters:
  newFs - the new feature schema copy of the feature



deleteFeatures
public static void deleteFeatures(List<Feature> features, PlugInContext context)(Code)
deletes the given features from the map. It thereby creates an EditTransaction that enables the user to undo the deletion.
Parameters:
  features - features to be deleted
Parameters:
  context - curr. PlugIn context



getAritmeticMiddleForAttribute
public static double getAritmeticMiddleForAttribute(Feature[] features, String attr)(Code)

Parameters:
  features - list of features to calculate the mean for
Parameters:
  attr - name of attribute to calculate the mean for the mean (double because a mean of integers will very likely be a double)



getAritmeticMiddleForAttribute
public static double getAritmeticMiddleForAttribute(List<Feature> features, int attr)(Code)

Parameters:
  features - list of features to calculate the mean for
Parameters:
  attr - index of attribute to calculate the mean for the mean (double because a mean of integers will very likely be a double)



getAritmeticMiddleForAttribute
public static double getAritmeticMiddleForAttribute(Feature[] featArray, int attr)(Code)

Parameters:
  featArray - array of features to calculate the mean for
Parameters:
  attr - index of attribute to calculate the mean for the mean (double because a mean of integers will very likely be a double)



getCenterOfMass
public static Geometry getCenterOfMass(Feature[] features)(Code)
Calculates the center of mass for the gives features' geometries. It's like getCentroid(), but puts out one center of mass for N features instead of N centers for N features.
Parameters:
  features - the features the point, representing the center of mass



getEnvelopeForFeatures
public static Envelope getEnvelopeForFeatures(Feature[] features)(Code)
Creates an envelope object for the features in the given array. This is an easy way to get an envelope for a subset of a layer's features.
Parameters:
  features - array of Feature object to create an envelope for the envelope containing the given features



getFeature
public Feature getFeature(int fid)(Code)
gets the Feature with the given FID.
Parameters:
  fid - FID to look for the feature



getFeatureFromCollection
public static Feature getFeatureFromCollection(List<Feature> features, int fid)(Code)
Get the feature with the specified ID from the List
Parameters:
  features - array with Feature objects
Parameters:
  fid - the feature ID we are looking for feature with specified FID if exists, else null



getFeatureFromCollection
public static Feature getFeatureFromCollection(Feature[] features, int fid)(Code)
Get the feature with the specified ID from the array
Parameters:
  features - array with Feature objects
Parameters:
  fid - the feature ID we are looking for feature with specified FID if exists, else null



getFeatureFromCollection
public static Feature getFeatureFromCollection(FeatureCollection features, int fid)(Code)
Get the feature with the specified ID from the FeatureCollection
Parameters:
  features - array with Feature objects
Parameters:
  fid - the feature ID we are looking for feature with specified FID if exists, else null



getMeanOrModeForAttributes
public static Object[] getMeanOrModeForAttributes(Feature[] features, String[] attrs)(Code)
Method to calculate means (or modes) for the attributes given. If means or modes are calulated depends on the attribute type of each given given attribute. This method is hopefully faster, than calculation each mean (mode) in an extra loop, if there are more means (modes) to calculate than one...
Parameters:
  features - list of features to calculate mean/modes for
Parameters:
  attrs - array of attribute names to calculate mean/modes for array of objects, representing means (or modes) --> e.g. Double, Integer or String objects.



getMinMaxAttributeValue
public static double[] getMinMaxAttributeValue(Feature[] featArray, FeatureSchema fs, String attr)(Code)



getMinMaxAttributeValue
public static double[] getMinMaxAttributeValue(FeatureCollection features, String attr)(Code)



getModusForAttribute
public static Object getModusForAttribute(Feature[] features, String attr)(Code)

Parameters:
  features - list of features to calculate the mode for
Parameters:
  attr - name of attribute to calculate the mode for the mode



getModusForAttribute
public static Object getModusForAttribute(Feature[] features, int attr)(Code)

Parameters:
  features - list of features to calculate the mode for
Parameters:
  attr - index of attribute to calculate the mode for the mode



getNumOfDifferentAttributeValues
public static int getNumOfDifferentAttributeValues(Feature[] features, String attr)(Code)

Parameters:
  features - list of features
Parameters:
  attr - name of attribute number of differnt values in the given features attributes or -1 if an error occurs



getNumOfDifferentAttributeValues
public static int getNumOfDifferentAttributeValues(Feature[] features, int attr)(Code)

Parameters:
  features - list of features
Parameters:
  attr - index of attribute number of differnt values in the given features attributes or -1 if an error occurs



getSetOfDifferentAttributeValues
public static Set getSetOfDifferentAttributeValues(Feature[] features, String attr)(Code)

Parameters:
  features - list of features
Parameters:
  attr - name of attribute number of differnt values in the given features attributes or -1 if an error occurs



getSetOfDifferentAttributeValues
public static Set<Object> getSetOfDifferentAttributeValues(Feature[] features, int attr)(Code)

Parameters:
  features - list of features
Parameters:
  attr - index of attribute number of differnt values in the given features attributes or -1 if an error occurs



getUniqueAttributeName
public String getUniqueAttributeName(String attr)(Code)



getUniqueAttributeName
public static String getUniqueAttributeName(FeatureCollection fc, String attr)(Code)



getValueAppearancesCount
final public static HashMap<Object, Integer>[] getValueAppearancesCount(Feature[] features, int[] attrs)(Code)
Counts the number of appearances of each value of the given attributes within the given features. (Somewhat like a histogram for each given attribute, but each histogram class is just a single value.)
Parameters:
  features - array of Features to count value appearances for
Parameters:
  attrs - array of attribute indices of attributes to count value appearances for Array of mappings of values to number of appearances



isAttributeTypeNumeric
public static boolean isAttributeTypeNumeric(AttributeType at)(Code)



resizeArray
public static Object resizeArray(Object oldArray, int newSize)(Code)
Reallocates an array with a new size, and copies the contents of the old array to the new array.
Parameters:
  oldArray - the old array, to be reallocated.
Parameters:
  newSize - the new array size. A new array with the same contents.




Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.