anchor.diff:  
     //1-tt, 2 - tst ,  4-pt, 5-pst, 7-rt, 8 - rst , 10- flags
   
  -  FTileExpression.Expression:='^(\w{2,2})(\d+)((p\w)(\d+))?((r\w)(\d+))?(f(\d+))?$';
  +//  FTileExpression.Expression:='^(\w{2,2})(\d+)((p\w)(\d+))?((r\w)(\d+))?(f(\d+))?$';
  +
  +  //1-tt, 2 - tcode, 3 - tflip , 4-road (5 6 7) 8 - river (9 10 11)
  +
  +  FTileExpression.Expression:='^(\w{2,2})(\d+)(.)((p\w)(\d+)(.))?((r\w)(\d+)(.))?$';
  +
     FTileExpression.Compile;
   end;
   
  
positive.code: var
    s: string;
  begin
  //  [terrain code][terrain index]
  //[P][path type][path index]
  //[R][river type][river index]
    s := TERRAIN_CODES[tile^.TerType]+IntToStr(tile^.TerSubType);
  
    if tile^.RoadType <> 0 then
    begin
      s := s + ROAD_CODES[TRoadType(tile^.RoadType)]+IntToStr(tile^.RoadDir);
    end;
  
    if tile^.RiverType <> 0 then
    begin
      s := s + RIVER_CODES[TRiverType(tile^.RiverType)]+IntToStr(tile^.RiverDir);
    end;
  
    if tile^.Flags <> 0 then
    begin
      s := s + 'f' + IntToStr(tile^.Flags);
    end;
  
    AJson.Add(s)
  
  
negative.code: end;
  
  procedure TMapReaderJson.DeStreamTile(Encoded: string; Tile: PMapTile);
  
    function ParseFlip(Src: AnsiChar): Uint8;
    begin
      //('_','-','|','+');
      case Src of
        '_': Result := 0;
        '-': Result := 1;
        '|': Result := 2;
        '+': Result := 3;
      else
        raise Exception.CreateFmt('Invalid tile flip %s',[Src]);
      end;
    end;
  
  var
    terrainCode: String;
    tt: TTerrainType;
  