gvSIG bugs #271

layers added to the overview are always reproyected

Added by Francisco Puga over 12 years ago. Updated over 10 years ago.

Status:New% Done:

0%

Priority:Normal
Assignee:-
Category:-
Target version:-
Severity: Add-on name:Unknown
gvSIG version:1.12.0 Add-on version:
gvSIG build:1204 Add-on build:
Operative System: Add-on resolve version:
Keywords: Add-on resolve build:
Has patch:No

Description

Steps to reproduce:
1.- Create a View and add layer (not mater which kind)
2.- Set breakpoints on CrsGT.getCT(...)
3.- Add a layer to the overview (no mater which kind)
4.- Go step by step in the breakpoint

The instance of the CrsGT class of the db overview layer is different from the CrsGT instance of the MapContext overview, and the method is written like this:

if (dest == this) return null;

so it should be exactly the same object. I'm not sure if CrsGT is thinked as a singleton class, so that comparison have sense or if the comparison should be something like:

if (dest.getAbrev().equals(this.getAbrev())) return null

I'm trying to deep understand the process of create a View and add a layer, but follow the instance creation of different MapControl and MapContext objects is not easy, and we should take care that this is not masking another bug, if the CrsGT should the same object.

I'm getting a bit crazy with this, because sometimes, i think that only when you add a shape the CrsGT objects are the same.

History

#1 Updated by Francisco José Peñarrubia over 12 years ago

es: Al hilo de lo que apuntas, en DefaultFeatureIterator puedes encontrarte con esto:

/** * * Checks if must reproject the given geom * and reprojects it if true * @param geom
*/
protected void reprojectIfNecessary(IGeometry geom){
if (this.targetProjection != null &&
this.sourceProjection != null &&
this.targetProjection.getAbrev() != this.sourceProjection.getAbrev()){
ICoordTrans trans = sourceProjection.getCT(targetProjection);
geom.reProject(trans);
}
}

Por suerte, funciona normalmente ya que targetProjection suele ser nulo. Pero comprobar cadenas con != no sirve de nada, ya que se comprueban instancias. Debería usarse .equals().

#2 Updated by Francisco Puga about 12 years ago

  • Target version deleted (1.12.0-rc1)

#3 Updated by Álvaro Anguix over 10 years ago

  • Project changed from Application: gvSIG desktop to | gvSIG desktop 1

Also available in: Atom PDF