From: Andrea A. <aa...@op...> - 2009-07-03 13:19:03
|
Frank Gasdorf ha scritto: > Andrea, see inline comments: > >> Frank Gasdorf ha scritto: >>> Hi Andrea, Hello Justin, >>> >>> I startet writing a test class for the DefaultMapLayer getBounds >>> method. Would you agree if we shoud cover the following cases: - >>> featureSource.getSchema().getCoordinateReferenceSystem() returns >>> null -> returns an empty ReferencedEnvelope >> why empty? in this case I would try to return an envelope without >> any crs and have the client side handle the lack of CRS > > How to get an envelope if there isn't any CRS information available > and the featureSource.getBounds returns null. But in the above case you just said featureSource.getSchema().getCoordinateReferenceSystem() returns null -> returns an empty ReferencedEnvelope regardless of what featureSource.getBounds() returns. I agree that if you have featureSource.getBounds() == null and crs == null then you should return null. > And by the way: > Strange code found (trunk and branch 2.5.x) in > DefaultMapContext.getLayerBounds() : > > ... env = layer.getBounds(); sourceCrs = > env.getCoordinateReferenceSystem(); if (env == null) { > // why check here after env.getCoordinateReferenceSystem() ? > continue; } else { ... Right, most definitely a bug. Cheers Andrea -- Andrea Aime OpenGeo - http://opengeo.org Expert service straight from the developers. |