Using CRSEnvelope to set the BBox during GetMap request

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Using CRSEnvelope to set the BBox during GetMap request

todd runstein
I'm trying to write a very simple WMS viewer in Swing.
 At this point, I'm still trying to understand how to
query a wfs/wms server, so consider this a learning
experience.  I thought I had a pretty good grasp of it
- apparently not!

I'm making calls to my local GeoServer install.  I'm
retrieving a WMSCapabilities object, iterating through
the Layers, and getting a CRSEnvelope by calling
getLatLonBoundingBox (the actual code is included
below).  This results in:
Found: -73.907005:-74.02722,40.878178:40.684221 for
tiger:tiger_roads

Next, I make a GetMap request, thinking that I can use
the values returned as my BBox.  But this is not the
case - my BufferedImage is blank.  If I use the same
http call in a browser, I also get back nothing.  The
code does work if I use other coordinates, for example
something like:
-73.98954654425863:-74.01392192607089,40.71963703829024:40.70741925432014

So, why does GetCapabilities give me coordinates that
I can't use?  Am I asking for the wrong thing in my
code (though this matches what's in the Feature Type
Editor)?  Is the FeatureType not set up correctly
(though I don't think I changed it before now, and
using "Generate" returns these values again)?

Any ideas are welcome!

Here's the code:

//WmsFetcher
public WMSCapabilities getCapabilities(){
  WMSCapabilities retVal = null;
  HttpClient client = new HttpClient();
  HttpMethod method = new
GetMethod(wmsURL+CAPABILITIES_QUERY);
  InputStream in = null;
  try {
    int response = client.executeMethod(method);
    in = method.getResponseBodyAsStream();
    try {
      GetCapabilitiesResponse capRes = new
         GetCapabilitiesResponse(CONTENT_TYPE,in);
      retVal = capRes.getCapabilities();
    } catch (ServiceException e) {
      logger.error(e,new Throwable(e));
    } catch (SAXException e) {
      logger.error(e,new Throwable(e));
    }finally{
      in.close();
    }
  } catch (HttpException e) {
     logger.error(e,new Throwable(e));
  } catch (IOException e) {
     logger.error(e,new Throwable(e));
  }finally{
     method.releaseConnection();
  }
  return retVal;
}

public BufferedImage getMap(MapRequest request){
  BufferedImage retVal = null;
  HttpClient client = new HttpClient();
  HttpMethod method = new
GetMethod(wmsURL+request.queryString());
  InputStream in = null;
  try{
    int response = client.executeMethod(method);
    try {
      in = method.getResponseBodyAsStream();
      retVal = ImageIO.read(in);
    }finally{
      in.close();
    }
  } catch (HttpException e) {
    logger.error(e,new Throwable(e));
  } catch (IOException e) {
    logger.error(e,new Throwable(e));
  }finally{
    method.releaseConnection();
  }
  return retVal;
}

//Test Cases
public void testCapabilities(){
  boolean foundGoodLayer = false;
  WmsFetcher fetcher = new WmsFetcher(wmsURL);
  WMSCapabilities wmsCap = fetcher.getCapabilities();
  List layers = wmsCap.getLayerList();
  Iterator iter = layers.listIterator();
  while (iter.hasNext()){
    Layer layer = (Layer)iter.next();
    CRSEnvelope crs = layer.getLatLonBoundingBox();
    if (crs!=null){
      if (layer.getName()!=null){
        System.out.println("Found: " + crs.getMaxX() +

          ":"+crs.getMinX()+","+crs.getMaxY()+":"+
          crs.getMinY() + " for " + layer.getName());
        foundGoodLayer = true;
      }else{
        System.out.println("Found: " + crs.getMaxX()
+":"+
          crs.getMinX()+","+crs.getMaxY() +":"+
          crs.getMinY() + " for a null layer");
      }
    }else{
      System.out.println("Found layer where crs is
null");
    }
  }
  assertTrue(foundGoodLayer);
}
       
public void testMap(){
  WmsFetcher fetcher = new WmsFetcher(wmsURL);
  MapRequest map = new MapRequest(400,400);
  /*  This one works
    map.setBBox(-73.98954654425863,
    -74.01392192607089,
    40.71963703829024,
    40.70741925432014);
  */
  /* This one fails */
  map.setBBox(-73.907005,
    -74.02722,
    40.878178,
    40.684221);
       
  map.addLayer("tiger:tiger_roads");
  BufferedImage image = fetcher.getMap(map);
  assertNotNull(image);
  ImageIcon icon =
    new ImageIcon(
      image.getScaledInstance(
        image.getWidth(),
        image.getHeight(),
        BufferedImage.TYPE_4BYTE_ABGR));
  JLabel label = new JLabel(icon);
  JFrame frame = new JFrame();
 
frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
  JPanel panel = new JPanel();
  panel.add(label);
  frame.getContentPane().add(panel);
  frame.pack();
  frame.setVisible(true);
  try {
    Thread.sleep(20000);
  } catch (InterruptedException e) {
    //ignore
  }
}

The only "dumb question" is the one you were too afraid to ask.
________________________________________
Check out RouteRuler - Free software for runners, cyclists, walkers, etc.
http://routeruler.sourceforge.net
________________________________________
Get a handle on your data with "pocOLAP", the "little" OLAP project
http://pocolap.sourceforge.net
________________________________________

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com 


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
Geoserver-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geoserver-users
Reply | Threaded
Open this post in threaded view
|

Re: Using CRSEnvelope to set the BBox during GetMap request

Justin Deoliveira-3
Interesting point, something is definitley a miss. Are you using one of
your own layers, or one of the canned geoserver ones?

If you are using your own, what CRS is your data in? Can you perhaps
include your capabilities document?

-Justin

todd runstein wrote:

> I'm trying to write a very simple WMS viewer in Swing.
>  At this point, I'm still trying to understand how to
> query a wfs/wms server, so consider this a learning
> experience.  I thought I had a pretty good grasp of it
> - apparently not!
>
> I'm making calls to my local GeoServer install.  I'm
> retrieving a WMSCapabilities object, iterating through
> the Layers, and getting a CRSEnvelope by calling
> getLatLonBoundingBox (the actual code is included
> below).  This results in:
> Found: -73.907005:-74.02722,40.878178:40.684221 for
> tiger:tiger_roads
>
> Next, I make a GetMap request, thinking that I can use
> the values returned as my BBox.  But this is not the
> case - my BufferedImage is blank.  If I use the same
> http call in a browser, I also get back nothing.  The
> code does work if I use other coordinates, for example
> something like:
> -73.98954654425863:-74.01392192607089,40.71963703829024:40.70741925432014
>
> So, why does GetCapabilities give me coordinates that
> I can't use?  Am I asking for the wrong thing in my
> code (though this matches what's in the Feature Type
> Editor)?  Is the FeatureType not set up correctly
> (though I don't think I changed it before now, and
> using "Generate" returns these values again)?
>
> Any ideas are welcome!
>
> Here's the code:
>
> //WmsFetcher
> public WMSCapabilities getCapabilities(){
>   WMSCapabilities retVal = null;
>   HttpClient client = new HttpClient();
>   HttpMethod method = new
> GetMethod(wmsURL+CAPABILITIES_QUERY);
>   InputStream in = null;
>   try {
>     int response = client.executeMethod(method);
>     in = method.getResponseBodyAsStream();
>     try {
>       GetCapabilitiesResponse capRes = new
>          GetCapabilitiesResponse(CONTENT_TYPE,in);
>       retVal = capRes.getCapabilities();
>     } catch (ServiceException e) {
>       logger.error(e,new Throwable(e));
>     } catch (SAXException e) {
>       logger.error(e,new Throwable(e));
>     }finally{
>       in.close();
>     }
>   } catch (HttpException e) {
>      logger.error(e,new Throwable(e));
>   } catch (IOException e) {
>      logger.error(e,new Throwable(e));
>   }finally{
>      method.releaseConnection();
>   }
>   return retVal;
> }
>
> public BufferedImage getMap(MapRequest request){
>   BufferedImage retVal = null;
>   HttpClient client = new HttpClient();
>   HttpMethod method = new
> GetMethod(wmsURL+request.queryString());
>   InputStream in = null;
>   try{
>     int response = client.executeMethod(method);
>     try {
>       in = method.getResponseBodyAsStream();
>       retVal = ImageIO.read(in);
>     }finally{
>       in.close();
>     }
>   } catch (HttpException e) {
>     logger.error(e,new Throwable(e));
>   } catch (IOException e) {
>     logger.error(e,new Throwable(e));
>   }finally{
>     method.releaseConnection();
>   }
>   return retVal;
> }
>
> //Test Cases
> public void testCapabilities(){
>   boolean foundGoodLayer = false;
>   WmsFetcher fetcher = new WmsFetcher(wmsURL);
>   WMSCapabilities wmsCap = fetcher.getCapabilities();
>   List layers = wmsCap.getLayerList();
>   Iterator iter = layers.listIterator();
>   while (iter.hasNext()){
>     Layer layer = (Layer)iter.next();
>     CRSEnvelope crs = layer.getLatLonBoundingBox();
>     if (crs!=null){
>       if (layer.getName()!=null){
>         System.out.println("Found: " + crs.getMaxX() +
>
>           ":"+crs.getMinX()+","+crs.getMaxY()+":"+
>           crs.getMinY() + " for " + layer.getName());
>         foundGoodLayer = true;
>       }else{
>         System.out.println("Found: " + crs.getMaxX()
> +":"+
>           crs.getMinX()+","+crs.getMaxY() +":"+
>           crs.getMinY() + " for a null layer");
>       }
>     }else{
>       System.out.println("Found layer where crs is
> null");
>     }
>   }
>   assertTrue(foundGoodLayer);
> }
>
> public void testMap(){
>   WmsFetcher fetcher = new WmsFetcher(wmsURL);
>   MapRequest map = new MapRequest(400,400);
>   /*  This one works
>     map.setBBox(-73.98954654425863,
>     -74.01392192607089,
>     40.71963703829024,
>     40.70741925432014);
>   */
>   /* This one fails */
>   map.setBBox(-73.907005,
>     -74.02722,
>     40.878178,
>     40.684221);
>
>   map.addLayer("tiger:tiger_roads");
>   BufferedImage image = fetcher.getMap(map);
>   assertNotNull(image);
>   ImageIcon icon =
>     new ImageIcon(
>       image.getScaledInstance(
>         image.getWidth(),
>         image.getHeight(),
>         BufferedImage.TYPE_4BYTE_ABGR));
>   JLabel label = new JLabel(icon);
>   JFrame frame = new JFrame();
>  
> frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
>   JPanel panel = new JPanel();
>   panel.add(label);
>   frame.getContentPane().add(panel);
>   frame.pack();
>   frame.setVisible(true);
>   try {
>     Thread.sleep(20000);
>   } catch (InterruptedException e) {
>     //ignore
>   }
> }
>
> The only "dumb question" is the one you were too afraid to ask.
> ________________________________________
> Check out RouteRuler - Free software for runners, cyclists, walkers, etc.
> http://routeruler.sourceforge.net
> ________________________________________
> Get a handle on your data with "pocOLAP", the "little" OLAP project
> http://pocolap.sourceforge.net
> ________________________________________
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com 
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
> for problems?  Stop!  Download the new AJAX search engine that makes
> searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
> http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
> _______________________________________________
> Geoserver-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/geoserver-users
>


--
Justin Deoliveira
The Open Planning Project
http://topp.openplans.org


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
Geoserver-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geoserver-users
Reply | Threaded
Open this post in threaded view
|

Re: Using CRSEnvelope to set the BBox during GetMap request

sfarber
In reply to this post by todd runstein
It jumps out at me that you might be using the coordinates slightly
incorrectly.

The coordinates:

 -73.907005:-74.02722,40.878178:40.684221

are in a bit of a weird order.  I assume that -73.9,40.8 is the
max-x,max-y pair and that -74.02,40.68 is the min-x, min-y pair.

When you request a map, you need to specify the bbox as:

min-x,min-y,max-x,max-y

I don't see the code that generates the request below, but I only
glanced at it quickly...may have missed the right class.

Are you setting up the bounding box correctly when you make the request?

--saul

On Tue, 2006-01-10 at 16:14 -0800, todd runstein wrote:

> I'm trying to write a very simple WMS viewer in Swing.
>  At this point, I'm still trying to understand how to
> query a wfs/wms server, so consider this a learning
> experience.  I thought I had a pretty good grasp of it
> - apparently not!
>
> I'm making calls to my local GeoServer install.  I'm
> retrieving a WMSCapabilities object, iterating through
> the Layers, and getting a CRSEnvelope by calling
> getLatLonBoundingBox (the actual code is included
> below).  This results in:
> Found: -73.907005:-74.02722,40.878178:40.684221 for
> tiger:tiger_roads
>
> Next, I make a GetMap request, thinking that I can use
> the values returned as my BBox.  But this is not the
> case - my BufferedImage is blank.  If I use the same
> http call in a browser, I also get back nothing.  The
> code does work if I use other coordinates, for example
> something like:
> -73.98954654425863:-74.01392192607089,40.71963703829024:40.70741925432014
>
> So, why does GetCapabilities give me coordinates that
> I can't use?  Am I asking for the wrong thing in my
> code (though this matches what's in the Feature Type
> Editor)?  Is the FeatureType not set up correctly
> (though I don't think I changed it before now, and
> using "Generate" returns these values again)?
>
> Any ideas are welcome!
>
> Here's the code:
>
> //WmsFetcher
> public WMSCapabilities getCapabilities(){
>   WMSCapabilities retVal = null;
>   HttpClient client = new HttpClient();
>   HttpMethod method = new
> GetMethod(wmsURL+CAPABILITIES_QUERY);
>   InputStream in = null;
>   try {
>     int response = client.executeMethod(method);
>     in = method.getResponseBodyAsStream();
>     try {
>       GetCapabilitiesResponse capRes = new
>          GetCapabilitiesResponse(CONTENT_TYPE,in);
>       retVal = capRes.getCapabilities();
>     } catch (ServiceException e) {
>       logger.error(e,new Throwable(e));
>     } catch (SAXException e) {
>       logger.error(e,new Throwable(e));
>     }finally{
>       in.close();
>     }
>   } catch (HttpException e) {
>      logger.error(e,new Throwable(e));
>   } catch (IOException e) {
>      logger.error(e,new Throwable(e));
>   }finally{
>      method.releaseConnection();
>   }
>   return retVal;
> }
>
> public BufferedImage getMap(MapRequest request){
>   BufferedImage retVal = null;
>   HttpClient client = new HttpClient();
>   HttpMethod method = new
> GetMethod(wmsURL+request.queryString());
>   InputStream in = null;
>   try{
>     int response = client.executeMethod(method);
>     try {
>       in = method.getResponseBodyAsStream();
>       retVal = ImageIO.read(in);
>     }finally{
>       in.close();
>     }
>   } catch (HttpException e) {
>     logger.error(e,new Throwable(e));
>   } catch (IOException e) {
>     logger.error(e,new Throwable(e));
>   }finally{
>     method.releaseConnection();
>   }
>   return retVal;
> }
>
> //Test Cases
> public void testCapabilities(){
>   boolean foundGoodLayer = false;
>   WmsFetcher fetcher = new WmsFetcher(wmsURL);
>   WMSCapabilities wmsCap = fetcher.getCapabilities();
>   List layers = wmsCap.getLayerList();
>   Iterator iter = layers.listIterator();
>   while (iter.hasNext()){
>     Layer layer = (Layer)iter.next();
>     CRSEnvelope crs = layer.getLatLonBoundingBox();
>     if (crs!=null){
>       if (layer.getName()!=null){
>         System.out.println("Found: " + crs.getMaxX() +
>
>           ":"+crs.getMinX()+","+crs.getMaxY()+":"+
>           crs.getMinY() + " for " + layer.getName());
>         foundGoodLayer = true;
>       }else{
>         System.out.println("Found: " + crs.getMaxX()
> +":"+
>           crs.getMinX()+","+crs.getMaxY() +":"+
>           crs.getMinY() + " for a null layer");
>       }
>     }else{
>       System.out.println("Found layer where crs is
> null");
>     }
>   }
>   assertTrue(foundGoodLayer);
> }
>
> public void testMap(){
>   WmsFetcher fetcher = new WmsFetcher(wmsURL);
>   MapRequest map = new MapRequest(400,400);
>   /*  This one works
>     map.setBBox(-73.98954654425863,
>     -74.01392192607089,
>     40.71963703829024,
>     40.70741925432014);
>   */
>   /* This one fails */
>   map.setBBox(-73.907005,
>     -74.02722,
>     40.878178,
>     40.684221);
>
>   map.addLayer("tiger:tiger_roads");
>   BufferedImage image = fetcher.getMap(map);
>   assertNotNull(image);
>   ImageIcon icon =
>     new ImageIcon(
>       image.getScaledInstance(
>         image.getWidth(),
>         image.getHeight(),
>         BufferedImage.TYPE_4BYTE_ABGR));
>   JLabel label = new JLabel(icon);
>   JFrame frame = new JFrame();
>  
> frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
>   JPanel panel = new JPanel();
>   panel.add(label);
>   frame.getContentPane().add(panel);
>   frame.pack();
>   frame.setVisible(true);
>   try {
>     Thread.sleep(20000);
>   } catch (InterruptedException e) {
>     //ignore
>   }
> }
>
> The only "dumb question" is the one you were too afraid to ask.
> ________________________________________
> Check out RouteRuler - Free software for runners, cyclists, walkers, etc.
> http://routeruler.sourceforge.net
> ________________________________________
> Get a handle on your data with "pocOLAP", the "little" OLAP project
> http://pocolap.sourceforge.net
> ________________________________________
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com 
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
> for problems?  Stop!  Download the new AJAX search engine that makes
> searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
> http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
> _______________________________________________
> Geoserver-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/geoserver-users



-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
Geoserver-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geoserver-users
Reply | Threaded
Open this post in threaded view
|

Re: Using CRSEnvelope to set the BBox during GetMap request

todd runstein
In reply to this post by Justin Deoliveira-3
Justin,

It appears I just picked a bad example.  It seems to
be something specific with the topp:tiger_roads data
(this comes with GeoServer).

I'm using tiger_roads from the tiger namespace that
comes with GeoServer.  Using a browser, I can do this
(ignore that it's skewed):
http://localhost:8999/geoserver/wms?FORMAT=image/png&LAYERS=tiger:tiger_roads&TRANSPARENT=TRUE&HEIGHT=400&REQUEST=GetMap&WIDTH=400&STYLES=&SRS=EPSG:4326&VERSION=1.1.1&BBOX=-74.01392192607089,40.70741925432014,-73.98954654425863,40.71963703829024

But I can't do this:
http://localhost:8999/geoserver/wms?FORMAT=image/png&LAYERS=tiger:tiger_roads&TRANSPARENT=TRUE&HEIGHT=400&REQUEST=GetMap&WIDTH=400&STYLES=&SRS=EPSG:4326&VERSION=1.1.1&BBOX=-74.02722,40.684221,-73.907005,40.878178

Note that the second one is using the values from
getCapabilities.  Also, I do technically get an image
back (if I right click, I get the option to "Save
Image As..."), but it's completely blank (or perhaps
completely transparent is more accurate).

The "topp:states" data works (again skewed) if I use:
http://localhost:8999/geoserver/wms?REQUEST=GetMap&SERVICE=WMS&SRS=EPSG:4326&WIDTH=400&HEIGHT=400&LAYERS=topp:states&STYLES=&FORMAT=image/png&TRANSPARENT=TRUE&TIME=&BBOX=-124.731422,-66.969849,24.955967,49.371735

The "topp:tasmania_roads" also works:
http://localhost:8999/geoserver/wms?REQUEST=GetMap&SERVICE=WMS&SRS=EPSG:4326&WIDTH=400&HEIGHT=400&LAYERS=topp:tasmania_roads&STYLES=&FORMAT=image/png&TRANSPARENT=TRUE&TIME=&BBOX=145.19754,-43.423512,148.27298000000002,-40.852802

It even works with my own data so I'm not going to
stress about it.  I'm sure I could fix it by just
updating the values in the Feature Type Editor (if I
could figure out what the actual values are - using
"Generate" just returns the same thing).

Instead, now I need to figure out how to get the
proportion of a BBox (in other words, given a
minx,miny,maxx,maxy, what WIDTH and HEIGHT should I
use so that I don't get a skewed image).  Feel free to
point me in the right direction!

Todd

--- Justin Deoliveira <[hidden email]>
wrote:

> Interesting point, something is definitley a miss.
> Are you using one of
> your own layers, or one of the canned geoserver
> ones?
>
> If you are using your own, what CRS is your data in?
> Can you perhaps
> include your capabilities document?
>
> -Justin
>
> todd runstein wrote:
> > I'm trying to write a very simple WMS viewer in
> Swing.
> >  At this point, I'm still trying to understand how
> to
> > query a wfs/wms server, so consider this a
> learning
> > experience.  I thought I had a pretty good grasp
> of it
> > - apparently not!
> >
> > I'm making calls to my local GeoServer install.
> I'm
> > retrieving a WMSCapabilities object, iterating
> through
> > the Layers, and getting a CRSEnvelope by calling
> > getLatLonBoundingBox (the actual code is included
> > below).  This results in:
> > Found: -73.907005:-74.02722,40.878178:40.684221
> for
> > tiger:tiger_roads
> >
> > Next, I make a GetMap request, thinking that I can
> use
> > the values returned as my BBox.  But this is not
> the
> > case - my BufferedImage is blank.  If I use the
> same
> > http call in a browser, I also get back nothing.
> The
> > code does work if I use other coordinates, for
> example
> > something like:
> >
>
-73.98954654425863:-74.01392192607089,40.71963703829024:40.70741925432014

> >
> > So, why does GetCapabilities give me coordinates
> that
> > I can't use?  Am I asking for the wrong thing in
> my
> > code (though this matches what's in the Feature
> Type
> > Editor)?  Is the FeatureType not set up correctly
> > (though I don't think I changed it before now, and
> > using "Generate" returns these values again)?
> >
> > Any ideas are welcome!
> >
> > Here's the code:
> >
> > //WmsFetcher
> > public WMSCapabilities getCapabilities(){
> >   WMSCapabilities retVal = null;
> >   HttpClient client = new HttpClient();
> >   HttpMethod method = new
> > GetMethod(wmsURL+CAPABILITIES_QUERY);
> >   InputStream in = null;
> >   try {
> >     int response = client.executeMethod(method);
> >     in = method.getResponseBodyAsStream();
> >     try {
> >       GetCapabilitiesResponse capRes = new
> >          GetCapabilitiesResponse(CONTENT_TYPE,in);
> >       retVal = capRes.getCapabilities();
> >     } catch (ServiceException e) {
> >       logger.error(e,new Throwable(e));
> >     } catch (SAXException e) {
> >       logger.error(e,new Throwable(e));
> >     }finally{
> >       in.close();
> >     }
> >   } catch (HttpException e) {
> >      logger.error(e,new Throwable(e));
> >   } catch (IOException e) {
> >      logger.error(e,new Throwable(e));
> >   }finally{
> >      method.releaseConnection();
> >   }
> >   return retVal;
> > }
> >
> > public BufferedImage getMap(MapRequest request){
> >   BufferedImage retVal = null;
> >   HttpClient client = new HttpClient();
> >   HttpMethod method = new
> > GetMethod(wmsURL+request.queryString());
> >   InputStream in = null;
> >   try{
> >     int response = client.executeMethod(method);
> >     try {
> >       in = method.getResponseBodyAsStream();
> >       retVal = ImageIO.read(in);
> >     }finally{
> >       in.close();
> >     }
> >   } catch (HttpException e) {
> >     logger.error(e,new Throwable(e));
> >   } catch (IOException e) {
> >     logger.error(e,new Throwable(e));
> >   }finally{
> >     method.releaseConnection();
> >   }
> >   return retVal;
> > }
> >
> > //Test Cases
> > public void testCapabilities(){
> >   boolean foundGoodLayer = false;
> >   WmsFetcher fetcher = new WmsFetcher(wmsURL);
> >   WMSCapabilities wmsCap =
> fetcher.getCapabilities();
> >   List layers = wmsCap.getLayerList();
> >   Iterator iter = layers.listIterator();
> >   while (iter.hasNext()){
> >     Layer layer = (Layer)iter.next();
> >     CRSEnvelope crs =
> layer.getLatLonBoundingBox();
> >     if (crs!=null){
> >       if (layer.getName()!=null){
> >         System.out.println("Found: " +
> crs.getMaxX() +
> >
> >           ":"+crs.getMinX()+","+crs.getMaxY()+":"+
> >           crs.getMinY() + " for " +
> layer.getName());
> >         foundGoodLayer = true;
> >       }else{
> >         System.out.println("Found: " +
> crs.getMaxX()
> > +":"+
> >           crs.getMinX()+","+crs.getMaxY() +":"+
> >           crs.getMinY() + " for a null layer");
> >       }
> >     }else{
> >       System.out.println("Found layer where crs is
> > null");
> >     }
> >   }
> >   assertTrue(foundGoodLayer);
> > }
> >
> > public void testMap(){
> >   WmsFetcher fetcher = new WmsFetcher(wmsURL);
> >   MapRequest map = new MapRequest(400,400);
> >   /*  This one works
> >     map.setBBox(-73.98954654425863,
> >     -74.01392192607089,
> >     40.71963703829024,
> >     40.70741925432014);
> >   */
> >   /* This one fails */
> >   map.setBBox(-73.907005,
> >     -74.02722,
> >     40.878178,
> >     40.684221);
> >
> >   map.addLayer("tiger:tiger_roads");
> >   BufferedImage image = fetcher.getMap(map);
> >   assertNotNull(image);
> >   ImageIcon icon =
> >     new ImageIcon(
> >       image.getScaledInstance(
> >         image.getWidth(),
> >         image.getHeight(),
> >         BufferedImage.TYPE_4BYTE_ABGR));
> >   JLabel label = new JLabel(icon);
> >   JFrame frame = new JFrame();
> >  
> >
>
frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);

> >   JPanel panel = new JPanel();
> >   panel.add(label);
> >   frame.getContentPane().add(panel);
> >   frame.pack();
> >   frame.setVisible(true);
> >   try {
> >     Thread.sleep(20000);
> >   } catch (InterruptedException e) {
> >     //ignore
> >   }
> > }
> >
> > The only "dumb question" is the one you were too
> afraid to ask.
> > ________________________________________
> > Check out RouteRuler - Free software for runners,
> cyclists, walkers, etc.
> > http://routeruler.sourceforge.net
> > ________________________________________
> > Get a handle on your data with "pocOLAP", the
> "little"
=== message truncated ===

The only "dumb question" is the one you were too afraid to ask.
________________________________________
Check out RouteRuler - Free software for runners, cyclists, walkers, etc.
http://routeruler.sourceforge.net
________________________________________
Get a handle on your data with "pocOLAP", the "little" OLAP project
http://pocolap.sourceforge.net
________________________________________

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com 


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
Geoserver-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geoserver-users
Reply | Threaded
Open this post in threaded view
|

Re: Using CRSEnvelope to set the BBox during GetMap request

Brent Owens
Hi Todd
I just tried the tiger roads sample that comes with geoserver, and it
doesn't display anything either. I'm not sure what it is, but something
might be in the wrong projection: ie the data is specified as 4326 but
is really something else.

For your question about a 'skewed image', I will try to answer. When you
say skewed image, are you saying that you don't want a really long but
thin set of data being rendered into a square image, in a sense
squishing it? And, are you allowed to return arbitrary image dimentions?
It should be pretty easy to do this:
Get the dX and dY from the bounding box (x2-x1, y2-y1). Then get the
ratio (r) of the two: r = dX/dY
That is the ratio of X to Y.

Then set a constant for your image size, say 400x400 pixels. This will
be the max dimentions of your image. Then you just multiply the X or the
Y image size by the ratio. If the ratio is r>1, then set the ratio to
1/r, and multiply that value with the image Y value (height=400). If the
ratio is r<1, then just multiply the ratio with the image X value
(width=400).

Here's an example:
x2=30, x1=15
y2=11, y1=8
dX=15, dY=3
r = dX/dY = 15/3 = 3
r>1 :. newR = 1/3 = 0.333
width=400, height=400*newR=133

So you end up with a width of 400 and a height of 133.
Note that if you keep your bounding box and image ratio the same, then
the image shouldn't be skewed.

Good luck,

Brent Owens
(The Open Planning Project)



todd runstein wrote:

>Justin,
>
>It appears I just picked a bad example.  It seems to
>be something specific with the topp:tiger_roads data
>(this comes with GeoServer).
>
>I'm using tiger_roads from the tiger namespace that
>comes with GeoServer.  Using a browser, I can do this
>(ignore that it's skewed):
>http://localhost:8999/geoserver/wms?FORMAT=image/png&LAYERS=tiger:tiger_roads&TRANSPARENT=TRUE&HEIGHT=400&REQUEST=GetMap&WIDTH=400&STYLES=&SRS=EPSG:4326&VERSION=1.1.1&BBOX=-74.01392192607089,40.70741925432014,-73.98954654425863,40.71963703829024
>
>But I can't do this:
>http://localhost:8999/geoserver/wms?FORMAT=image/png&LAYERS=tiger:tiger_roads&TRANSPARENT=TRUE&HEIGHT=400&REQUEST=GetMap&WIDTH=400&STYLES=&SRS=EPSG:4326&VERSION=1.1.1&BBOX=-74.02722,40.684221,-73.907005,40.878178
>
>Note that th
>

>e second one is using the values from
>getCapabilities.  Also, I do technically get an image
>back (if I right click, I get the option to "Save
>Image As..."), but it's completely blank (or perhaps
>completely transparent is more accurate).
>
>The "topp:states" data works (again skewed) if I use:
>http://localhost:8999/geoserver/wms?REQUEST=GetMap&SERVICE=WMS&SRS=EPSG:4326&WIDTH=400&HEIGHT=400&LAYERS=topp:states&STYLES=&FORMAT=image/png&TRANSPARENT=TRUE&TIME=&BBOX=-124.731422,-66.969849,24.955967,49.371735
>
>The "topp:tasmania_roads" also works:
>http://localhost:8999/geoserver/wms?REQUEST=GetMap&SERVICE=WMS&SRS=EPSG:4326&WIDTH=400&HEIGHT=400&LAYERS=topp:tasmania_roads&STYLES=&FORMAT=image/png&TRANSPARENT=TRUE&TIME=&BBOX=145.19754,-43.423512,148.27298000000002,-40.852802
>
>It even works with my own data so I'm not going to
>stress about it.  I'm sure I could fix it by just
>updating the values in the Feature Type Editor (if I
>could figure out what the actual values are - using
>"Generate" just returns the same thing).
>
>Instead, now I need to figure out how to get the
>proportion of a BBox (in other words, given a
>minx,miny,maxx,maxy, what WIDTH and HEIGHT should I
>use so that I don't get a skewed image).  Feel free to
>point me in the right direction!
>
>Todd
>
>--- Justin Deoliveira <[hidden email]>
>wrote:
>
>  
>
>>Interesting point, something is definitley a miss.
>>Are you using one of
>>your own layers, or one of the canned geoserver
>>ones?
>>
>>If you are using your own, what CRS is your data in?
>>Can you perhaps
>>include your capabilities document?
>>
>>-Justin
>>
>>todd runstein wrote:
>>    
>>
>>>I'm trying to write a very simple WMS viewer in
>>>      
>>>
>>Swing.
>>    
>>
>>> At this point, I'm still trying to understand how
>>>      
>>>
>>to
>>    
>>
>>>query a wfs/wms server, so consider this a
>>>      
>>>
>>learning
>>    
>>
>>>experience.  I thought I had a pretty good grasp
>>>      
>>>
>>of it
>>    
>>
>>>- apparently not!
>>>
>>>I'm making calls to my local GeoServer install.
>>>      
>>>
>>I'm
>>    
>>
>>>retrieving a WMSCapabilities object, iterating
>>>      
>>>
>>through
>>    
>>
>>>the Layers, and getting a CRSEnvelope by calling
>>>getLatLonBoundingBox (the actual code is included
>>>below).  This results in:
>>>Found: -73.907005:-74.02722,40.878178:40.684221
>>>      
>>>
>>for
>>    
>>
>>>tiger:tiger_roads
>>>
>>>Next, I make a GetMap request, thinking that I can
>>>      
>>>
>>use
>>    
>>
>>>the values returned as my BBox.  But this is not
>>>      
>>>
>>the
>>    
>>
>>>case - my BufferedImage is blank.  If I use the
>>>      
>>>
>>same
>>    
>>
>>>http call in a browser, I also get back nothing.
>>>      
>>>
>>The
>>    
>>
>>>code does work if I use other coordinates, for
>>>      
>>>
>>example
>>    
>>
>>>something like:
>>>
>>>      
>>>
>-73.98954654425863:-74.01392192607089,40.71963703829024:40.70741925432014
>  
>
>>>So, why does GetCapabilities give me coordinates
>>>      
>>>
>>that
>>    
>>
>>>I can't use?  Am I asking for the wrong thing in
>>>      
>>>
>>my
>>    
>>
>>>code (though this matches what's in the Feature
>>>      
>>>
>>Type
>>    
>>
>>>Editor)?  Is the FeatureType not set up correctly
>>>(though I don't think I changed it before now, and
>>>using "Generate" returns these values again)?
>>>
>>>Any ideas are welcome!
>>>
>>>Here's the code:
>>>
>>>//WmsFetcher
>>>public WMSCapabilities getCapabilities(){
>>>  WMSCapabilities retVal = null;
>>>  HttpClient client = new HttpClient();
>>>  HttpMethod method = new
>>>GetMethod(wmsURL+CAPABILITIES_QUERY);
>>>  InputStream in = null;
>>>  try {
>>>    int response = client.executeMethod(method);
>>>    in = method.getResponseBodyAsStream();
>>>    try {
>>>      GetCapabilitiesResponse capRes = new
>>>         GetCapabilitiesResponse(CONTENT_TYPE,in);
>>>      retVal = capRes.getCapabilities();
>>>    } catch (ServiceException e) {
>>>      logger.error(e,new Throwable(e));
>>>    } catch (SAXException e) {
>>>      logger.error(e,new Throwable(e));
>>>    }finally{
>>>      in.close();
>>>    }
>>>  } catch (HttpException e) {
>>>     logger.error(e,new Throwable(e));
>>>  } catch (IOException e) {
>>>     logger.error(e,new Throwable(e));
>>>  }finally{
>>>     method.releaseConnection();
>>>  }
>>>  return retVal;
>>>}
>>>
>>>public BufferedImage getMap(MapRequest request){
>>>  BufferedImage retVal = null;
>>>  HttpClient client = new HttpClient();
>>>  HttpMethod method = new
>>>GetMethod(wmsURL+request.queryString());
>>>  InputStream in = null;
>>>  try{
>>>    int response = client.executeMethod(method);
>>>    try {
>>>      in = method.getResponseBodyAsStream();
>>>      retVal = ImageIO.read(in);
>>>    }finally{
>>>      in.close();
>>>    }
>>>  } catch (HttpException e) {
>>>    logger.error(e,new Throwable(e));
>>>  } catch (IOException e) {
>>>    logger.error(e,new Throwable(e));
>>>  }finally{
>>>    method.releaseConnection();
>>>  }
>>>  return retVal;
>>>}
>>>
>>>//Test Cases
>>>public void testCapabilities(){
>>>  boolean foundGoodLayer = false;
>>>  WmsFetcher fetcher = new WmsFetcher(wmsURL);
>>>  WMSCapabilities wmsCap =
>>>      
>>>
>>fetcher.getCapabilities();
>>    
>>
>>>  List layers = wmsCap.getLayerList();
>>>  Iterator iter = layers.listIterator();
>>>  while (iter.hasNext()){
>>>    Layer layer = (Layer)iter.next();
>>>    CRSEnvelope crs =
>>>      
>>>
>>layer.getLatLonBoundingBox();
>>    
>>
>>>    if (crs!=null){
>>>      if (layer.getName()!=null){
>>>        System.out.println("Found: " +
>>>      
>>>
>>crs.getMaxX() +
>>    
>>
>>>          ":"+crs.getMinX()+","+crs.getMaxY()+":"+
>>>          crs.getMinY() + " for " +
>>>      
>>>
>>layer.getName());
>>    
>>
>>>        foundGoodLayer = true;
>>>      }else{
>>>        System.out.println("Found: " +
>>>      
>>>
>>crs.getMaxX()
>>    
>>
>>>+":"+
>>>          crs.getMinX()+","+crs.getMaxY() +":"+
>>>          crs.getMinY() + " for a null layer");
>>>      }
>>>    }else{
>>>      System.out.println("Found layer where crs is
>>>null");
>>>    }
>>>  }
>>>  assertTrue(foundGoodLayer);
>>>}
>>>
>>>public void testMap(){
>>>  WmsFetcher fetcher = new WmsFetcher(wmsURL);
>>>  MapRequest map = new MapRequest(400,400);
>>>  /*  This one works
>>>    map.setBBox(-73.98954654425863,
>>>    -74.01392192607089,
>>>    40.71963703829024,
>>>    40.70741925432014);
>>>  */
>>>  /* This one fails */
>>>  map.setBBox(-73.907005,
>>>    -74.02722,
>>>    40.878178,
>>>    40.684221);
>>>
>>>  map.addLayer("tiger:tiger_roads");
>>>  BufferedImage image = fetcher.getMap(map);
>>>  assertNotNull(image);
>>>  ImageIcon icon =
>>>    new ImageIcon(
>>>      image.getScaledInstance(
>>>        image.getWidth(),
>>>        image.getHeight(),
>>>        BufferedImage.TYPE_4BYTE_ABGR));
>>>  JLabel label = new JLabel(icon);
>>>  JFrame frame = new JFrame();
>>>
>>>
>>>      
>>>
>frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
>  
>
>>>  JPanel panel = new JPanel();
>>>  panel.add(label);
>>>  frame.getContentPane().add(panel);
>>>  frame.pack();
>>>  frame.setVisible(true);
>>>  try {
>>>    Thread.sleep(20000);
>>>  } catch (InterruptedException e) {
>>>    //ignore
>>>  }
>>>}
>>>
>>>The only "dumb question" is the one you were too
>>>      
>>>
>>afraid to ask.
>>    
>>
>>>________________________________________
>>>Check out RouteRuler - Free software for runners,
>>>      
>>>
>>cyclists, walkers, etc.
>>    
>>
>>>http://routeruler.sourceforge.net
>>>________________________________________
>>>Get a handle on your data with "pocOLAP", the
>>>      
>>>
>>"little"
>>    
>>
>=== message truncated ===
>
>The only "dumb question" is the one you were too afraid to ask.
>________________________________________
>Check out RouteRuler - Free software for runners, cyclists, walkers, etc.
>http://routeruler.sourceforge.net
>________________________________________
>Get a handle on your data with "pocOLAP", the "little" OLAP project
>http://pocolap.sourceforge.net
>________________________________________
>
>__________________________________________________
>Do You Yahoo!?
>Tired of spam?  Yahoo! Mail has the best spam protection around
>http://mail.yahoo.com 
>
>
>-------------------------------------------------------
>This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
>for problems?  Stop!  Download the new AJAX search engine that makes
>searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
>http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
>_______________________________________________
>Geoserver-users mailing list
>[hidden email]
>https://lists.sourceforge.net/lists/listinfo/geoserver-users
>
>  
>


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
Geoserver-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geoserver-users
Reply | Threaded
Open this post in threaded view
|

Re: Using CRSEnvelope to set the BBox during GetMap request

Brent Owens
In reply to this post by todd runstein
I will report it as a bug. It is hopefully just as easy as specifying
the correct projection.

cheers,

Brent Owens
(The Open Planning Project)



todd runstein wrote:

>Brent,
>
>Should this be logged as a bug?  It's not a problem
>with GeoServer, but rather with some of the sample
>code.  
>
>Thanks,
>
>Todd
>
>--- Brent Owens <[hidden email]> wrote:
>
>  
>
>>Hi Todd
>>I just tried the tiger roads sample that comes with
>>geoserver, and it
>>doesn't display anything either. I'm not sure what
>>it is, but something
>>might be in the wrong projection: ie the data is
>>specified as 4326 but
>>is really something else.
>>
>>For your question about a 'skewed image', I will try
>>to answer. When you
>>say skewed image, are you saying that you don't want
>>a really long but
>>thin set of data being rendered into a square image,
>>in a sense
>>squishing it? And, are you allowed to return
>>arbitrary image dimentions?
>>It should be pretty easy to do this:
>>Get the dX and dY from the bounding box (x2-x1,
>>y2-y1). Then get the
>>ratio (r) of the two: r = dX/dY
>>That is the ratio of X to Y.
>>
>>Then set a constant for your image size, say 400x400
>>pixels. This will
>>be the max dimentions of your image. Then you just
>>multiply the X or the
>>Y image size by the ratio. If the ratio is r>1, then
>>set the ratio to
>>1/r, and multiply that value with the image Y value
>>(height=400). If the
>>ratio is r<1, then just multiply the ratio with the
>>image X value
>>(width=400).
>>
>>Here's an example:
>>x2=30, x1=15
>>y2=11, y1=8
>>dX=15, dY=3
>>r = dX/dY = 15/3 = 3
>>r>1 :. newR = 1/3 = 0.333
>>width=400, height=400*newR=133
>>
>>So you end up with a width of 400 and a height of
>>133.
>>Note that if you keep your bounding box and image
>>ratio the same, then
>>the image shouldn't be skewed.
>>
>>Good luck,
>>
>>Brent Owens
>>(The Open Planning Project)
>>
>>
>>
>>todd runstein wrote:
>>
>>    
>>
>>>Justin,
>>>
>>>It appears I just picked a bad example.  It seems
>>>      
>>>
>>to
>>    
>>
>>>be something specific with the topp:tiger_roads
>>>      
>>>
>>data
>>    
>>
>>>(this comes with GeoServer).
>>>
>>>I'm using tiger_roads from the tiger namespace that
>>>comes with GeoServer.  Using a browser, I can do
>>>      
>>>
>>this
>>    
>>
>>>(ignore that it's skewed):
>>>      
>>>
>>http://localhost:8999/geoserver/wms?FORMAT=image/png&LAYERS=tiger:tiger_roads&TRANSPARENT=TRUE&HEIGHT=400&REQUEST=GetMap&WIDTH=400&STYLES=&SRS=EPSG:4326&VERSION=1.1.1&BBOX=-74.01392192607089,40.70741925432014,-73.98954654425863,40.71963703829024
>>    
>>
>>>But I can't do this:
>>>      
>>>
>>http://localhost:8999/geoserver/wms?FORMAT=image/png&LAYERS=tiger:tiger_roads&TRANSPARENT=TRUE&HEIGHT=400&REQUEST=GetMap&WIDTH=400&STYLES=&SRS=EPSG:4326&VERSION=1.1.1&BBOX=-74.02722,40.684221,-73.907005,40.878178
>>    
>>
>>>Note that th
>>>
>>>      
>>>
>>>e second one is using the values from
>>>getCapabilities.  Also, I do technically get an
>>>      
>>>
>>image
>>    
>>
>>>back (if I right click, I get the option to "Save
>>>Image As..."), but it's completely blank (or
>>>      
>>>
>>perhaps
>>    
>>
>>>completely transparent is more accurate).
>>>
>>>The "topp:states" data works (again skewed) if I
>>>      
>>>
>>use:
>>
>>http://localhost:8999/geoserver/wms?REQUEST=GetMap&SERVICE=WMS&SRS=EPSG:4326&WIDTH=400&HEIGHT=400&LAYERS=topp:states&STYLES=&FORMAT=image/png&TRANSPARENT=TRUE&TIME=&BBOX=-124.731422,-66.969849,24.955967,49.371735
>>    
>>
>>>The "topp:tasmania_roads" also works:
>>>      
>>>
>>http://localhost:8999/geoserver/wms?REQUEST=GetMap&SERVICE=WMS&SRS=EPSG:4326&WIDTH=400&HEIGHT=400&LAYERS=topp:tasmania_roads&STYLES=&FORMAT=image/png&TRANSPARENT=TRUE&TIME=&BBOX=145.19754,-43.423512,148.27298000000002,-40.852802
>>    
>>
>>>It even works with my own data so I'm not going to
>>>stress about it.  I'm sure I could fix it by just
>>>updating the values in the Feature Type Editor (if
>>>      
>>>
>>I
>>    
>>
>>>could figure out what the actual values are - using
>>>"Generate" just returns the same thing).
>>>
>>>Instead, now I need to figure out how to get the
>>>proportion of a BBox (in other words, given a
>>>minx,miny,maxx,maxy, what WIDTH and HEIGHT should I
>>>use so that I don't get a skewed image).  Feel free
>>>      
>>>
>>to
>>    
>>
>>>point me in the right direction!
>>>
>>>Todd
>>>
>>>--- Justin Deoliveira <[hidden email]>
>>>wrote:
>>>
>>>
>>>
>>>      
>>>
>>>>Interesting point, something is definitley a miss.
>>>>Are you using one of
>>>>your own layers, or one of the canned geoserver
>>>>ones?
>>>>
>>>>If you are using your own, what CRS is your data
>>>>        
>>>>
>>in?
>>    
>>
>>>>Can you perhaps
>>>>include your capabilities document?
>>>>
>>>>-Justin
>>>>
>>>>todd runstein wrote:
>>>>  
>>>>
>>>>        
>>>>
>>>>>I'm trying to write a very simple WMS viewer in
>>>>>    
>>>>>
>>>>>          
>>>>>
>>>>Swing.
>>>>  
>>>>
>>>>        
>>>>
>>>>>At this point, I'm still trying to understand
>>>>>          
>>>>>
>>how
>>    
>>
>>>>>    
>>>>>
>>>>>          
>>>>>
>>>>to
>>>>  
>>>>
>>>>        
>>>>
>>>>>query a wfs/wms server, so consider this a
>>>>>    
>>>>>
>>>>>          
>>>>>
>>>>learning
>>>>  
>>>>
>>>>        
>>>>
>>>>>experience.  I thought I had a pretty good grasp
>>>>>    
>>>>>
>>>>>          
>>>>>
>>>>of it
>>>>  
>>>>
>>>>        
>>>>
>>>>>- apparently not!
>>>>>
>>>>>I'm making calls to my local GeoServer install.
>>>>>    
>>>>>
>>>>>          
>>>>>
>>>>I'm
>>>>  
>>>>
>>>>        
>>>>
>>>>>retrieving a WMSCapabilities object, iterating
>>>>>    
>>>>>
>>>>>          
>>>>>
>>>>through
>>>>  
>>>>
>>>>        
>>>>
>>>>>the Layers, and getting a CRSEnvelope by calling
>>>>>getLatLonBoundingBox (the actual code is included
>>>>>below).  This results in:
>>>>>Found: -73.907005:-74.02722,40.878178:40.684221
>>>>>    
>>>>>
>>>>>          
>>>>>
>>>>for
>>>>  
>>>>
>>>>        
>>>>
>>>>>tiger:tiger_roads
>>>>>
>>>>>Next, I make a GetMap request, thinking that I
>>>>>          
>>>>>
>>can
>>    
>>
>>>>>    
>>>>>
>>>>>          
>>>>>
>>>>use
>>>>  
>>>>
>>>>        
>>>>
>>>>>the values returned as my BBox.  But this is not
>>>>>    
>>>>>
>>>>>          
>>>>>
>>>>the
>>>>  
>>>>
>>>>        
>>>>
>>>>>case - my BufferedImage is blank.  If I use the
>>>>>    
>>>>>
>>>>>          
>>>>>
>>>>same
>>>>  
>>>>
>>>>        
>>>>
>>>>>http call in a browser, I also get back nothing.
>>>>>    
>>>>>
>>>>>          
>>>>>
>=== message truncated ===
>
>The only "dumb question" is the one you were too afraid to ask.
>________________________________________
>Check out RouteRuler - Free software for runners, cyclists, walkers, etc.
>http://routeruler.sourceforge.net
>________________________________________
>Get a handle on your data with "pocOLAP", the "little" OLAP project
>http://pocolap.sourceforge.net
>________________________________________
>
>__________________________________________________
>Do You Yahoo!?
>Tired of spam?  Yahoo! Mail has the best spam protection around
>http://mail.yahoo.com 
>
>  
>


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
Geoserver-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geoserver-users