gvSIG bugs #2292

Bad implementation of FLyrVect.getFullEnvelope()

Added by Jose Manuel Vivó Arnal about 10 years ago. Updated 6 months ago.

Status:Outdated% Done:

0%

Priority:NormalSpent time:-
Assignee:-
Category:Document view
Target version:-
Severity: Add-on version:
gvSIG version:2.1.0 Add-on build:
gvSIG build:2218 Add-on resolve version:
Operative System: Add-on resolve build:
Keywords: Proyecto:
Has patch:No Hito:
Add-on name:Unknown

Description

In FLyrVect.getFullEnvelope() I found this:


        // Esto es para cuando se crea una capa nueva con el fullExtent de ancho
        // y alto 0.
        if (rAux == null || rAux.isEmpty() || rAux.getMaximum(0) - rAux.getMinimum(0) == 0
            && rAux.getMaximum(1) - rAux.getMinimum(1) == 0) {
            try {
                rAux =
                    geomManager.createEnvelope(0, 0, 90, 90, SUBTYPES.GEOM2D);
            } catch (CreateEnvelopeException e) {
                logger.error("Error creating the envelope", e);
                e.printStackTrace();
            }
        }

So, If a vectorial layer is empty, always a returns a envelope of (0 0,90 90) . Ignoring the fact that this coordinate can be inappropriate for current View (and there's no way to know it), I think that, in this case, an empty envelope should be returned. The method which requires the full envelope must be in charge of manage this state (a empty layer).

An example of this is FLayers.getFullEnvelope() which must check it.

Also, DefaultEnvelope.add(Envelope) must check if received envelope is empty.

I don't provide a patch due to this change could produce many side effects.

History

#1 Updated by Álvaro Anguix about 10 years ago

  • Assignee set to Joaquín del Cerro Murciano
  • Target version set to 2.1.0-2223-rc1

#2 Updated by Álvaro Anguix about 10 years ago

  • Target version changed from 2.1.0-2223-rc1 to 2.2.0-2311-rc2

#3 Updated by Álvaro Anguix about 10 years ago

  • Priority changed from High to Normal

#4 Updated by Álvaro Anguix about 10 years ago

  • Assignee deleted (Joaquín del Cerro Murciano)

#5 Updated by Álvaro Anguix over 9 years ago

  • Target version deleted (2.2.0-2311-rc2)

#6 Updated by Álvaro Anguix about 4 years ago

  • Category set to Document view

#7 Updated by Álvaro Anguix 6 months ago

  • Status changed from New to Outdated

Also available in: Atom PDF