Package jsky.catalog

Examples of jsky.catalog.QueryResult


     * and return the world coordinates corresponding the name.
     */
    private WorldCoords _resolveObjectName(String objectName, Catalog cat) throws IOException {
        QueryArgs queryArgs = new BasicQueryArgs(cat);
        queryArgs.setId(objectName);
        QueryResult r = cat.query(queryArgs);
        if (r instanceof TableQueryResult) {
            Coordinates coords = ((TableQueryResult) r).getCoordinates(0);
            if (coords instanceof WorldCoords) {
                return (WorldCoords) coords;
            }
View Full Code Here


        try {
            System.out.println("test query: at center position/radius: ");
            QueryArgs queryArgs = new BasicQueryArgs(cat);
            queryArgs.setParamValue("center", "03:19:44.44+41:30:58.21");
            queryArgs.setParamValue("radius", "2");
            QueryResult queryResult = cat.query(queryArgs);
            System.out.println("result: " + queryResult);
            if (queryResult instanceof AstroCatTable) {
                ((AstroCatTable) queryResult).saveAsSkycatTable(System.out);
            } else {
                System.out.println("Can't print table");
View Full Code Here

        try {
            System.out.println("");
            System.out.println("test query: of GSC0285601186");
            QueryArgs q = new BasicQueryArgs(cat);
            q.setId("GSC0285601186");
            QueryResult r = cat.query(q);
            if (r instanceof AstroCatTable) {
                AstroCatTable table = (AstroCatTable) r;
                System.out.println("Number of result rows: " + table.getRowCount());
                if (table.getRowCount() != 0)
                    System.out.println("result: " + r.toString());
            } else {
                System.out.println("Failed search by ID");
            }

            System.out.println("");
            System.out.println("test query: at center position/radius: ");
            q = new BasicQueryArgs(cat);
            q.setRegion(new CoordinateRadius(new WorldCoords("03:19:44.44", "+41:30:58.21"), 1.));
            r = cat.query(q);

            if (r instanceof AstroCatTable) {
                AstroCatTable table = (AstroCatTable) r;
                System.out.println("Number of result rows: " + table.getRowCount());
                if (table.getRowCount() != 0)
                    System.out.println("result: " + r.toString());
            } else {
                System.out.println("Failed search by position");
            }
        } catch (Exception e) {
            e.printStackTrace();
View Full Code Here

        try {
            System.out.println("");
            System.out.println("test query: of GSC0285601186");
            QueryArgs q = new BasicQueryArgs(cat);
            q.setId("GSC0285601186");
            QueryResult r = cat.query(q);
            if (r instanceof SkycatTable) {
                SkycatTable table = (SkycatTable) r;
                System.out.println("Number of result rows: " + table.getRowCount());
                if (table.getRowCount() != 0)
                    System.out.println("result: " + r.toString());
            } else {
                System.out.println("Failed search by ID");
            }

            System.out.println("");
            System.out.println("test query: at center position/radius: ");
            q = new BasicQueryArgs(cat);
            q.setRegion(new CoordinateRadius(new WorldCoords("03:19:44.44", "+41:30:58.21"), 1.));
            r = cat.query(q);

            if (r instanceof SkycatTable) {
                SkycatTable table = (SkycatTable) r;
                System.out.println("Number of result rows: " + table.getRowCount());
                if (table.getRowCount() != 0)
                    System.out.println("result: " + r.toString());
            } else {
                System.out.println("Failed search by position");
            }
        } catch (Exception e) {
            e.printStackTrace();
View Full Code Here

TOP

Related Classes of jsky.catalog.QueryResult

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.