Package com.impetus.kundera.gis.geometry

Examples of com.impetus.kundera.gis.geometry.Circle


        return em.find(Person.class, personId);
    }

    public List<Person> findWithinCircle(double x, double y, double r, SurfaceType surfaceType)
    {
        Circle circle = new Circle(x, y, r);
        circle.setSurfaceType(surfaceType);

        Query q = em.createQuery("Select p from Person p where p.currentLocation IN ?1");
        q.setParameter(1, circle);
        List<Person> persons = q.getResultList();
        return persons;
View Full Code Here


     * @param e
     * @return
     */
    public List<Person> findUsingCLWithEQ(double x, double y)
    {
        Circle circle = new Circle(x, y, 0);
        circle.setSurfaceType(SurfaceType.FLAT);

        Query q = em.createQuery("Select p from Person p where p.currentLocation IN ?1");
        q.setParameter(1, circle);
        List<Person> persons = q.getResultList();
        return persons;
View Full Code Here

     * @return
     */
    public List<Person> findWithinCircleAndName(double x, double y, double r, SurfaceType surfaceType, String name)
    {

        Circle circle = new Circle(x, y, r);
        circle.setSurfaceType(surfaceType);

        Query q = em.createQuery("Select p from Person p where p.name = :name and p.currentLocation IN :circle");
        q.setParameter("name", name);
        q.setParameter("circle", circle);
        List<Person> persons = q.getResultList();
View Full Code Here

     * @param flat
     * @return
     */
    public int updateNameWithinCircle(double x, double y, double r, SurfaceType surfaceType)
    {
        Circle circle = new Circle(x, y, r);
        circle.setSurfaceType(surfaceType);
        Query q = em.createQuery("Update Person p SET p.name=Kuldeep where p.currentLocation IN ?1");
        q.setParameter(1, circle);
        return q.executeUpdate();
//        return persons;
    }
View Full Code Here

     * @param flat
     * @return
     */
    public int deleteNameWithinCircle(double x, double y, double r, SurfaceType surfaceType)
    {
        Circle circle = new Circle(x, y, r);
        circle.setSurfaceType(surfaceType);
        Query q = em.createQuery("Delete From Person p where p.currentLocation IN ?1");
        q.setParameter(1, circle);
        return q.executeUpdate();
    }
View Full Code Here

public class CircleQueryImpl implements GeospatialQuery
{
    @Override
    public Object createGeospatialQuery(String geolocationColumnName, Object shape, Object query)
    {
        Circle circle = (Circle) shape;
        List circleList = new ArrayList();

        circleList.add(new double[] { circle.getCentre().x, circle.getCentre().y }); // Centre
                                                                                     // of
                                                                                     // circle
        circleList.add(circle.getRadius()); // Radius

        BasicDBObject q = (BasicDBObject) query;

        if (q == null)
            q = new BasicDBObject();

        if (circle.getSurfaceType().equals(SurfaceType.SPHERICAL))
        {
            q.put(geolocationColumnName, new BasicDBObject("$within", new BasicDBObject("$centerSphere", circleList)));
        }
        else
        {
View Full Code Here

TOP

Related Classes of com.impetus.kundera.gis.geometry.Circle

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.