All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.wikibrain.spatial.dao.SpatialNeighborDao Maven / Gradle / Ivy

There is a newer version: 0.9.1
Show newest version
package org.wikibrain.spatial.dao;

import com.vividsolutions.jts.geom.Geometry;
import gnu.trove.set.TIntSet;
import org.wikibrain.core.dao.DaoException;

import java.util.Map;
import java.util.Set;

/**
 * Created by toby on 4/17/14.
 */
public interface SpatialNeighborDao {
    /**
     * Returns the item ids of the items spatially located with a given distance range with the geometry corresponding to the input (itemId, layerName, refSysName).
     * @param itemId itemId of the container
     * @param layerName layer of the container
     * @param refSysName refSysName of the container
     * @param subLayers the layers in which to search for contained objects (in the input ref sys)
     * @param minDist the min distance range
     * @param maxDist the max distance range
     * @return
     * @throws org.wikibrain.core.dao.DaoException
     */
    public TIntSet getNeighboringItemIds(Integer itemId, String layerName, String refSysName, Set subLayers, double minDist, double maxDist) throws DaoException;
    /**
     * Returns the item ids of the items spatially located with a given distance range with the geometry corresponding to the input (itemId, layerName, refSysName).
     * @param g The starting point
     * @param refSysName refSysName of the starting point
     * @param subLayers the layers in which to search for the objects (in the input ref sys)
     * @param minDist the min distance range in angular
     * @param maxDist the max distance range in angular
     * @return a IntSet contatins spatial items with in the given range in the given layer
     * @throws org.wikibrain.core.dao.DaoException
     */
    public TIntSet getNeighboringItemIds(Geometry g, String refSysName, Set subLayers, double minDist, double maxDist) throws DaoException;
    /**
     * Returns the item ids of the items spatially located with a given distance range with the geometry corresponding to the input (itemId, layerName, refSysName).
     * @param itemId itemId of the starting point
     * @param layerName layer of the starting point
     * @param refSysName refSysName of the starting point
     * @param subLayers the layers in which to search for the objects (in the input ref sys)
     * @param maxDist the min distance range in km
     * @return a IntSet contatins spatial items with in the given range in the given layer
     * @throws org.wikibrain.core.dao.DaoException
     */
    public TIntSet getMaxDistanceKmItemIds(Integer itemId, String layerName, String refSysName, Set subLayers, double maxDist) throws DaoException;
    /**
     * Returns the item ids of the items spatially located with a given distance range with the geometry corresponding to the input (itemId, layerName, refSysName).
     * @param g The starting point
     * @param refSysName refSysName of the starting point
     * @param subLayers the layers in which to search for the objects (in the input ref sys)
     * @param maxDist the min distance range in km
     * @return a IntSet contatins spatial items with in the given range in the given layer
     * @throws org.wikibrain.core.dao.DaoException
     */
    public TIntSet getMaxDistanceKmItemIds(Geometry g, String refSysName, Set subLayers, double maxDist) throws DaoException;


    public Map getKNNeighbors(Integer itemId, int k, String layerName, String refSysName, Set excludeSet) throws DaoException;

    public Map getKNNeighbors(Geometry geometry, int k, String layerName, String refSysName, Set excludeSet) throws DaoException;

    public Map getNeighbors(Geometry geometry, String layerName, String refSysName, Set excludeSet) throws DaoException;

    public Map getNeighbors(Integer itemId, String layerName, String refSysName, Set excludeSet) throws DaoException;



}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy