Thursday 29 July 2010

Our first testable software

We now have our first working software. This is the map display component; it runs both as a servlet and as a command line application (which produced the image on the left).

This interface will retrieve one from a specific group of maps and mark a location on it. The generic URL for a map with a pointer displayed will be http://findmylibrarybook.in/library/mapgroup?location=longitude,latitude&bearing=angle-in-degrees&resolution=string-which-matches-a-filename.

Here, "mapgroup" indicates a collection of maps (e.g. "first-floor", "SouthLondonCampus"), location indicates the position to place the pointer in latitude and longitude, bearing the number of degrees from true north to rotate the pointer graphic, and resolution the particular map to choose from the collection, in this case "mapgroup-high.extension" - the application will cope with a number of extensions and corresponding file formats, but will choose the first matching one if there are identically named files but for the extension.

We have some test URLs to see a variety of behaviour of the servlet, including the expected errors from incorrect URLs (e.g. specifying a non-numeric latitude or orientation). Note that these are not guaranteed to continue to work, as we refine the software. Further work clearly needs to be done to refine the display of the arrow (persuading the Java JAI that the rotated image should be surrounded by a transparent rather than a black background). The map graphics used come from OpenStreetMap and from the LSE hosted archive of the Booth maps of poverty in London at the end of the nineteenth century.

Note: The links below have been updated to reflect the new working location of the test locator (there were java versioning problems in the old location which prevented the servlet working properly). The new location does not have a commercial web server certificate but will only accept external connections via https, so access will require the user to accept a self signed certificate (i.e. one which a web browser will flag as invalid).

Firstly, https://far-project.lse.ac.uk/LibraryLocator/DisplayMap/lse-campus?resolution=openstreetmaplibrary&;location=51.514532,-0.117057 should place arrow pointing due north.

Rotate arrow to each quadrant

https://far-project.lse.ac.uk/LibraryLocator/DisplayMap/lse-campus?resolution=openstreetmaplibrary&location=51.514532,-0.117057&bearing=35

https://far-project.lse.ac.uk/LibraryLocator/DisplayMap/lse-campus?resolution=openstreetmaplibrary&location=51.514532,-0.117057&bearing=162

https://far-project.lse.ac.uk/LibraryLocator/lse-campus?resolution=openstreetmaplibrary&location=51.514532,-0.117057&bearing=223

https://far-project.lse.ac.uk/LibraryLocator/DisplayMap/lse-campus?resolution=openstreetmaplibrary&location=51.514532,-0.117057&bearing=309

Different maps

https://far-project.lse.ac.uk/LibraryLocator/DisplayMap/lse-campus?resolution=openstreetmapclose&location=51.514532,-0.117057&bearing=162

https://far-project.lse.ac.uk/LibraryLocator/lse-campus?resolution=openstreetmapmedium&location=51.514532,-0.117057&bearing=162

https://far-project.lse.ac.uk/LibraryLocator/DisplayMap/lse-campus?resolution=openstreetmaplarge&location=51.514532,-0.117057&bearing=162

Errors

This should display map with no arrow (because the requested position is off the map): https://far-project.lse.ac.uk/LibraryLocator/DisplayMap/lse-campus?resolution=booth&location=51.514532,-0.117057&bearing=162

This should return 404 not found (no map file of that name): https://far-project.lse.ac.uk/LibraryLocator/lse-campus?resolution=openstreetmaplibrary&location=71.514532,5.117057&bearing=309

This should return 503 (because location doesn't make sense): https://far-project.lse.ac.uk/LibraryLocator/lse-campus?resolution=openstreetmaplibrary&location=71.gdsryer514532,5.117057&bearing=309

No comments:

Post a Comment