Wednesday, June 6, 2012

Using GeoServer to replace TerraServer DRG wms service


Another awe-inspiring moment provided by GeoServer.

Recently, MSRMAPS (used to be TerraServer), a WMS server for DRGs and DOQs is being dropped by Microsoft. Nobody really cares about the DOQs, but this was just about the only DRG WMS server out there.

Looking around, I found that the USGS has a DRG server:

http://raster.nationalmap.gov/ArcGIS/services/DRG/TNM_Digital_Raster_Graphics/MapServer/WMSServer?request=GetCapabilities&service=WMS

However it is split into UTM zones and different resolutions. I just wanted 4326 for the entire US, like Terraserver.

So, I created a GeoServer Amazon EC2 Micro (free for a year!) instance using the basic Amazon Linux AMI ami-e565ba8c, and put on just Tomcat and Geoserver 2.2 Beta 2:

sudo yum update
sudo yum install httpd httpd-devel tomcat7
wget http://sourceforge.net/projects/geoserver/files/GeoServer/2.2-beta2/geoserver-2.2-beta2-war.zip/download
unzip geoserver-2.2-beta2-war.zip
sudo chown tomcat:tomcat geoserver.war
sudo mv geoserver.war /var/lib/tomcat7/webapps/
sudo /sbin/service httpd start
sudo /sbin/service tomcat7 start

and then added a WMS Store and used the GetCapabilities above. It automatically adds all the layers and publishes them.

Then I put together a Layer Group with all the layers, the only change was to check the "Default Style" box, otherwise I would get a WMS error.
Set the coordinate system for the Layer Group to EPSG:4326, and it worked.

Thank you GeoServer team!

Roger