Using the MultiMap Geocoding API With Coldfusion (Railo) to Encode UK Postcodes
Posted: March 16th, 2009 | Author: James | Filed under: Web Development | Tags: api, cfml, coldfusion, multimap, railo | No Comments »At the moment I’m working on a project at the moment that requires the encoding of UK postcodes to latitude and longitude for doing spatial searches on some local data. Multimap provide a REST API for doing just that and I’d been reliably informed that it was a bit more accurate than the Yahoo and Google equivalents (which mainly fall down in rural areas – of which there are plenty in Scotland).
The predominant way of consuming a REST api in CFML is through the CFHTTP tag which allows you to easily perform HTTP requests. Unfortunately, CFHTTP didn’t work straight away for me with the Multimap API – giving the following error.
MM_API_UNSUPPORTED_REQUEST_TYPE
Whenever I tried to perform even the most simple of queries. Requesting the exact same URL in my browser worked without a problem.
After searching Google to no avail the only other option I had was to inspect the raw HTTP request.
It seems that the Multimap API was fallign over due to the Content-type header generated by Axis. More specifically it was the charset option that was causing it to fail.
Content-Type: application/x-www-form-urlencoded; charset=UTF-8
Easily remedied by adding a CFHTTPPARAM for a new header with the charset omitted from the value.
<cfhttp url="http://developer.multimap.com/API/geocode/1.2/[api_key]?qs=EC4A2DY"><cfhttpparam type="header" name="Content-Type" value="application/x-www-form-urlencoded" /></cfhttp>
I’m not sure if this is a bug with the version of Railo I was using (tried on 3.0.1 and 3.0.2) or related to the Axis2 java libraries that Railo uses to implement CFHTTP. I’m yet to try it on the Adobe Coldfusion server.
Unable to Import HD Mov into iMovie 09
Posted: March 11th, 2009 | Author: James | Filed under: Photography | No Comments »As mentioned previously I got myself a Kodak Zi6 HD camera to play with on holiday. For some reason every time i tried to import the .Mov files into iMovie 09 i was getting the following error thrown up at me.
File not Found (path/to/movfile.mov)
Despite much searching I couldn’t find anyone else getting the same issue and then i noticed something… my ‘Movies’ folder in my home directory was missing. i recreated the folder and voila – import started working again. Shame iMovie couldn’t have noticed this and given me a somewhat useful error.
links for 2009-03-06
Posted: March 7th, 2009 | Author: James | Filed under: Uncategorized | No Comments »-
Simple test for checking the capabilities of mobile browsers on phones and other handheld devices
links for 2009-03-04
Posted: March 5th, 2009 | Author: James | Filed under: Uncategorized | No Comments »-
Bookmarklet for making articles easier to read