/layers-store/src/main/java/org/ala/layers/tabulation/TabulationUtil.java

http://alageospatialportal.googlecode.com/ · Java · 41 lines · 19 code · 4 blank · 18 comment · 0 complexity · 4d6c49127ed9ef6bdbab83730c735561 MD5 · raw file

  1. /**************************************************************************
  2. * Copyright (C) 2010 Atlas of Living Australia
  3. * All Rights Reserved.
  4. *
  5. * The contents of this file are subject to the Mozilla Public
  6. * License Version 1.1 (the "License"); you may not use this file
  7. * except in compliance with the License. You may obtain a copy of
  8. * the License at http://www.mozilla.org/MPL/
  9. *
  10. * Software distributed under the License is distributed on an "AS
  11. * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
  12. * implied. See the License for the specific language governing
  13. * rights and limitations under the License.
  14. ***************************************************************************/
  15. package org.ala.layers.tabulation;
  16. import java.io.IOException;
  17. import org.ala.layers.intersect.SimpleRegion;
  18. import org.ala.layers.intersect.SimpleShapeFile;
  19. import org.ala.spatial.analysis.layers.Records;
  20. /**
  21. *
  22. * @author Adam
  23. */
  24. public class TabulationUtil {
  25. static public int calculateOccurrences(String pathToRecords, String wkt) throws IOException {
  26. SimpleRegion region = SimpleShapeFile.parseWKT(wkt);
  27. Records records = new Records(pathToRecords, region);
  28. int result = records.getRecordsSize();
  29. return result;
  30. }
  31. static public int calculateSpecies(String pathToRecords, String wkt) throws IOException {
  32. SimpleRegion region = SimpleShapeFile.parseWKT(wkt);
  33. Records records = new Records(pathToRecords, region);
  34. int result = records.getSpeciesSize();
  35. return result;
  36. }
  37. }