Menu

#485 Online declination lookup - value not found

0.5.97
closed
Bug_Report
2015-06-21
2015-04-29
No

This is problem I am experiencing for some time. I am not able to get declination via online declination lookup. Always it ends with message "The online declination lookup failed: declination value not found."

x86 OOM version on Win 8.1.

Discussion

  • Kai Pastor

    Kai Pastor - 2015-04-29

    Thanks for reporting. The online service seems to have changed its interface.

     
  • Kai Pastor

    Kai Pastor - 2015-04-29
    • labels: online decination lookup, fails, value not found --> georeferencing, Declination
    • status: new --> open
     
  • Matthias Kühlewein

    The returned xml file now contains <version>0.5.0.7</version>
    before the <result> element.
    The following two lines marked with //Patch Ticket #485
    provide a quick fix (inserted at line 699 in georeferencing_dialog.cpp)</result>

    if (xml.readNextStartElement() && xml.name() == "maggridresult")
    {
        if (xml.readNextStartElement() && xml.name() == "version") //Patch Ticket #485
            xml.skipCurrentElement(); //Patch Ticket #485
        if (xml.readNextStartElement() && xml.name() == "result")
        {
    
     
    • Kai Pastor

      Kai Pastor - 2015-05-06

      Okay, you found the problem: the parser is too inflexible.

      However, the solution is not to add another specific handler (for an element we don't even use yet), but rather to ignore all unknown elements.

       
  • Matthias Kühlewein

    Of course, a better (and tested) solution might look like

            if (xml.readNextStartElement() && xml.name() == "maggridresult")
            {
                while (xml.readNextStartElement())
                {
                    if (xml.name() != "result")
                        xml.skipCurrentElement();
                    else
                    {
                        while (xml.readNextStartElement())
                        {
                            if (xml.name() == "declination")
                            {
    
     
  • Kai Pastor

    Kai Pastor - 2015-06-21
    • status: open --> closed
    • Milestone: 0.6.0 --> 0.5.97
     
MongoDB Logo MongoDB