Web Accessibility and Online GIS

March 19, 2007

Is it impossible?!

Online maps are visual, there is no getting round this basic premise. The use of a summary attribute for a map element in a page is the only thing I can think of that would be of any use. This works in the same was as an alt attribute for an image – screen readers will read this text out to users who have problems visual impairments.

As the majority of online mapping servers generate images as output there could probably be further development in customising the ALT attributes of these images to provide more detailed information of the current map state, so rather than alt=”A Map”, alt=”Map showing towns and major roads.” This alt text could be derived from visible layers, and the centre coordinates of the current map location.

I tried running one of my map URLs on the online validator at http://webxact.watchfire.com/ which tests “single pages of web content for quality, accessibility, and privacy issues.” It timed out…

http://wave.webaim.org/wave/Output.jsp performs similar checks..what can best be described as a mess was returned along with lots of “page not found errors.”

Fortunately clients do not seem to demand that accessibility standards are met for mapping pages, but with increasing legislation in many countries for websites to be usable by people with disabilites it is definitely an area that needs further work.

Advertisement

Some Notes on Web Standards and XHTML

March 19, 2007

I am starting to develop more and more online GIS and mapping applications, and to stop all the wiggly lines in Visual Studio I am trying to implement appropriate web standards. A good introductory article can be found here:  

http://msdn2.microsoft.com/en-us/library/aa479043.aspx

My summary…

 There are several versions of XHTML:

  • XHTML 1.0 Transitional – most similar to HTML
  • XHTML 1.0 Strict – most similar to XML
  • XHTML 1.0 Frameset – to allow the use of frames
  • XHTML 1.1 – allows additional elements in languages such as SVG
  • XHTML 2.0 – is apparently on the way
  • Depending on which language is used the page should contain the correct DOCTYPE e.g.

    <!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Strict//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd”&gt;

    In ASP.NET 2.0 every control renders valid XHTML 1.0 transitional output by default (not strict XHTML..ASP 1.1 controls do not even meet the transitional criteria) . As code is used to generate XHTML then pages cannot be validated at design time. However a URL can be validated at the following site http://validator.w3.org/ – this checks the actual XHTML output seen by the browser.

    When using JavaScript in a web page, the script shold be enclosed in a CDATA (character data)  section. This stops the browser interpreting < or > as XML tags.  The CDATA section start and end should be enclosed in JavaScript comment tags to avoid errors:

    /* <![CDATA[ */

    {}
    /* ]]> */
     


    No New Objects Added…

    March 9, 2007

     If only Visual Studio would open in the same state that it was closed..

    Excluded DLLs in set up packages seem to re-include themselves, projects in solutions disappear, and today an ArcObects command seemed to have disappeared.

    All had previously been running without problems in debugging mode, opening ArcMap and then stopping at various breakpoints. However today no breakpoints were hit. Not even on the OnCreate or New functions of the BaseCommand. The button in ArcMap had disappeared. Adding it manually from the .tlb gave the “No New Objects Added” message.

    Some time later after much blood, sweat, (and possibly tears), I delved into the registry. I searched for the class ID in key values and names. The class ID can be found in the class code file of the tool:

    Public ConstClassId As String = “480d624c-3d4c-4210-ae11-0c775dddc35d”

    Then I took the rather risky step of deleting all these keys. If anyone does the same I’d recommend making a backup of the registry first – not that I did myself..
    Anyway I think the class must have been registered twice, or there was an error in the registry, as the next time I started the project with debugging everything had started working again =)


    Some ArcToolbox Commands

    March 6, 2007

    A few sample ArcToolbox commands I’ve been using recently. These can be run from the command line available in ArcCatalog (in the menu select Window >> Command Line).

    workspace C:\MyPath\MyGeoDatabase.mdb
    Intersect (featureClass1”;’featureDataset1\featureClass2′ ”) my_output_featureClass ALL # INPUT

    This automates the Intersect tool, found in ArcToolbox under “Analysis Tools >> Overlay >> Intersect” and is useful if this is a process that has to be run several times, and can be part of a batch process. The first line sets the workspace to a geodatabase containing the two input classes, and the second line runs the intersect, outputting all fields to my_output_featureClass.

    workspace C:\MyPath\MyGeoDatabase.mdb
    delete myFeatureClass

    This command deletes a feature class in the geodatabase.

    More samples can be found in the ArcGIS Desktop Help under the “Geoprocessing tool reference” section.

    commandline.png


    Microsoft Access Queries

    March 2, 2007

    With the arrival of MS Access as the “personal” (i.e. restricted…) geodatabase of choice, I along with many others have had to get familiar with using SQL and Access. The graphical query generator (I am currently using MS Access 2002) seems to like to make the statements as verbose as possible, even thoigh relatively simple SQL still runs. Anyway below are some of my often used queries.

    • To copy data from one table to another (where both fields in both tables match). This is useful when two identical datasets cover two different geographical areas but need to be combined into a larger datasets.

    INSERT INTO Table1( Field1, Field2)
    SELECT Field1, Field2
    FROM Table2;

    • To create a new field in a table using a SQL statement (useful if you have to update many tables).

    ALTER TABLE Table1 ADD COLUMN MyStringField STRING;

    • To combine the results of two queries with the same fields (the top 15 values from one subquery, and a specific record from another).

    SELECT TOP 15 Field1, Field2
    FROM Subquery1
    UNION
    SELECT Field1, Field2
    FROM Subquery2
    WHERE Field1 = 272;

    More to follow (they get harder to explain!)…