/layers-store/src/main/java/org/ala/layers/tabulation/TabulationUtil.java
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 16package org.ala.layers.tabulation; 17 18import java.io.IOException; 19import org.ala.layers.intersect.SimpleRegion; 20import org.ala.layers.intersect.SimpleShapeFile; 21import org.ala.spatial.analysis.layers.Records; 22 23/** 24 * 25 * @author Adam 26 */ 27public class TabulationUtil { 28 static public int calculateOccurrences(String pathToRecords, String wkt) throws IOException { 29 SimpleRegion region = SimpleShapeFile.parseWKT(wkt); 30 Records records = new Records(pathToRecords, region); 31 int result = records.getRecordsSize(); 32 return result; 33 } 34 35 static public int calculateSpecies(String pathToRecords, String wkt) throws IOException { 36 SimpleRegion region = SimpleShapeFile.parseWKT(wkt); 37 Records records = new Records(pathToRecords, region); 38 int result = records.getSpeciesSize(); 39 return result; 40 } 41}