Revision 43999

View differences:

trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.app/org.gvsig.app.mainplugin/src/main/java/org/gvsig/app/project/ProjectSymbolTable.java
267 267
            super(
268 268
                    "Project",
269 269
                    "Area",
270
                    Range.is(3),
270
                    Range.between(2,3),
271 271
                    "Calculate the area of the geometry in the indicated units",
272
                    "Area({{geometry}}, projection, units)",
272
                    "Area({{geometry}}, \"m\")",
273 273
                    new String[]{
274 274
                        "geometry - Geometry",
275
                        "Projection - Projection or a string with the projection name",
275
                        "Projection - Optional. Projection of the geometry or a string with the projection name",
276 276
                        "units - String value with the name the units to use"
277 277
                    },
278 278
                    "Double"
......
281 281

  
282 282
        @Override
283 283
        public Object call(Interpreter interpreter, Object[] args) throws Exception {
284
            int units = 0;
285
            IProjection proj = null;
284 286
            Geometry geom = getGeom(args, 0);
285
            IProjection proj = getProjection(args, 1);
286
            int units = getUnits(args, 2);
287
            switch( args.length ) {
288
                case 2:
289
                    units = getUnits(args, 1);
290
                    break;
291
                case 3:
292
                    proj = getProjection(args, 1);
293
                    units = getUnits(args, 2);
294
                    break;
295
            }
287 296
            if (proj == null) {
288 297
                proj = geom.getProjection();
289 298
            }
......
299 308
            super(
300 309
                    "Project",
301 310
                    "Perimeter",
302
                    Range.is(3),
311
                    Range.between(2,3),
303 312
                    "Calculate the perimeter of the geometry in the indicated units",
304
                    "Perimeter({{geometry}}, projection, units)",
313
                    "Perimeter({{geometry}}, \"m\")",
305 314
                    new String[]{
306 315
                        "geometry - Geometry",
307
                        "Projection - Projection or a string with the projection name",
316
                        "Projection - Optional. Projection of the geometry or a string with the projection name",
308 317
                        "units - String value with the name the units to use"
309 318
                    },
310 319
                    "Double"
......
313 322

  
314 323
        @Override
315 324
        public Object call(Interpreter interpreter, Object[] args) throws Exception {
325
            int units = 0;
326
            IProjection proj = null;
316 327
            Geometry geom = getGeom(args, 0);
317
            IProjection proj = getProjection(args, 1);
318
            int units = getUnits(args, 2);
328
            switch( args.length ) {
329
                case 2:
330
                    units = getUnits(args, 1);
331
                    break;
332
                case 3:
333
                    proj = getProjection(args, 1);
334
                    units = getUnits(args, 2);
335
                    break;
336
            }
319 337
            if (proj == null) {
320 338
                proj = geom.getProjection();
321 339
            }

Also available in: Unified diff