[Geoserver-devel] kml reflector ignoring the bbox in the request

Hi,
I was playing with the kml reflector, ad in particular with a request
like this one:

http://localhost:8080/geoserver/wms/kml?layers=buildings&styles=polygon&bbox=-105.31,39.92,-105.30,39.93

To my surprise the bbox is getting ignored. Looking into the code I
see the network link transformer that
builds the kmz sets the bbox to null before encoding the wms request
that grabs the wms kml request
(and this sort of fine, since GE will fill the bbox in that one), but
then when encoding the lookat
the code looks like:

Envelope e = new Envelope();
            e.setToNull();

            for ( int i = 0; i < request.getLayers().size(); i++ ) {
                MapLayerInfo layer = request.getLayers().get(i);

                Envelope b = null;
                try {
                    b = request.getLayers().get(i).getLatLongBoundingBox();
                } catch (IOException e1) {
                    LOGGER.warning( "Unable to calculate bounds for "
+ layer.getName() );
                    continue;
                }
                if ( e.isNull() ) {
                    e.init( b );
                }
                else {
                    e.expandToInclude( b );
                }
            }

Err... uh? I can understand not using the bbox in case it was not
provided, but in case
it's provided in the request wouldn't it be better to use that one
instead of defaulting to
the whole layer?

The idea in the request above is that I actually want to look at a
specifific portion of
the layer.
Also think of the case where a cql filter is appended to the request,
imho we should
go and zoom in the area that has data, not go and show the whole layer area.

Opinions?

Cheers
Andrea

--
Ing. Andrea Aime
GeoSolutions S.A.S.
Tech lead

Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy

phone: +39 0584 962313
fax: +39 0584 962313
mob: +39 339 8844549

http://www.geo-solutions.it
http://geo-solutions.blogspot.com/
http://www.youtube.com/user/GeoSolutionsIT
http://www.linkedin.com/in/andreaaime
http://twitter.com/geowolf

Both changes sound reasonable to me. btw, what does the WMS reflector do? I think it would be nice to keep the two consistent where possible.


David Winslow
OpenGeo - http://opengeo.org/

On Tue, Jun 5, 2012 at 1:38 PM, Andrea Aime <andrea.aime@anonymised.com> wrote:

Hi,
I was playing with the kml reflector, ad in particular with a request
like this one:

http://localhost:8080/geoserver/wms/kml?layers=buildings&styles=polygon&bbox=-105.31,39.92,-105.30,39.93

To my surprise the bbox is getting ignored. Looking into the code I
see the network link transformer that
builds the kmz sets the bbox to null before encoding the wms request
that grabs the wms kml request
(and this sort of fine, since GE will fill the bbox in that one), but
then when encoding the lookat
the code looks like:

Envelope e = new Envelope();
e.setToNull();

for ( int i = 0; i < request.getLayers().size(); i++ ) {
MapLayerInfo layer = request.getLayers().get(i);

Envelope b = null;
try {
b = request.getLayers().get(i).getLatLongBoundingBox();
} catch (IOException e1) {
LOGGER.warning( "Unable to calculate bounds for "

  • layer.getName() );
    continue;
    }
    if ( e.isNull() ) {
    e.init( b );
    }
    else {
    e.expandToInclude( b );
    }
    }

Err… uh? I can understand not using the bbox in case it was not
provided, but in case
it’s provided in the request wouldn’t it be better to use that one
instead of defaulting to
the whole layer?

The idea in the request above is that I actually want to look at a
specifific portion of
the layer.
Also think of the case where a cql filter is appended to the request,
imho we should
go and zoom in the area that has data, not go and show the whole layer area.

Opinions?

Cheers
Andrea


Ing. Andrea Aime
GeoSolutions S.A.S.
Tech lead

Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy

phone: +39 0584 962313
fax: +39 0584 962313
mob: +39 339 8844549

http://www.geo-solutions.it
http://geo-solutions.blogspot.com/
http://www.youtube.com/user/GeoSolutionsIT
http://www.linkedin.com/in/andreaaime
http://twitter.com/geowolf


Live Security Virtual Conference
Exclusive live event will cover all the ways today’s security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/


Geoserver-devel mailing list
Geoserver-devel@anonymised.comsts.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

On Tue, Jun 5, 2012 at 8:05 PM, David Winslow <dwinslow@anonymised.com> wrote:

Both changes sound reasonable to me. btw, what does the WMS reflector do?
I think it would be nice to keep the two consistent where possible.

It does respect the bbox provided

Cheers
Andrea

--
Ing. Andrea Aime
GeoSolutions S.A.S.
Tech lead

Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy

phone: +39 0584 962313
fax: +39 0584 962313
mob: +39 339 8844549

http://www.geo-solutions.it
http://geo-solutions.blogspot.com/
http://www.youtube.com/user/GeoSolutionsIT
http://www.linkedin.com/in/andreaaime
http://twitter.com/geowolf

Sounds good to me, especially in light of KML being pretty unmaintained these days… am actually just looking at some internal support of clients reporting that the latest geoserver release just doesn’t work at all with google earth… have to look into it deeper.

On Tue, Jun 5, 2012 at 1:36 PM, Andrea Aime <andrea.aime@anonymised.com> wrote:

On Tue, Jun 5, 2012 at 8:05 PM, David Winslow <dwinslow@anonymised.com> wrote:

Both changes sound reasonable to me. btw, what does the WMS reflector do?
I think it would be nice to keep the two consistent where possible.

It does respect the bbox provided

Cheers
Andrea


Ing. Andrea Aime
GeoSolutions S.A.S.
Tech lead

Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy

phone: +39 0584 962313
fax: +39 0584 962313
mob: +39 339 8844549

http://www.geo-solutions.it
http://geo-solutions.blogspot.com/
http://www.youtube.com/user/GeoSolutionsIT
http://www.linkedin.com/in/andreaaime
http://twitter.com/geowolf


Live Security Virtual Conference
Exclusive live event will cover all the ways today’s security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/


Geoserver-devel mailing list
Geoserver-devel@anonymised.comsts.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel


Justin Deoliveira
OpenGeo - http://opengeo.org
Enterprise support for open source geospatial.