Sign In/My Account | View Cart  

advertisement

AddThis Social Bookmark Button

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

Full Threads Oldest First

Showing messages 1 through 1 of 1.

  • Tyler Mitchell photo a question about the webserver
    2004-09-17 21:24:21  Tyler Mitchell | O'Reilly AuthorO'Reilly Blogger [View]

    Hi Joshua, thanks for commenting. You are only a step away from satisfaction!

    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:
    http://dev.gomoos.org/cgi-bin/wms_nhc?request=GetMap&format=image/gif&srs=EPSG:4269&version=1.1.1&layers=frances_track&bbox=-100+100+200+200

    and got back an XML doc with this message:
    Wrong number of arguments for BBOX.


    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
    &height
    and
    &width
    and is given in pixel size.

    Here's one URL I came up with for a tiny image.
    http://dev.gomoos.org/cgi-bin/wms_nhc?request=GetMap&format=image/gif&srs=EPSG:4269&version=1.1.1&layers=land,frances_track&bbox=-120,20,0,40&width=200&height=150


Showing messages 1 through 1 of 1.