LizardTech.com

Archive for September, 2013

Extending Express Server Functionality with GeoServer

Monday, September 23rd, 2013

Got five minutes? That’s all it takes to add GeoServer to an existing installation of Express Server.

GeoServer is an open source server for geospatial data and imagery. It includes support for Shapefiles, GeoTIFF, PostGIS, and much more.  You can use GeoServer to distribute imagery via standard protocols, including WMS, WFS, and WCS.

In the example below, LizardTech’s GeoViewer software displays imagery from Express Server and GeoServer. The basemap layer is a MrSID image hosted by Express Server. The vector layer is a shapefile of all the roads in Washington hosted by GeoServer.

GeoServer_imagery_in_GeoViewer

To install GeoServer on the machine that hosts the Express Server, complete the following steps:

  1. Open a web browser and navigate to the GeoServer Stable Download page:
    http://geoserver.org/display/GEOS/Stable
  2. Download the GeoServer Web Archive.
  3. Navigate to the directory where you downloaded the web archive, and extract the contents of the zip file.
  4. Copy the geoserver.war file to the following directory:<Express Server Installation Directory>\ImageServer\Tomcat\webapps
  5. Restart Tomcat.
    • On Windows, open the Services utility, right-click the LizardTech Express Server Tomcat Service, and click Restart.
    • On UNIX, open a terminal and enter the following command to stop Tomcat:
      sudo /etc/init.d/lttomd stop

      Then, enter the following command to start Tomcat:

      sudo /etc/init.d/lttomd start

To open the GeoServer Web Administration Interface, navigate to the following URL:

https://localhost:8443/geoserver

The GeoServer Welcome page appears:

GeoServer_ Welcome

Note that the URL uses https. Because Express Server’s configuration of Tomcat uses https for the Express Server Manager, GeoServer also uses https. To access imagery via WMS with GeoServer, use the following URL in your GIS software:

https://localhost:8443/geoserver/wms?

Note that GeoViewer currently only supports http connections.

To allow connections to GeoServer over http, complete the following steps:

  1. Open the following Tomcat configuration file:
    <Express Server Installation Directory>\ImageServer\Tomcat\conf\server.xml
  2. Search for the following line:
    <!--<Connector port="8080" protocol="HTTP/1.1"
                   connectionTimeout="20000"
                   redirectPort="8443" />-->
  3. Remove the opening and closing comment brackets (<!-- and -->.)
  4. Save the file and restart Tomcat.

Now, when you access GeoServer imagery via WMS, you can use the following URL:

http://localhost:8080/geoserver/wms?

For more information on how to use and configure GeoServer,  refer to the GeoServer documentation.

Viewing Express Server Imagery with Leaflet

Tuesday, September 10th, 2013

Did you know that you can view Express Server imagery with Leaflet via WMS? Leaflet is an open-source JavaScript library for creating rich, interactive web maps.

In the example below, we’ve used Leaflet to display a raster layer of Washington state, a raster basemap layer, and a marker icon that identifies the location of the LizardTech office. The raster layers are stored in the MrSID format on the LizardTech demo Express Server and displayed via WMS. Note that out of the box, Leaflet includes keyboard controls, smooth zoom, support for mobile interactions, and many other features. Additionally, because Leaflet is styled with CSS3, it’s easy to customize pop-ups, controls, and even transitions.

To create the above map, complete the following steps:

  1. Download Leaflet and extract the files.
  2. Create an html file in the same directory where you extracted the Leaflet files.
  3. Link to the Leaflet stylesheet and JavaScript file in the document head.
  4. Paste the following code in the document body:
<div id="div_map" style="width: 800px; height: 600px;">
</div>
	
<script>
						
var washington = new L.tileLayer.wms(
'http://demo.lizardtech.com/lizardtech/iserv/ows', {
    layers: 'Washington',
    maxZoom: 18,
    format: 'image/png',
    transparent: true
});		
		
var modis = new L.tileLayer.wms(
'http://demo.lizardtech.com/lizardtech/iserv/ows', {
    layers: 'MODIS',
    maxZoom: 18,
    format: 'image/png',
    transparent: true
});
		
var map = new L.map('div_map', {
    center: new L.LatLng(47.60489, -122.33695), 
    zoom: 12,
    layers: [modis,washington],
    zoomControl: true
});
		
var marker_LT_office = new L.marker(
[47.60489, -122.33695]).addTo(map);
marker_LT_office.bindPopup("The LizardTech office!");
		
</script>