Second – and this is where it gets really interesting – they presented an approach where multiple data sources are fused together in the visualization stage. The idea is that it is easier to query multiple data sources (e.g., using web services) in the visualization layer than to keep composite or centralized data stores in sync. Merging data this late in the game likely doesn’t make sense in all cases (e.g., if complex analysis or transformation is required), but the basic advantages are clear: users benefit from an integrated display of data in one system when they would previously have consulted two."An integrated display of data" sounds a lot like a tile cache.
Showing posts with label wms. Show all posts
Showing posts with label wms. Show all posts
Wednesday, March 2, 2011
and the shift away from W*S architecture continues
On the Safe blog, Paul Nalos writes about Iowa DOT's data publishing strategy:
Saturday, February 19, 2011
Overcome By Events or Rearranging Deck Chairs
OBE, the polite acronym to signify that you have become irrelevant. Compare these two requests to a tile server and a Web Map Server:
Cloudmade/OSM tile server
http://b.tile.cloudmade.com/BC9A493B41014CAABB98F0471D759707/1/256/15/17599/10746.png
Web Map Server (from ESRI example)
Don't get me wrong, W*S style services will have a long tail, because we've spent a decade expounding it's virtues to the Federal government. However, it's time we recognize the WMS is OBE.
UPDATE:
http://hostname/deploy_name/com.esri.wms.Esrimap?SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&LAYERS=Oceans,Countries,Cities&STYLES=&SRS=EPSG:4326&BBOX=-124,21,-66,49&WIDTH=600&HEIGHT=400&FORMAT=image/png
Both requests return a map, but which one would you rather use? The tile server URL can be generated programmatically. The WMS URL requires a GetCapabilities handshake, parsing an XML doc, and formulating a request. It's true that you can compose a map with a WMS, but are developers (or even users) interested in all that sausage making? Amazon now supports static website hosting in S3 storage; cheap storage and hosting all in one, boom. Tools such as TileMill ease the process of generating tiles without the clunkiness of Style Layer Descriptor (SLDs) used by WMS. Don't get me wrong, W*S style services will have a long tail, because we've spent a decade expounding it's virtues to the Federal government. However, it's time we recognize the WMS is OBE.
UPDATE:
"we'll lie in the W*S beds we've made" - Sean Gillies
Saturday, July 5, 2008
Making GeoWebCache authenticate to a WMS
GeoWebCache is a java implementation of TileCache. Geowebcache does not connect to secured a WMS, so I added support for it (yay! for open source).
The WMS GetMap requests are in WMSMetaTile.java (../geowebcache-0.8.3/src/main/java/org/geowebcache/layer/wms). I thought that the best place to put the username and password was in the WMS service url, which is set in the properties file for the layer (../geowebcache/WEB-INF). This takes the form of http://username:password@www.mapserver.com/ .
Alternatively you can also put username and password in the vendor parameters, but that could get dodgy if you have other vendor parameters.
From googling RFC 2716 related documents, the username and password has to be sent in the http Authorization request header in the form of username:password encoded in base64. Real secure, huh?
So here's the code:
private void forwardRequest(WMSParameters wmsparams, String backendURL,
WMSLayerProfile profile) throws IOException, ConnectException,
ServiceException {
// extract username and password from service url if there
String encoding = null;
int upTest = backendURL.indexOf("@");
if (upTest>0) {
String[] temp = backendURL.split("@");
backendURL = "http://"+temp[1];
String usernamePassword = temp[0].substring(temp[0].lastIndexOf("/")+1,temp[0].length());
encoding = new sun.misc.BASE64Encoder().encode (usernamePassword.getBytes());
}
//Get user name and password from vendor parameters
//Vendor parameter key is "logon"
//Need to add iterator in case of multiple vendor parameters
/*
if (profile.vendorParameters!=null) {
String[] temp =profile.vendorParameters.split("=");
if (temp[0].equalsIgnoreCase("logon") {
String usernamePassword= temp[1];
//usernamePassword = usernamePassword.substring(usernamePassword.indexOf("=")+1,usernamePassword.length());
String encoding = new sun.misc.BASE64Encoder().encode (usernamePassword.getBytes());
}
}
*/
// Create an outgoing WMS request to the server
Request wmsrequest = new Request(backendURL, wmsparams);
URL wmsBackendUrl = new URL(wmsrequest.toString());
log.info("the request: "+wmsrequest.toString());
URLConnection wmsBackendCon = wmsBackendUrl.openConnection();
//if username and password required set header
if (!(encoding==null)) {
wmsBackendCon.setRequestProperty ("Authorization", "Basic " + encoding);
}
...
Subscribe to:
Posts (Atom)