Package org.geoscript.js.geom

Examples of org.geoscript.js.geom.Geometry$BinaryFunction


        NativeObject properties = null;
        if (propertiesObj != null) {
            properties = (NativeObject) propertiesObj;
        }

        Geometry geometry = null;
        if (config.has("geometry", config)) {
            // GeoJSON config
            Object geometryObj = config.get("geometry", config);
            if (!(geometryObj instanceof NativeObject)) {
                throw ScriptRuntime.constructError("Error",
View Full Code Here


    }
   
    @JSGetter
    public Bounds getBounds() {
        Bounds bounds = null;
        Geometry geometry = getGeometry();
        if (geometry != null) {
            bounds = geometry.getBounds();
        }
        return bounds;
    }
View Full Code Here

        if (geomName != null && geomName.equals(name)) {
            if (!(value instanceof Geometry)) {
                throw ScriptRuntime.constructError("Error", "Attempted to set geometry property to a non-geometry object: " + Context.toString(value));
            }
            Projection featureProj = getProjection();
            Geometry geometry = (Geometry) value;
            Projection geomProj = geometry.getProjection();
            if (featureProj != null) {
                if (geomProj != null) {
                    if (!featureProj.equals(geometry.getProjection())) {
                        value = geometry.transform(featureProj);
                    }
                }
            } else if (geomProj != null) {
                throw ScriptRuntime.constructError("Error", "Cannot add a geometry with a projection to a feature without a projection");
            }
View Full Code Here

        Schema schema = getSchema();
        Scriptable schemaConfig = schema.getConfig();
        config.put("schema", config, schemaConfig);

        // add default geometry member
        Geometry geometry = getGeometry();
        Scriptable geomConfig = null;
        if (geometry != null) {
            geomConfig = geometry.getConfig();
        }
        config.put("geometry", config, geomConfig);

        // add all other properties
        Context cx = getCurrentContext();
View Full Code Here

     * @return
     */
    public static String write(Context cx, Scriptable thisObj,
            Object[] args, Function funObj) {
       
        Geometry geometry = null;
        if (args.length == 1) {
            Object geomObj = args[0];
            if (geomObj instanceof Geometry) {
                geometry = (Geometry) geomObj;
            }
        }
        if (geometry == null) {
            throw ScriptRuntime.constructError("Error",
            "The write function expects a single geometry argument");
        }
        return wktWriter.write((com.vividsolutions.jts.geom.Geometry) geometry.unwrap());
    }
View Full Code Here

TOP

Related Classes of org.geoscript.js.geom.Geometry$BinaryFunction

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.