| Weblog: |
|
Updating hurricane web maps for Ivan and Jeanne
|
| Subject: |
|
a question about the webserver |
| Date: |
|
2004-09-17 20:43:52 |
| From: |
|
joshyx
|
|
|
|
Hi Tyler. I've been working on a simple webstart Java app that will show the current hurricane. I've been able to load each layer using code like this:
StringBuffer sb = new StringBuffer();
sb.append("http://dev.gomoos.org/cgi-bin/wms_nhc?");
sb.append("request=GetMap");
sb.append("&format=image/gif");
sb.append("&srs=EPSG:4269");
sb.append("&version=1.1.1");
sb.append("&layers="+layer);
//sb.append("&bbox=-100+100+200+200");
try {
URL url = new URL(sb.toString());
Unfortunately this shows the entire country. How do you set the size of the bounding box? Do you have to provide some coordinates in lat/long units?
Thanks,<br/>
- Joshua
BTW, if you want to see the app: click here:
http://code.joshy.org/projects/stormdrain/StormDrain.jnlp
|
Showing messages 1 through 1 of 1.
|
Showing messages 1 through 1 of 1.
|
First, a couple tips.
The OpenGIS WMS specs can very helpful (here)
A quick read says that the bbox syntax you used is wrong (sorry :), the coordinates must be comma-separated. i.e. &bbox=-180,-90,180,90 will give a map for the whole earth. Bbox defines the geographic extents shown on the map, so you just need to hone that down a little bit.
Second tip, if you build your own URL and make some mistake, the provider will often return a message that is quite helpful. For example, I tried:
and got back an XML doc with this message:
Once I replaced with a (more?) valid coordinates and put in commas instead of +, then it works.
The only other factor that you may not be familiar with is the ability to request an image size. This is done using and and is given in pixel size.
Here's one URL I came up with for a tiny image.