EWX

From CHG-Wiki
Jump to navigationJump to search

Adding a "style" to the EWX GeoServer

Styles modify the maps being displayed by the EWX server. The GeoServer v.2.1.1 uses the Styled Layer Descriptor (SLD) markup language to do this. An intro to SLD can be found at:

http://docs.geoserver.org/2.1.1/user/styling/sld-introduction.html

The styles are locate is this directory:

C:\EWX\geoserver-2.1.1\data_dir\styles

They consist of a .sld and a .xml file. The xml file is generated by the GeoServer upon submission of the sld file. A new SLD style file has to be submitted through the GeoServer admin interface located at:

http://chg2.geog.ucsb.edu:8080/geoserver/web

Log in as admin after you have received the password from Marty. Then click the "styles" link in the left hand pane and then click on "Add a new style". You can then copy and paste your SLD content into the editing window and use the "Validate" button to validate the markup code. You have to click the "Submit" button for the GeoServer to create the xml and sld files in the styles directory. You can then use the name you entered in the "Name" box in the datasets.xml file to connect a dataset to the new style. The datasets.xml file is located at:

C:\EWX\geoserver-2.1.1\data_dir\updater

The name is entered as the style attribute to the statistic tag of the dataset tag.

If the style is being applied an existing dataset:

  • set the dataset reloadAll tag to true
  • remove the datasets workspace located at: C:\EWX\geoserver-2.1.1\data_dir\workspaces\…
  • stop and restart EWX in a cygwin terminal window on CHG2 with the following commands:
    • cd /cygdrive/c/EWX/apache-tomcat-6.0.33/bin
    • ./catalina.bat stop
    • cd /cygdrive/c/EWX/apache-tomcat-6.0.33/bin
    • ./catalina.bat start

Tips

Use the GeoServer admin interface to edit and modify your SLD file as it will color code your markup and you can submit and apply the modified version in the interface. You can then examine the results by going to and EWX window (http://chg2.geog.ucsb.edu:8080/EWX/index.html and opening the dataset. If you are iterating through multiple changes, you will need to either remove the GeoWebCache files at:

C:\EWX\geoserver-2.1.1\data_dir\gwc

or avoid viewing the same dataset and time period by progressing through the time series.


You can look for errors in the EWX console that appears when you start EWX up or look in the log files at:

C:\EWX\apache-tomcat-6.0.33\logs\catalina.yyyy-mm-dd.log