Revision 44983
trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.expressionevaluator/org.gvsig.expressionevaluator.geometry/org.gvsig.expressionevaluator.geometry.lib/org.gvsig.expressionevaluator.geometry.lib.impl/src/main/java/org/gvsig/expressionevaluator/impl/DefaultGeometryExpressionBuilderHelper.java | ||
---|---|---|
476 | 476 |
|
477 | 477 |
@Override |
478 | 478 |
public Constant srs(IProjection projection) { |
479 |
if( projection == null ) { |
|
480 |
return this.builder.constant(null); |
|
481 |
} |
|
479 | 482 |
return new ProjectionConstant(this, projection); |
480 | 483 |
} |
481 | 484 |
|
482 | 485 |
@Override |
483 | 486 |
public Constant geometry(Geometry geom, IProjection projection) { |
487 |
if( geom == null ) { |
|
488 |
return this.builder.constant(null); |
|
489 |
} |
|
484 | 490 |
geom.setProjection(projection); |
485 | 491 |
return new GeometryConstant(this, geom); |
486 | 492 |
} |
487 | 493 |
|
488 | 494 |
@Override |
489 | 495 |
public Constant geometry(Geometry geom) { |
496 |
if( geom == null ) { |
|
497 |
return this.builder.constant(null); |
|
498 |
} |
|
490 | 499 |
if( geom.getProjection()==null ) { |
491 | 500 |
throw new IllegalArgumentException("The geometry does not have an associated projection. Use 'geometry(Geometry, IProjection)'."); |
492 | 501 |
} |
... | ... | |
495 | 504 |
|
496 | 505 |
@Override |
497 | 506 |
public Constant envelope(Envelope envelope, IProjection projection) { |
507 |
if( envelope == null ) { |
|
508 |
return this.builder.constant(null); |
|
509 |
} |
|
498 | 510 |
Geometry geom = envelope.getGeometry(); |
499 | 511 |
geom.setProjection(projection); |
500 | 512 |
return new GeometryConstant(this, geom); |
... | ... | |
502 | 514 |
|
503 | 515 |
@Override |
504 | 516 |
public Constant envelope(Envelope envelope) { |
517 |
if( envelope == null ) { |
|
518 |
return this.builder.constant(null); |
|
519 |
} |
|
505 | 520 |
if( envelope.getProjection()==null ) { |
506 | 521 |
throw new IllegalArgumentException("The envelope does not have an associated projection. Use 'envelope(Geometry, IProjection)'."); |
507 | 522 |
} |
Also available in: Unified diff