WMS Tool for OpenEV
The purpose of this tool is to give OpenEV access to WMS services. This is a beta version.
wmstool.py (v1.07b, 09/14/2005)
As it is a Tool, put it in the tools directory.
Before using it from OpenEV, run it from the command line. This
will create the wms directory structure under OpenEV's root where the
cache dir and the data files will reside. This will also create two
service entries. You have to be connected to the Internet for this to
work, as it will send a GetCapabilities request to the servers. If all
goes well, you should have globe.digitalearth.gov/GLOBE.xml and
wms.jpl.nasa.gov/OnEarth.xml in the services directory. Note that this step is not necessary if you are
using FWTools 0.98 and up as the setup is already done.
09/14/05 Important Before upgrading FWTools, backup your wms directory or it will be overwritten.
06/15/05 I have become aware that some USGS services were not set properly in FWTools 0.98...
you should redo the setup to make sure all services are available.
There is one default map (True Color Landsat). If you want more preset maps,
d/l this file: maps.dat. Note however that you will need
to create more service entries for these maps (if it's not already done). The easy way to do this is to d/l
services.txt, put it in the tools dir and give it as
a parameter to wmstool.py on the command line (ie python wmstool.py services.txt).
All the necessary entries will then be created.
06/15/05 If maps.dat cannot be loaded, try converting it to cr only (Mac) or lf only (Linux/Unix).
This page shows the nomenclature used.
Quick Start
Setting up a map:
- It is preferable (but not necessary) to have an image already opened in the view. If the Auto-update Toggle
is on, the parameters will reflect those of the current view or those
of the current layer, depending on which mode is selected.
- The Corners, Resolution and Size
entries will adapt to the current projection. If it is geographic, they
will be in the DMS format, otherwise, they will be in meters format.
- At this point, if you are satisfied with the parameters, click on the Get Map Button to fetch the map from the server.
- The map can be validated by clicking the Validate Map Button. Any problems with the map will show up there.
Note that the url is automatically copied to the clipboard when the Map Validation Window opens. I found that to be quite useful...
- You can also manually change the parameters. All the entries are connected so that any change in one entry
will modify the others accordingly. Note however that if Auto-update Toggle is on and you modify the view,
all entries will again show the view's parameters.
- The Link X-Y Toggle does
what it says and should always be on as OpenEV doesn't react very well
with X and Y having different values (or at least, I don't understand
what it does). It is merely a convenient way to set both resolutions to
the same value.
- The EPSG Entry should not
be modified in most cases. It is useful only when building a map from
scratch or when the EPSG required is not supported by GDAL, as it is
the case with Mars imagery for example. Even then, the EPSG assigned to
the returned map will be 4326. There is currently no way to go around
that...
- The Extent Entry
will rarely show up (the GLOBE server is the only one I know that makes
use of it) but when it does, you can modify the values by clicking the Edit Extents Button.
- Here's a MODIS image of the world to use as a starting point.
Adding a new map:
- Click on the Setup Button. This will open the Setup Dialog.
- Click the New Map Button. You can enter the map's title and name now or before saving it.
The name is an identifier for tracking it in the cache.
- Select the desired service with the Service Selector (only one service per map)
- Select the desired layers in the Layer Tree. Left-click will select/deselect the layer.
Right-click will open the Layer Properties Dialog. The layer can be selected there as well.
You set the desired style in this dialog with the Style Selector as well as any extents.
- Select the image and exception formats using the Format Selector and the Exception Selector.
- If not done already, enter the map's title and name now.
- Click the Save Map Button. The map is added to the list but not saved on disk yet.
The whole map list will be saved when the Done Button is clicked.
- Click the Validate Map Button to verify the map. This step is not necessary and can be done at any time.
- The map's parameters can be modified at any time. Make sure you click the Save Map Button to record the changes.
- You can also validate and/or get a map without saving it or naming it (ie, leave title and name as they are).
Useful to try a map with a new service.
Adding a new service
- Click on the Setup Button (if you don't already have the Setup Dialog opened).
- Click the New Service Button.
- Type (or paste if it was copied to the clipboard) the service's url into the Service Selector
(which really acts as a text entry at this point). If the url ends with '?',
the proper parameters will be appended automatically. Otherwise, make sure
they're all present. When the url is entered, hit the ENTER key. This
will open communication with the service and (hopefully) return its
capabilities, which will then be displayed.
- If all went well and you want to keep this service, click the Save Service Button.
This will create a directory entry hostname under the services directory (if it doesn't exist already)
and save the capabilities file using the title in the Service Selector's entry as the filename.
You can change this title there or simply rename the file later.
- It is not necessary to click the Done Button to record changes since this only applies to maps.
- If something went wrong, you will get an error message saying that the file caps-tmp.xml was
saved. Usually, that will be because of errors in the xml file. You can
correct the file and try again, using the file directly this time (ie
enter the filename in the Service Selector's entry). Once the service is correctly setup and saved, you can delete this file.
- Another way to add a service is to create the directory entry
yourself and put the capabilities file there. It will be picked
up the next the tool is used.
- Or use the command line approach described above...
- The Delete Service Button is there as a convenience as it only deletes the capabilities file, which you can do yourself, really :)
- Note that only 1.1.x services are supported (and some 1.0.x).
Tips (for advanced users)
- New!You can define a http proxy in the preferences file.
- If you want the tool to be accessible from the icon bar, uncomment line 492. This will add an icon next to the Open File icon.
For now, the worldrgb.xpm will be used until I come up with a custom icon.
- If you want to have a more suitable background color than OpenEV's default black, uncomment line 523. This will set the
color to yellow.
There may be more explanations later if they are required...
If you have any comments (favorable or not!) please post them on the OpenEV's discussion list.
Thank you and enjoy!
Last modified: September 14th, 2005