pike.git / lib / modules / Geography.pmod / Position.pike

version» Context lines:

pike.git/lib/modules/Geography.pmod/Position.pike:24:   //! a dwim scan on the strings. If they   //! fails to be understood, there will be an exception.      void create(int|float|string _lat,void|int|float|string _long)   {    if (stringp(_lat))    {    if (zero_type(_long))    {    string tmp; -  if (sscanf(_lat,"%sN %s",tmp,_long)==2) _long=tmp+"N"; -  else if (sscanf(_lat,"%sS %s",tmp,_long)==2) _long=tmp+"N"; -  else if (sscanf(_lat,"%s %s",tmp,_long)==2) _long=tmp; +  if (sscanf(_lat,"%sN %s",tmp,_long)==2) _lat=tmp+"N"; +  else if (sscanf(_lat,"%sS %s",tmp,_long)==2) _lat=tmp+"S"; +  else if (sscanf(_lat,"%sW %s",tmp,_lat)==2) _long=tmp+"W"; +  else if (sscanf(_lat,"%sE %s",tmp,_lat)==2) _long=tmp+"N"; +  else if (sscanf(_lat,"%s %s",tmp,_long)==2) _lat=tmp;    }    _lat=dwim(_lat,"NS");    if (stringp(_lat))    error("Failed to understand latitude %O\n",lat);    }    if (stringp(_long))    {    _long=dwim(_long,"EW");    if (stringp(_long))    error("Failed to understand longitude %O\n",long);
pike.git/lib/modules/Geography.pmod/Position.pike:158:   int `>(object pos)   {    if (pos->lat<lat) return 1;    else if (pos->lat==lat && pos->long<long) return 1;    return 0;   }      string _sprintf(int t)   {    if (t=='O') -  return "Position("+longitude()+", "+latitude()+")"; +  return "Position("+latitude()+", "+longitude()+")";    return 0;   }